@@ -58,114 +58,115 @@ git push origin --tags
58
58
其它tag操作参考:[ tag操作指南] ( https://blog.csdn.net/Emily/article/details/78839295?ops_request_misc=%7B%22request%5Fid%22%3A%22158685673019724835840750%22%2C%22scm%22%3A%2220140713.130056874..%22%7D&request_id=158685673019724835840750&biz_id=0&utm_source=distribute.pc_search_result.none-task-blog-blog_SOOPENSEARCH-1 )
59
59
60
60
------
61
- ### 自研框架-emily(艾米莉)配置
62
- ``` java
63
- #设置开启用户请求日志拦截器模式,默认: true
64
- spring. emily. api- log. enable= true
65
- #设置开启日志debug模式,默认: false
66
- spring. emily. api- log. debug= false
67
- #是否开启抛出的异常拦截,默认:true
68
- spring. emily. exception. enable= true
69
- #是否开启json转换器配置,默认:true
70
- spring. emily. jackson2. converter. enable= true
71
-
72
- #设置开启返回结果包装,默认: true
73
- spring. emily. return - value. enable= true
74
- #设置https配置开关,默认false
75
- spring. emily. https. enable= false
76
- #RedisTemplate 组件开关,默认: false
77
- spring. emily. redis. enable= false
78
- #限流组件开关,默认: false
79
- spring. emily. rate- limit. enable= true
80
- #防止重复提交组件开关,默认: false
81
- spring. emily. idempotent. enable= false
82
-
83
- #RestTemplate 组件
84
- #Http RestTemplate 组件开关,默认true
85
- spring. emily. http- client. enable= true
86
- #Http RestTemplate 拦截器开关,记录请求响应日志,默认true
87
- spring. emily. http- client. enable- interceptor= true
88
- #http连接读取超时时间,默认5000 毫秒
89
- spring. emily. http- client. read- time- out= 5000
90
- #http连接连接超时时间,默认10000 毫秒
91
- spring. emily. http- client. connect- time- out= 10000
61
+ #### 数据库多数据源组件
92
62
93
- #RestTemplate 组件- Spring Cloud 客户端负载均衡
94
- #Http RestTemplate 组件开关,默认true
95
- spring. emily. cloud. http- client- loadbalancer. enable= true
96
- #Http RestTemplate 拦截器开关,记录请求响应日志,默认true
97
- spring. emily. cloud. http- client- loadbalancer. enable- interceptor= true
98
- #http连接读取超时时间,默认1000 毫秒
99
- spring. emily. cloud. http- client- loadbalancer. read- time- out= 1000
100
- #http连接连接超时时间,默认1000 毫秒
101
- spring. emily. cloud. http- client- loadbalancer. connect- time- out= 1000
102
-
103
- ##API 路由设置
104
- #是否开启所有接口的前缀prefix,默认前面添加api
105
- spring. emily. web. path. enable- all- prefix= true
106
- #自定义添加前缀,默认api
107
- spring. emily. web. path. prefix= api
108
- #区分大小写,默认false
109
- spring. emily. web. path. case - sensitive= false
110
- #是否缓存匹配规则,默认null 等于true
111
- spring. emily. web. path. cache- patterns= true
112
- #是否去除前后空格,默认false
113
- spring. emily. web. path. trim- tokens= false
114
- #设置URL 末尾是否支持斜杠,默认true ,如/ a/ b/ 有效,/ a/ b也有效
115
- spring. emily. web. path. use- trailing- slash- match= true
116
- #忽略URL 前缀控制器设置,默认空
117
- spring. emily. web. path. ignore- controller- url- prefix=
118
-
119
- ##跨域设置
120
- #开启跨域设置,默认false
121
- spring. emily. web. cors. enable= false
122
- #设置允许哪些源来访问,多个源用逗号分开
123
- spring. emily. web. cors. allowed- origins=
124
- #允许HTTP 请求方法
125
- spring. emily. web. cors. allowed- methods= GET ,POST
126
- #设置用户可以拿到的字段
127
- spring. emily. web. cors. allowed- headers=
128
- #设置浏览器是否应该发送凭据cookie
129
- spring. emily. web. cors. allow- credentials= true
130
- #设置响应HEAD ,默认无任何设置,不可以使用* 号
131
- spring. emily. web. cors. exposed- headers=
132
- #设置多长时间内不需要发送预检验请求,可以缓存该结果,默认1800 秒
133
- spring. emily. web. cors. max- age= 1800
63
+ - 扩展点提供DataSourceCustomizer接口,AOP会根据拦截器的优先级判定使用优先级最高的拦截器
64
+ - 属性配置示例
134
65
66
+ ``` properties
135
67
# 是否开启数据源组件, 默认:true
136
68
spring.emily.datasource.enabled =true
69
+ # 是否拦截超类或者接口中的方法,默认:true
70
+ spring.emily.datasource.check-inherited =true
137
71
# 默认数据源配置,默认:default
138
72
spring.emily.datasource.default-config =default
139
73
# 驱动名称
140
74
spring.emily.datasource.config.default.driver-class-name =oracle.jdbc.OracleDriver
141
75
# 配置url
142
- spring. emily. datasource. config. default . url= jdbc: oracle: thin: @1x . 1x . 8x . 1x : 1521 : xxx
76
+ spring.emily.datasource.config.default.url =jdbc:oracle:thin:@xx.xx.xx.xx :1521:qw
143
77
# 用户名
144
- spring. emily. datasource. config. default . username= xx
78
+ spring.emily.datasource.config.default.username =root
145
79
# 用户密码
146
- spring. emily. datasource. config. default . password= xx
80
+ spring.emily.datasource.config.default.password =123456
147
81
# 数据库连接池类型
148
82
spring.emily.datasource.config.default.db-type =com.alibaba.druid.pool.DruidDataSource
149
83
84
+ spring.emily.datasource.config.slave.driver-class-name =oracle.jdbc.OracleDriver
85
+ spring.emily.datasource.config.slave.url =jdbc:oracle:thin:@x.x.x.x:we
86
+ spring.emily.datasource.config.slave.username =root
87
+ spring.emily.datasource.config.slave.password =123
88
+ spring.emily.datasource.config.slave.db-type =com.alibaba.druid.pool.DruidDataSource
89
+ ```
90
+
91
+ #### Mybatis埋点组件
92
+
93
+ - 扩展点MybatisCustomizer,AOP根据拦截器的优先级判定使用优先级最高的拦截器
94
+ - 属性配置:
95
+
96
+ ``` properties
150
97
# 是否开启mybatis拦截组件, 默认:true
151
98
spring.emily.mybatis.enabled =true
152
- #是否还要检查超类或者接口,默认:false
153
- spring. emily. mybatis. check- inherited= false
99
+ # 是否拦截超类或者接口中的方法,默认:true
100
+ spring.emily.mybatis.check-class-inherited =true
101
+ ```
102
+
103
+
104
+
105
+ #### Redis多数据源组件
106
+
107
+ - 属性配置
108
+
109
+ ``` properties
110
+ # 是否开启Redis多数据源配置,默认:true
111
+ spring.emily.redis.enabled =true
112
+ # Redis监控是否开启,默认:false
113
+ spring.emily.redis.monitor-enabled =false
114
+ # Redis监控固定间隔时间,默认:30s
115
+ spring.emily.redis.monitor-fire-rate =10s
116
+ # 是否开启连接校验,默认:false
117
+ spring.emily.redis.validate-connection =false
118
+ # 是否开启共享本地物理连接,默认:true
119
+ spring.emily.redis.share-native-connection =true
120
+
121
+ spring.emily.redis.config.default.client-type =lettuce
122
+ spring.emily.redis.config.default.database =15
123
+ spring.emily.redis.config.default.password =test12345
124
+ spring.emily.redis.config.default.sentinel.master =xxx
125
+ spring.emily.redis.config.default.sentinel.nodes =x.x.x.x:26380,x.x.x.x:26381,xx.x.x.x:26382
126
+ # 读取超时时间
127
+ spring.emily.redis.config.default.timeout =3000
128
+ # 连接超时时间
129
+ spring.emily.redis.config.default.connect-timeout =PT3S
130
+ spring.emily.redis.config.default.lettuce.pool.enabled =true
131
+ spring.emily.redis.config.default.lettuce.pool.max-active =8
132
+ spring.emily.redis.config.default.lettuce.pool.max-idle =8
133
+ #
134
+ spring.emily.redis.config.default.lettuce.pool.min-idle =4
135
+ spring.emily.redis.config.default.lettuce.pool.max-wait =-1
136
+ # 每隔多少时间空闲线程驱逐器关闭多余的空闲连接,且保持最少空闲连接可用,同时min-idle要大于0
137
+ spring.emily.redis.config.default.lettuce.pool.time-between-eviction-runs =PT0.1S
138
+
139
+ spring.emily.redis.config.test.client-type =lettuce
140
+ spring.emily.redis.config.test.database =15
141
+ spring.emily.redis.config.test.password =xx
142
+ spring.emily.redis.config.test.sentinel.master =xx
143
+ spring.emily.redis.config.test.sentinel.nodes =x.x.x.x:26379,x.x.x.x:26379,x.x.x.x:26379
144
+ spring.emily.redis.config.test.timeout =300
145
+ spring.emily.redis.config.test.lettuce.pool.max-active =8
146
+ spring.emily.redis.config.test.lettuce.pool.max-idle =8
147
+ spring.emily.redis.config.test.lettuce.pool.min-idle =0
148
+ spring.emily.redis.config.test.lettuce.pool.max-wait =-1
149
+ ```
150
+
151
+ #### logback日志组件
152
+
153
+ - 属性配置
154
154
155
+ ``` properties
155
156
# 日志组件
156
- #启动日志访问组件,默认 false
157
+ # 启动日志访问组件,默认:true
157
158
spring.emily.logback.enabled =true
158
159
159
160
# 日志文件存放路径,默认是:./logs
160
- spring. emily. logback. appender. file - path= . / logs
161
+ spring.emily.logback.appender.path =./logs
161
162
# 如果是 true,日志被追加到文件结尾,如果是 false,清空现存文件,默认是true
162
163
spring.emily.logback.appender.append =true
163
164
# 如果是 true,日志会被安全的写入文件,即使其他的FileAppender也在向此文件做写入操作,效率低,默认是 false|Support multiple-JVM writing to the same log file
164
165
spring.emily.logback.appender.prudent =false
165
166
# 设置是否将输出流刷新,确保日志信息不丢失,默认:true
166
167
spring.emily.logback.appender.immediate-flush =true
167
168
# 是否报告内部状态信息,默认;false
168
- spring. emily. logback. appender. report- state= true
169
+ spring.emily.logback.appender.report-state =false
169
170
170
171
# 是否开启基于文件大小和时间的SizeAndTimeBasedRollingPolicy归档策略
171
172
# 默认是基于TimeBasedRollingPolicy的时间归档策略,默认false
@@ -179,7 +180,7 @@ spring.emily.logback.appender.rolling-policy.total-size-cap=5GB
179
180
# 设置重启服务后是否清除历史日志文件,默认:false
180
181
spring.emily.logback.appender.rolling-policy.clean-history-on-start =true
181
182
182
- #是否开启异步记录Appender ,默认 false
183
+ # 是否开启异步记录Appender,默认:false
183
184
spring.emily.logback.appender.async.enabled =false
184
185
# 队列的最大容量,默认为 256
185
186
spring.emily.logback.appender.async.queue-size =256
@@ -193,14 +194,16 @@ spring.emily.logback.appender.async.max-flush-time=1000
193
194
# 在队列满的时候 appender 会阻塞而不是丢弃信息。设置为 true,appender 不会阻塞你的应用而会将消息丢弃,默认为 false
194
195
spring.emily.logback.appender.async.never-block =false
195
196
196
- #日志级别,即该等级之上才会输出,ERROR > WARN > INFO > DEBUG > TRACE > ALL , 默认:DEBUG
197
+ # 日志级别,即该等级之上才会输出,ERROR > WARN > INFO > DEBUG > TRACE >ALL, 默认:INFO
197
198
spring.emily.logback.root.level =info
198
199
# 通用日志输出格式,默认:[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] [%-5level] [%-36.36logger{36}:%-4.4line] : %msg%n
199
200
spring.emily.logback.root.pattern =[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] [%-5level] [%-36.36logger{36}:%-4.4line] : %msg%n
200
- #基础日志文件路径
201
+ # 基础日志文件路径,默认:""
201
202
spring.emily.logback.root.file-path =base
203
+ # 是否将日志信息输出到控制台,默认:true
204
+ spring.emily.logback.root.console =true
202
205
203
- #日志级别,即该等级之上才会输出,ERROR > WARN > INFO > DEBUG > TRACE > ALL , 默认:DEBUG
206
+ # 日志级别,即该等级之上才会输出,ERROR > WARN > INFO > DEBUG > TRACE >ALL, 默认:INFO
204
207
spring.emily.logback.group.level =info
205
208
# 模块日志输出格式,默认:%msg%n
206
209
spring.emily.logback.group.pattern =[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] [%-5level] [%-36.36logger{36}:%-4.4line] : %msg%n
@@ -210,13 +213,81 @@ spring.emily.logback.group.console=true
210
213
# 日志级别,即该等级之上才会输出,ERROR > WARN > INFO > DEBUG > TRACE >ALL, 默认:DEBUG
211
214
spring.emily.logback.module.level =info
212
215
# 模块日志输出格式,默认:%msg%n
213
- spring. emily. logback. module. pattern= [ % d{yyyy - MM - dd HH : mm : ss . SSS }] [ % thread] [ %- 5level] [ %- 36 . 36logger{ 36 } : %- 4 . 4line] : % msg% n
216
+ spring.emily.logback.module.pattern =%msg%n
214
217
# 是否将模块日志输出到控制台,默认:false
215
218
spring.emily.logback.module.console =true
219
+ ```
220
+
221
+ #### RestTemplate请求组件
222
+
223
+ - 扩展点HttpClientCustomizer,AOP根据拦截器的优先级判定使用优先级最高者
224
+ - 属性配置
225
+
226
+ ``` properties
227
+ # Http RestTemplate组件开关,默认true
228
+ spring.emily.http-client.enabled =true
229
+ # Http RestTemplate拦截器开关,记录请求响应日志,默认true
230
+ spring.emily.http-client.interceptor =true
231
+ # http连接读取超时时间,默认5000毫秒
232
+ spring.emily.http-client.read-time-out =1000
233
+ # http连接连接超时时间,默认10000毫秒
234
+ spring.emily.http-client.connect-time-out =1000
235
+ ```
236
+
237
+ #### Feign组件
238
+
239
+ - 扩展点FeignLoggerCustomizer,AOP根据拦截器的优先级判定使用优先级最高者
240
+
241
+ - 属性配置
242
+
243
+ ``` properties
244
+ spring.emily.feign.logger.enabled =true
245
+ ```
246
+
247
+ #### API路由设置组件
248
+
249
+ ``` properties
250
+ # 是否开启所有接口的前缀prefix,默认前面添加api
251
+ spring.emily.web.path.enable-all-prefix =true
252
+ # 自定义添加前缀,默认api
253
+ spring.emily.web.path.prefix =api
254
+ # 区分大小写,默认false
255
+ spring.emily.web.path.case-sensitive =false
256
+ # 是否缓存匹配规则,默认null等于true
257
+ spring.emily.web.path.cache-patterns =true
258
+ # 是否去除前后空格,默认false
259
+ spring.emily.web.path.trim-tokens =false
260
+ # 设置URL末尾是否支持斜杠,默认true,如/a/b/有效,/a/b也有效
261
+ spring.emily.web.path.use-trailing-slash-match =true
262
+ # 忽略URL前缀控制器设置,默认空
263
+ spring.emily.web.path.exclude =
264
+ ```
265
+
266
+ #### API跨域组件
267
+
268
+ ``` properties
269
+ # 开启跨域设置,默认false
270
+ spring.emily.web.cors.enable =false
271
+ # 设置允许哪些源来访问,多个源用逗号分开
272
+ spring.emily.web.cors.allowed-origins =
273
+ # 允许HTTP请求方法
274
+ spring.emily.web.cors.allowed-methods =GET,POST
275
+ # 设置用户可以拿到的字段
276
+ spring.emily.web.cors.allowed-headers =
277
+ # 设置浏览器是否应该发送凭据cookie
278
+ spring.emily.web.cors.allow-credentials =true
279
+ # 设置响应HEAD,默认无任何设置,不可以使用*号
280
+ spring.emily.web.cors.exposed-headers =
281
+ # 设置多长时间内不需要发送预检验请求,可以缓存该结果,默认1800秒
282
+ spring.emily.web.cors.max-age =1800
283
+ ```
284
+
285
+ ```
286
+
216
287
217
288
```
218
289
219
- ##### consul服务查询、删除接口
290
+ consul服务查询、删除接口
220
291
221
292
- 查询服务接口Get
222
293
0 commit comments