knife4J文档相关

master
wj 2 years ago
parent a6aa0f5dbf
commit d8496e87e9

@ -333,6 +333,21 @@
<artifactId>commons-text</artifactId> <artifactId>commons-text</artifactId>
<version>1.1</version> <version>1.1</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-metadata</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.9</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -0,0 +1,37 @@
package com.glxp.api.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
@Configuration
@EnableSwagger2WebMvc
public class Knife4jConfiguration {
@Value("${knife4j.enable:false}")
private boolean enable;
@Bean(value = "defaultApi2")
public Docket defaultApi2() {
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(new ApiInfoBuilder()
.title("UDI管理系统后台")
.description("UDI管理系统后台 - APIS")
.version("1.0")
.build())
.enable(enable)
.select()
//这里指定Controller扫描包路径
.apis(RequestHandlerSelectors.basePackage("com.glxp.api.controller"))
.paths(PathSelectors.any())
.build();
return docket;
}
}

@ -47,6 +47,8 @@ import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.DateUtil; import com.glxp.api.util.DateUtil;
import com.glxp.api.util.JsonUtils; import com.glxp.api.util.JsonUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
@ -65,6 +67,7 @@ import java.io.IOException;
import java.util.*; import java.util.*;
@RestController @RestController
@Api(tags = "同步下载相关")
public class SpsSyncDownloadController { public class SpsSyncDownloadController {
@Resource @Resource
@ -151,6 +154,7 @@ public class SpsSyncDownloadController {
// 下发基础数据 供给中继服务UDI管理系统下载 // 下发基础数据 供给中继服务UDI管理系统下载
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@GetMapping("sps/sync/data") @GetMapping("sps/sync/data")
@ApiOperation("拉取同步任务数据")
public BaseResponse data(BasicExportTypeEnum exportType) { public BaseResponse data(BasicExportTypeEnum exportType) {
BaseResponse<RelaySyncResponse> baseResponse = new BaseResponse<>(); BaseResponse<RelaySyncResponse> baseResponse = new BaseResponse<>();
BasicExportStatusEntity one = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) BasicExportStatusEntity one = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class)

Loading…
Cancel
Save