首页>代码>基于SpringBoot+Vue实现的职工管理系统>/源代码/StaffManagerApi/src/main/java/com/rabbiter/staff/config/SwaggerConfig.java
package com.rabbiter.staff.config;
/**
* Swagger 测试
*/
import com.google.common.base.Predicates;
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.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2//Swagger注解
public class SwaggerConfig {
public static void main(String[] args) {
}
@Bean
public Docket webApiConfig(){
return new Docket(DocumentationType.SWAGGER_2)
.groupName("webApi")
.apiInfo(webApiInfo())
.select()
.paths(Predicates.not(PathSelectors.regex("/admin/.*")))
.paths(Predicates.not(PathSelectors.regex("/error.*")))
.build();
}
private ApiInfo webApiInfo(){
return new ApiInfoBuilder()
.title("员工管理系统-api文档")
.description("员工管理系统")
.version("1.0")
.build();
}
}
最近下载更多
zolscy LV24
2024年11月24日
15953970869 LV6
2024年11月10日
123456nty LV37
2024年10月19日
Jerry_Handson LV9
2024年10月9日
lilong007 LV23
2024年8月28日
202106 LV6
2024年8月23日
mlml123 LV6
2024年8月20日
255921158 LV5
2024年7月19日
qq970040477 LV24
2024年6月25日
sweetlove LV20
2024年6月12日
最近浏览更多
北城不夏 LV8
昨天
dongandmin LV9
12月11日
yigu123 LV6
11月8日
rao11011 LV1
11月5日
筱洋1616 LV9
11月2日
Mhgfhjyrf LV3
2024年12月9日
WanLiuYun LV12
2024年11月11日
15953970869 LV6
2024年11月10日
林kkkkkk LV6
2024年10月31日
yangchengshuai LV16
2024年10月29日

