SwaggerConfig.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. //package com.yihu.jw.config;
  2. //
  3. //import org.springframework.context.annotation.Bean;
  4. //import org.springframework.context.annotation.Configuration;
  5. //import org.springframework.web.context.request.async.DeferredResult;
  6. //import springfox.documentation.builders.PathSelectors;
  7. //import springfox.documentation.service.ApiInfo;
  8. //import springfox.documentation.spi.DocumentationType;
  9. //import springfox.documentation.spring.web.plugins.Docket;
  10. //import springfox.documentation.swagger2.annotations.EnableSwagger2;
  11. //
  12. //import static com.google.common.base.Predicates.or;
  13. //import static springfox.documentation.builders.PathSelectors.regex;
  14. //
  15. //
  16. //@EnableSwagger2
  17. //@Configuration
  18. //public class SwaggerConfig {
  19. // private static final String PUBLIC_API = "Default";
  20. // private static final String Doctor_API = "doctor";
  21. // private static final String Patient_API = "patient";
  22. // private static final String Other_API = "other";
  23. //
  24. // @Bean
  25. // public Docket publicAPI() {
  26. // return new Docket(DocumentationType.SWAGGER_2)
  27. // .groupName(Doctor_API)
  28. // .genericModelSubstitutes(DeferredResult.class)
  29. // .useDefaultResponseMessages(false)
  30. // .forCodeGeneration(true)
  31. // .pathMapping("/")
  32. // .select()
  33. // .paths(PathSelectors.regex("/doctor/.*"))
  34. // .build()
  35. // .apiInfo(publicApiInfo());
  36. // }
  37. //
  38. // private ApiInfo publicApiInfo() {
  39. // ApiInfo apiInfo = new ApiInfo("三师平台API",
  40. // "向PC端,微信、App等应用提供功能与数据接口。",
  41. // "1.0",
  42. // "No terms of service",
  43. // "admin@jkzl.com",
  44. // "The Apache License, Version 2.0",
  45. // "http://www.apache.org/licenses/LICENSE-2.0.html"
  46. // );
  47. //
  48. // return apiInfo;
  49. // }
  50. //
  51. // @Bean
  52. // public Docket patientAPI() {
  53. // return new Docket(DocumentationType.SWAGGER_2)
  54. // .groupName(Patient_API)
  55. // .genericModelSubstitutes(DeferredResult.class)
  56. // .useDefaultResponseMessages(false)
  57. // .forCodeGeneration(true)
  58. // .pathMapping("/")
  59. // .select()
  60. // .paths(PathSelectors.regex("/patient/.*"))
  61. // .build()
  62. // .apiInfo(patientApiInfo());
  63. // }
  64. //
  65. // private ApiInfo patientApiInfo() {
  66. // ApiInfo apiInfo = new ApiInfo("三师平台API",
  67. // "向PC端,微信、App等应用提供功能与数据接口。",
  68. // "1.0",
  69. // "No terms of service",
  70. // "admin@jkzl.com",
  71. // "The Apache License, Version 2.0",
  72. // "http://www.apache.org/licenses/LICENSE-2.0.html"
  73. // );
  74. //
  75. // return apiInfo;
  76. // }
  77. //
  78. // @Bean
  79. // public Docket otherAPI() {
  80. // return new Docket(DocumentationType.SWAGGER_2)
  81. // .groupName(Other_API)
  82. // .genericModelSubstitutes(DeferredResult.class)
  83. // .useDefaultResponseMessages(false)
  84. // .forCodeGeneration(true)
  85. // .pathMapping("/")
  86. // .select()
  87. // .paths(or(
  88. // regex("/third/.*"),
  89. // regex("/statistics/.*"),
  90. // regex("/statistics/province/.*"),
  91. // regex("/job/.*"),
  92. // regex("/family_contract/.*"),
  93. // regex("/hosptail/.*"),
  94. // regex("/manage_util/.*"),
  95. // regex("/common/.*"),
  96. // regex("/hospitals/.*"),
  97. // regex("/upload/.*"),
  98. // regex("/weixin/.*"),
  99. // regex("/wx/.*"),
  100. // regex("/area/.*"),
  101. // regex("/login/.*"),
  102. // regex("/qrcode/.*"),
  103. // regex("/onepay/.*"),
  104. // regex("/wlyy_service/.*"),
  105. // regex("/zydict/.*")
  106. // ))
  107. // .build()
  108. // .apiInfo(otherApiInfo());
  109. // }
  110. //
  111. // private ApiInfo otherApiInfo() {
  112. // ApiInfo apiInfo = new ApiInfo("三师平台API",
  113. // "向PC端,微信、App等应用提供功能与数据接口。",
  114. // "1.0",
  115. // "No terms of service",
  116. // "admin@jkzl.com",
  117. // "The Apache License, Version 2.0",
  118. // "http://www.apache.org/licenses/LICENSE-2.0.html"
  119. // );
  120. //
  121. // return apiInfo;
  122. // }
  123. //}