swagger接口文档
This commit is contained in:
parent
0d713dacd4
commit
07906093d3
@ -88,6 +88,17 @@
|
||||
<artifactId>base-trace</artifactId>
|
||||
<version>${frog.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 公共模块-->
|
||||
<dependency>
|
||||
<groupId>com.agri</groupId>
|
||||
<artifactId>base-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -38,7 +38,6 @@ public class SwaggerConfig
|
||||
@Value("${swagger.enabled}")
|
||||
private boolean enabled;
|
||||
|
||||
/** 设置请求的统一前缀 */
|
||||
@Value("${swagger.pathMapping}")
|
||||
private String pathMapping;
|
||||
|
||||
@ -58,7 +57,7 @@ public class SwaggerConfig
|
||||
// 扫描所有有注解的api,用这种方式更灵活
|
||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// 扫描指定包中的swagger注解
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.agri.project.tool.swagger"))
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.agri.web"))
|
||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
@ -113,9 +112,9 @@ public class SwaggerConfig
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title("标题:frog接口文档")
|
||||
.title("标题:总后台接口文档")
|
||||
// 描述
|
||||
.description("描述:青蛙农业")
|
||||
.description("描述:智慧农业")
|
||||
// 作者信息
|
||||
.contact(new Contact(ruoyiConfig.getName(), null, null))
|
||||
// 版本
|
||||
|
@ -21,7 +21,7 @@ server:
|
||||
port: 18080
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
context-path: /admin
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
|
@ -2,3 +2,14 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
knife4j:
|
||||
enable: true
|
||||
# 配置认证功能
|
||||
basic:
|
||||
# 是否开启认证
|
||||
enable: true
|
||||
# 用户名
|
||||
username: admin
|
||||
# 密码
|
||||
password: admin123
|
||||
|
@ -125,6 +125,18 @@
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger3依赖 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -13,10 +13,10 @@ import org.springframework.stereotype.Component;
|
||||
public class RuoYiConfig
|
||||
{
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
private static String name;
|
||||
|
||||
/** 版本 */
|
||||
private String version;
|
||||
private static String version;
|
||||
|
||||
/** 版权年份 */
|
||||
private String copyrightYear;
|
||||
@ -33,7 +33,7 @@ public class RuoYiConfig
|
||||
/** 验证码类型 */
|
||||
private static String captchaType;
|
||||
|
||||
public String getName()
|
||||
public static String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
@ -43,7 +43,7 @@ public class RuoYiConfig
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
public static String getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user