forked from kidgrow-microservices-platform

zhaoxiaohao
2021-04-26 9adebb75e04e8b0b369ebd318495cb683aa385b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package com.kidgrow.swagger2;
 
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
 
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
 
/**
 * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
 *
 * @Description: 配置属性<br>
 * @Project: <br>
 * @CreateDate: Created in 2020/2/4 16:05 <br>
 * @Author: <a href="4345453@kidgrow.com">liuke</a>
 */
@Data
@ConfigurationProperties("kidgrow.swagger")
public class SwaggerProperties {
    /**是否开启swagger**/
    private Boolean enabled;
    /**标题**/
    private String title = "";
    /**描述**/
    private String description = "";
    /**版本**/
    private String version = "";
    /**许可证**/
    private String license = "";
    /**许可证URL**/
    private String licenseUrl = "";
    /**服务条款URL**/
    private String termsOfServiceUrl = "";
 
    private Contact contact = new Contact();
 
    /**swagger会解析的包路径**/
    private String basePackage = "";
 
    /**swagger会解析的url规则**/
    private List<String> basePath = new ArrayList<>();
    /**在basePath基础上需要排除的url规则**/
    private List<String> excludePath = new ArrayList<>();
 
    /**分组文档**/
    private Map<String, DocketInfo> docket = new LinkedHashMap<>();
 
    /**host信息**/
    private String host = "";
 
    /**全局参数配置**/
    private List<GlobalOperationParameter> globalOperationParameters;
 
    @Setter
    @Getter
    public static class GlobalOperationParameter{
        /**参数名**/
        private String name;
 
        /**描述信息**/
        private String description;
 
        /**指定参数类型**/
        private String modelRef;
 
        /**参数放在哪个地方:header,query,path,body.form**/
        private String parameterType;
 
        /**参数是否必须传**/
        private String required;
    }
 
    @Data
    public static class DocketInfo {
        /**标题**/
        private String title = "";
        /**描述**/
        private String description = "";
        /**版本**/
        private String version = "";
        /**许可证**/
        private String license = "";
        /**许可证URL**/
        private String licenseUrl = "";
        /**服务条款URL**/
        private String termsOfServiceUrl = "";
 
        private Contact contact = new Contact();
 
        /**swagger会解析的包路径**/
        private String basePackage = "";
 
        /**swagger会解析的url规则**/
        private List<String> basePath = new ArrayList<>();
        /**在basePath基础上需要排除的url规则**/
        private List<String> excludePath = new ArrayList<>();
 
        private List<GlobalOperationParameter> globalOperationParameters;
    }
 
    @Data
    public static class Contact {
        /**联系人**/
        private String name = "";
        /**联系人url**/
        private String url = "";
        /**联系人email**/
        private String email = "";
    }
}