【修复】SwaggerConfig只扫描基础包下的接口
This commit is contained in:
parent
69493bc7f7
commit
cad3c4afe2
@ -25,6 +25,7 @@ XiaoNuo采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注
|
|||||||
package com.cn.xiaonuo.sys.config;
|
package com.cn.xiaonuo.sys.config;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.cn.xiaonuo.core.consts.CommonConstant;
|
||||||
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
|
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
@ -70,7 +71,7 @@ public class SwaggerConfig {
|
|||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
.apiInfo(apiInfo())
|
.apiInfo(apiInfo())
|
||||||
.select()
|
.select()
|
||||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
.apis(RequestHandlerSelectors.basePackage(CommonConstant.DEFAULT_PACKAGE_NAME))
|
||||||
.paths(PathSelectors.any())
|
.paths(PathSelectors.any())
|
||||||
.build()
|
.build()
|
||||||
.globalOperationParameters(parameters);
|
.globalOperationParameters(parameters);
|
||||||
|
@ -27,6 +27,7 @@ package com.cn.xiaonuo.modular.controller;
|
|||||||
import com.cn.xiaonuo.core.pojo.response.ResponseData;
|
import com.cn.xiaonuo.core.pojo.response.ResponseData;
|
||||||
import com.cn.xiaonuo.core.pojo.response.SuccessResponseData;
|
import com.cn.xiaonuo.core.pojo.response.SuccessResponseData;
|
||||||
import com.cn.xiaonuo.modular.service.DatasourceExampleService;
|
import com.cn.xiaonuo.modular.service.DatasourceExampleService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@ -45,28 +46,28 @@ public class DatasourceExampleController {
|
|||||||
@Resource
|
@Resource
|
||||||
private DatasourceExampleService datasourceService;
|
private DatasourceExampleService datasourceService;
|
||||||
|
|
||||||
@RequestMapping("/niceDay")
|
@GetMapping("/niceDay")
|
||||||
public ResponseData niceDay() {
|
public ResponseData niceDay() {
|
||||||
return new SuccessResponseData("nice day");
|
return new SuccessResponseData("nice day");
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/masterDatasource")
|
@GetMapping("/masterDatasource")
|
||||||
public ResponseData masterDatasource() {
|
public ResponseData masterDatasource() {
|
||||||
return new SuccessResponseData(datasourceService.masterDatasource());
|
return new SuccessResponseData(datasourceService.masterDatasource());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/backupDatasource")
|
@GetMapping("/backupDatasource")
|
||||||
public ResponseData backupDatasource() {
|
public ResponseData backupDatasource() {
|
||||||
return new SuccessResponseData(datasourceService.backupDatasource());
|
return new SuccessResponseData(datasourceService.backupDatasource());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/datasourceTransactionNone")
|
@GetMapping("/datasourceTransactionNone")
|
||||||
public ResponseData datasourceTransactionNone() {
|
public ResponseData datasourceTransactionNone() {
|
||||||
datasourceService.datasourceTransactionNone();
|
datasourceService.datasourceTransactionNone();
|
||||||
return new SuccessResponseData();
|
return new SuccessResponseData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/datasourceTransaction")
|
@GetMapping("/datasourceTransaction")
|
||||||
public ResponseData datasourceTransaction() {
|
public ResponseData datasourceTransaction() {
|
||||||
datasourceService.datasourceTransaction();
|
datasourceService.datasourceTransaction();
|
||||||
return new SuccessResponseData();
|
return new SuccessResponseData();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user