SwaggerConfig.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //package com.backendsys.config.Swagger;
  2. //
  3. //
  4. //import io.swagger.v3.oas.models.OpenAPI;
  5. //import io.swagger.v3.oas.models.info.Info;
  6. //import org.springframework.context.aspect.Bean;
  7. //import org.springframework.context.aspect.Configuration;
  8. //
  9. //// knife4j 示例配置 及 语法
  10. //// https://gitee.com/xiaoym/swagger-bootstrap-ui-demo/tree/master/knife4j-spring-boot3-demo
  11. //
  12. //@Configuration
  13. //public class SwaggerConfig {
  14. //
  15. //// @Bean
  16. //// public GlobalOpenApiCustomizer globalOpenApiCustomizer() {
  17. //// return openApi -> {
  18. //////// if (openApi.getTags()!=null){
  19. //////// openApi.getTags().forEach(tag -> {
  20. //////// Map<String,Object> map=new HashMap<>();
  21. //////// map.put("x-order", RandomUtil.randomInt(0,100));
  22. //////// tag.setExtensions(map);
  23. //////// });
  24. //////// }
  25. //////// if(openApi.getPaths()!=null){
  26. //////// openApi.addExtension("x-test123","333");
  27. //////// openApi.getPaths().addExtension("x-abb",RandomUtil.randomInt(1,100));
  28. //////// }
  29. //// };
  30. //// }
  31. //
  32. // private static final String SECURITY_SCHEME_NAME = "BearerAuth";
  33. //
  34. // @Bean
  35. // public OpenAPI openAPI() {
  36. // return new OpenAPI().info(
  37. // new Info().title("用户管理系统API")
  38. // .version("1.0")
  39. //// .description( "Knife4j集成springdoc-openapi示例")
  40. //// .termsOfService("http://doc.xiaominfo1.com")
  41. //// .license(
  42. //// new License().name("Apache 2.0")
  43. //// .url("http://doc.xiaominfo2.com")
  44. //// )
  45. // );
  46. // }
  47. //
  48. //
  49. // /**
  50. // * 分组
  51. // */
  52. ////
  53. //// @Bean
  54. //// public GroupedOpenApi ApiAuth() {
  55. //// return GroupedOpenApi.builder()
  56. //// .group("登录管理")
  57. //// .pathsToMatch("/api/auth/**")
  58. //// .build();
  59. //// }
  60. ////
  61. //// @Bean
  62. //// public GroupedOpenApi ApiUser() {
  63. //// return GroupedOpenApi.builder()
  64. //// .group("用户管理")
  65. //// .pathsToMatch("/api/user/**")
  66. //// .build();
  67. //// }
  68. //
  69. //}