All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.didiglobal.logi.security.config.SwaggerConfig Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.didiglobal.logi.security.config;

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.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("logiSecuritySwaggerConfig")
@EnableSwagger2
public class SwaggerConfig {

    @Bean("logiSecurityCreateRestApi")
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("logi-security")
                .apiInfo(apiInfo())
                .select()
                // swagger要扫描的包路径
                .apis(RequestHandlerSelectors.basePackage("com.didiglobal.logi.security.controller"))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("logi-security在线文档")
                .description(("用户、项目、角色、部门、界面权限、资源权限、操作日志、消息通知"))
                // 作者信息
                .contact(new Contact("home","",""))
                .version("v1.0")
                .build();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy