后台服务
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

124 行
2.5 KiB

  1. package com.iformall.config;
  2. import lombok.Data;
  3. import lombok.NoArgsConstructor;
  4. import org.springframework.boot.context.properties.ConfigurationProperties;
  5. import java.util.ArrayList;
  6. import java.util.List;
  7. import java.util.Map;
  8. @Data
  9. @ConfigurationProperties("swagger")
  10. public class SwaggerProperties {
  11. private Map<String, String> services;
  12. private String prePath;
  13. /**
  14. * 是否开启swagger
  15. */
  16. private Boolean enabled;
  17. /**
  18. * swagger会解析的包路径
  19. **/
  20. private String basePackage = "";
  21. /**
  22. * swagger会解析的url规则
  23. **/
  24. private List<String> basePath = new ArrayList<>();
  25. /**
  26. * 在basePath基础上需要排除的url规则
  27. **/
  28. private List<String> excludePath = new ArrayList<>();
  29. /**
  30. * 标题
  31. **/
  32. private String title = "";
  33. /**
  34. * 描述
  35. **/
  36. private String description = "";
  37. /**
  38. * 版本
  39. **/
  40. private String version = "";
  41. /**
  42. * 许可证
  43. **/
  44. private String license = "";
  45. /**
  46. * 许可证URL
  47. **/
  48. private String licenseUrl = "";
  49. /**
  50. * 服务条款URL
  51. **/
  52. private String termsOfServiceUrl = "";
  53. /**
  54. * host信息
  55. **/
  56. private String host = "";
  57. /**
  58. * 联系人信息
  59. */
  60. private Contact contact = new Contact();
  61. /**
  62. * 全局统一鉴权配置
  63. **/
  64. private Authorization authorization = new Authorization();
  65. @Data
  66. public static class Contact {
  67. /**
  68. * 联系人
  69. **/
  70. private String name = "";
  71. /**
  72. * 联系人url
  73. **/
  74. private String url = "";
  75. /**
  76. * 联系人email
  77. **/
  78. private String email = "";
  79. }
  80. @Data
  81. @NoArgsConstructor
  82. public static class Authorization {
  83. /**
  84. * 鉴权策略ID,需要和SecurityReferences ID保持一致
  85. */
  86. private String name = "";
  87. /**
  88. * 需要开启鉴权URL的正则
  89. */
  90. private String authRegex = "^.*$";
  91. /**
  92. * 鉴权作用域列表
  93. */
  94. private List<AuthorizationScope> authorizationScopeList = new ArrayList<>();
  95. private List<String> tokenUrlList = new ArrayList<>();
  96. }
  97. @Data
  98. @NoArgsConstructor
  99. public static class AuthorizationScope {
  100. /**
  101. * 作用域名称
  102. */
  103. private String scope = "";
  104. /**
  105. * 作用域描述
  106. */
  107. private String description = "";
  108. }
  109. }