cn.flood.cloud.gateway.handler.IndexHandler Maven / Gradle / Ivy
package cn.flood.cloud.gateway.handler;
import cn.flood.enums.EnvType;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
/**
* 网关默认首页
*
* @author mmdai
*/
@RestController
public class IndexHandler {
@Value("${spring.profiles.active}")
private String env;
@GetMapping("/")
public Mono index() {
return Mono.just(desc());
}
private String desc() {
StringBuilder sb = new StringBuilder(100);
sb.append("FloodCloud gateway has been started!");
if (!EnvType.PROD.getCode().equals(env)) {
sb.append("
");
sb.append("- 文档地址:doc.html
");
}
return sb.toString();
}
}