prefs: engine 端增加系统启动默认页,增加友好提示。

Signed-off-by: feihu.wang <wfh45678@163.com>
This commit is contained in:
feihu.wang 2019-11-20 11:54:26 +08:00
parent 771a7d1e6e
commit 8eb85cd05e
3 changed files with 34 additions and 1 deletions

View File

@ -21,7 +21,7 @@ public class SwaggerConfig {
.apiInfo(buildApiInf())
.select()
.apis(RequestHandlerSelectors.basePackage("com.pgmmers.radar.controller"))
.paths(PathSelectors.any())
.paths(PathSelectors.regex("/services/.*"))
.build();
}

View File

@ -0,0 +1,22 @@
package com.pgmmers.radar.controller;
import com.pgmmers.radar.service.common.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* engine 启动首页.
* @author wangfeihu
*/
@RestController
public class IndexController {
@GetMapping(value = {"/", ""})
public CommonResult index(HttpServletRequest request) {
CommonResult result = new CommonResult(Boolean.TRUE, "100", "Engine is running");
result.getData().put("swagger url:", request.getRequestURL() + "swagger-ui.html");
return result;
}
}

View File

@ -58,6 +58,17 @@ public class CommonResult implements Serializable{
this.data = data;
}
public CommonResult () {
}
public CommonResult(boolean success, String code, String msg) {
this.success = success;
this.code = code;
this.msg = msg;
}
@Override
public String toString() {
return "CommonResult [success=" + success + ", msg=" + msg + ", code=" + code + "]";