|
@@ -55,58 +55,8 @@ public class SwaggerConfig implements WebMvcConfigurer {
|
|
|
.build();
|
|
.build();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Bean
|
|
|
|
|
- @Profile("dev")
|
|
|
|
|
- public Docket system(){
|
|
|
|
|
- return new Docket(DocumentationType.SWAGGER_2)
|
|
|
|
|
- .select()
|
|
|
|
|
- .apis(RequestHandlerSelectors.basePackage("com.nb.system.controller"))
|
|
|
|
|
- .paths(PathSelectors.any())
|
|
|
|
|
- .build()
|
|
|
|
|
- .groupName("系统模块")
|
|
|
|
|
- .apiInfo(apiInfo())
|
|
|
|
|
- .securitySchemes(security())
|
|
|
|
|
- .securityContexts(securityContexts())
|
|
|
|
|
- .enable(true);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Bean
|
|
|
|
|
- public Docket bus(){
|
|
|
|
|
- return new Docket(DocumentationType.SWAGGER_2)
|
|
|
|
|
- .select()
|
|
|
|
|
- .apis(RequestHandlerSelectors.basePackage("com.nb.bus.controller"))
|
|
|
|
|
- .paths(PathSelectors.any())
|
|
|
|
|
- .build()
|
|
|
|
|
- .groupName("业务模块")
|
|
|
|
|
- .apiInfo(apiInfo())
|
|
|
|
|
- .securitySchemes(security())
|
|
|
|
|
- .securityContexts(securityContexts())
|
|
|
|
|
- .enable(true);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- @Bean
|
|
|
|
|
- public Docket admin(){
|
|
|
|
|
- ParameterBuilder ticketPar = new ParameterBuilder();
|
|
|
|
|
- List<Parameter> pars = new ArrayList<Parameter>();
|
|
|
|
|
- ticketPar.name("tenantId").description("租户id")
|
|
|
|
|
- .modelRef(new ModelRef("string")).parameterType("query")
|
|
|
|
|
- .required(true).build();
|
|
|
|
|
- pars.add(ticketPar.build());
|
|
|
|
|
-
|
|
|
|
|
- return new Docket(DocumentationType.SWAGGER_2)
|
|
|
|
|
- .select()
|
|
|
|
|
- .apis(RequestHandlerSelectors.basePackage("com.nb.auth.controller"))
|
|
|
|
|
- .paths(PathSelectors.any())
|
|
|
|
|
- .build()
|
|
|
|
|
- .groupName("授权模块")
|
|
|
|
|
- .apiInfo(apiInfo())
|
|
|
|
|
- .globalOperationParameters(pars)
|
|
|
|
|
- .securitySchemes(security())
|
|
|
|
|
- .securityContexts(securityContexts())
|
|
|
|
|
- .enable(true);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public List<SecurityScheme> security() {
|
|
public List<SecurityScheme> security() {
|
|
|
return Arrays.asList(new ApiKey("BASE_TOKEN", "Authorization", In.HEADER.toValue()),
|
|
return Arrays.asList(new ApiKey("BASE_TOKEN", "Authorization", In.HEADER.toValue()),
|
|
|
new ApiKey("租户id", "Tenant-Id", In.HEADER.toValue()));
|
|
new ApiKey("租户id", "Tenant-Id", In.HEADER.toValue()));
|