zrj
2024-07-18 cae70a8906526c3f9cba6408b1809399e5143a43
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# 在使用Spring默认数据源Hikari的情况下配置以下配置项
spring:
  datasource:
    hikari:
      # 自动提交从池中返回的连接
      auto-commit: true
      # 连接池中维护的最小空闲连接数
      minimum-idle: 10
      # 连接池中允许的最大连接数。缺省值:10;推荐的公式:((core_count * 2) + effective_spindle_count)
      maximum-pool-size: 60
      # 空闲连接超时时间,默认值600000(10分钟),大于等于max-lifetime且max-lifetime>0,会被重置为0;不等于0且小于10秒,会被重置为10秒。
      # 只有空闲连接数大于最大连接数且空闲时间超过该值,才会被释放
      idle-timeout: 30000
      # 连接最大存活时间.不等于0且小于30秒,会被重置为默认值30分钟.设置应该比mysql设置的超时时间短
      max-lifetime: 1800000
      # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 缺省:30秒
      connection-timeout: 30000
      # 连接测试查询
      connection-test-query: select 1
      #connection-test-query: select 1 from dual
  freemarker:
    # 模板后缀名
    suffix: .ftl
    # 文档类型
    content-type: text/html
    # 页面编码
    charset: UTF-8
    # 页面缓存
    cache: false
    # 模板路径
    template-loader-path: classpath:/templates/
  web:
    # 资源路径
    resources:
      static-locations: classpath:/static/
  cloud:
    sentinel:
      eager: true
  devtools:
    restart:
      log-condition-evaluation-delta: false
    livereload:
      port: 23333
  main:
    allow-circular-references: true
 
#mybatis-plus配置
mybatis-plus:
  mapper-locations: classpath:cn/**/**/mapper/*Mapper.xml
  #实体扫描,多个package用逗号或者分号分隔
  typeALiasesPackage:  cn.**.**.entity
#服务器配置
server:
  undertow:
    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
    io-threads: 16
    # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
    worker-threads: 400
    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
    buffer-size: 1024
    # 是否分配的直接内存
    direct-buffers: true
 
#feign配置
feign:
  hystrix:
    enabled: true
  okhttp:
    enabled: true
  httpclient:
    enabled: false
 
#hystrix配置
hystrix:
  threadpool:
    default:
      coreSize: 300
      maxQueueSize: 1000
      queueSizeRejectionThreshold: 800
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 5000
 
#ribbon配置
ribbon:
  #对当前实例的重试次数
  MaxAutoRetries: 1
  #切换实例的重试次数
  MaxAutoRetriesNextServer: 2
  #请求处理的超时时间
  ReadTimeout: 60000
  #请求连接的超时时间
  ConnectTimeout: 60000
  #对所有操作请求都进行重试
  OkToRetryOnAllOperations: true
 
#对外暴露端口
management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: always
 
#blade配置
blade:
  #token配置
  token:
    #是否有状态
    state: false
  #接口配置
  api:
    #报文加密配置
    crypto:
      #启用报文加密配置
      enabled: false
      #使用AesUtil.genAesKey()生成
      aes-key: O2BEeIv399qHQNhD6aGW8R8DEj4bqHXm
      #使用DesUtil.genDesKey()生成
      des-key: jMVCBsFGDQr1USHo
  #jackson配置
  jackson:
    #null自动转空值
    null-to-empty: true
    #大数字自动转字符串
    big-num-to-string: true
    #支持text文本请求,与报文加密同时开启
    support-text-plain: false
  #xss配置
  xss:
    enabled: true
    skip-url:
      - /weixin
      - /notice/submit
  #安全框架配置
  secure:
    #接口放行
    skip-url:
      - /test/**
    #授权认证配置
    auth:
      - method: ALL
        pattern: /weixin/**
        expression: "hasAuth()"
      - method: POST
        pattern: /dashboard/upload
        expression: "hasTimeAuth(9, 17)"
      - method: POST
        pattern: /dashboard/submit
        expression: "hasAnyRole('administrator', 'admin', 'user')"
    #多终端认证配置
    client:
      - client-id: sword
        path-patterns:
          - /sword/**
      - client-id: saber
        path-patterns:
          - /saber/**
  #多租户配置
  tenant:
    #多租户增强
    enhance: true
    #多租户授权保护
    license: false
    #动态数据源功能
    dynamic-datasource: false
    #动态数据源全局扫描
    dynamic-global: false
    #多租户字段名
    column: tenant_id
    #排除多租户逻辑
    exclude-tables:
      - blade_user
 
#swagger文档
swagger:
  base-packages:
    - org.springblade
    - org.springframework.security.oauth2.provider.endpoint
 
#第三方登陆
social:
  oauth:
    GITHUB:
      client-id: 233************
      client-secret: 233************************************
      redirect-uri: ${social.domain}/oauth/redirect/github
    GITEE:
      client-id: 233************
      client-secret: 233************************************
      redirect-uri: ${social.domain}/oauth/redirect/gitee
    WECHAT_OPEN:
      client-id: 233************
      client-secret: 233************************************
      redirect-uri: ${social.domain}/oauth/redirect/wechat
    QQ:
      client-id: 233************
      client-secret: 233************************************
      redirect-uri: ${social.domain}/oauth/redirect/qq
    DINGTALK:
      client-id: 233************
      client-secret: 233************************************
      redirect-uri: ${social.domain}/oauth/redirect/dingtalk