首页>代码>基于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日
最近浏览更多
Mhgfhjyrf  LV3 2024年12月9日
WanLiuYun  LV12 2024年11月11日
15953970869  LV6 2024年11月10日
林kkkkkk  LV6 2024年10月31日
yangchengshuai  LV15 2024年10月29日
withyouatdusk  LV2 2024年10月22日
Tomcat80  LV5 2024年10月22日
123456nty  LV37 2024年10月19日
黄志琴  LV1 2024年10月19日
angaochong  LV5 2024年10月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友