文章

框架配置参数说明

框架配置参数说明

1. base-framework模块默认配置参数:

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
#开发框架会使用单体还是微服务架构中:singleton-单体架构,microservice-微服务架构
base.framework.architecture=singleton
#后端API的URL前缀
server.servlet.context-path=/services
#jackson序列化时只包含非null值的属性
spring.jackson.default-property-inclusion=non_null
#字典转换后的name和value的显示格式:flat-平铺显示,wrap-嵌套显示
base.framework.itemset.format=wrap
#json和实体对象中的Date类型字段按以下格式进行转换
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8
#----------------Spring Session配置---------------------------------------
#Spring Session存储方式
spring.session.store-type=redis
#设置Session过期时间
spring.session.timeout=1800
#如果spring.session.timeout未设置,以下参数就会生效
#server.servlet.session.timeout=1800
#----------------MyBatis-Plus配置--------------------------------------
#配置mapper.xml文件的路径位置
mybatis-plus.mapper-locations=classpath*:/mapper/**/*.xml
#将数据库字段(如create_user)在Java中使用驼峰命名法进行转换(如createUser)
mybatis-plus.configuration.map-underscore-to-camel-case=true
#显示mybatis-plus执行sql的详细信息
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#全局ID生成策略(UUID)
mybatis-plus.global-config.db-config.id-type=assign_uuid
#查询中过滤掉空值的查询条件
mybatis-plus.global-config.db-config.select-strategy=not_empty
#统一替换表字段名称,主要用于处理表字段名为数据库关键字的问题
#mybatis-plus.global-config.db-config.column-format=`%s`
#----------------数据库全局配置--------------------------------------
##mybatis-plus.configuration.database-id=dm
##需要替换关键字的字段名列表
##base.framework.db.field.keywords=RANK,TYPE
#表名前需要添加的schema前缀
#base.framework.db.schema.name=BACKEND_FRAMEWORK_DEV
#需要替换schema前缀的表名列表
#base.framework.db.schema.tables=SECURITY_API,SECURITY_APP,SECURITY_AUTHORIZATION,SECURITY_LOG,SECURITY_ORGANIZATION,SECURITY_ORGANIZATION_USER_REL,SECURITY_ROLE,SECURITY_UI,SECURITY_USER,SECURITY_USER_ROLE_REL,UTILITY_ATTACHMENT,UTILITY_DICSET,UTILITY_IMPORT_TASK,UTILITY_MESSAGE,UTILITY_MESSAGE_TEMPLATE,SECURITY_RESOURCE_CATEGORY,UTILITY_SYSTEM_CONFIG
#----------------Redis配置------------------------------------------------
#redis连接超时时间 单位ms(毫秒)
spring.redis.timeout=5000
#连接池最大连接数(使用负值表示没有限制)
spring.redis.lettuce.pool.max-active=8
#连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.lettuce.pool.max-wait=-1
#连接池中的最大空闲连接
spring.redis.lettuce.pool.max-idle=8
#连接池中的最小空闲连接
spring.redis.lettuce.pool.min-idle=0
#------------------缓存配置------------------------------------------------
#设置缓存组件类型
spring.cache.type=redis
#设置缓存过期时间8小时,默认单位是毫秒
spring.cache.redis.time-to-live=8H
#缓存key的默认前缀名
#spring.cache.redis.key-prefix=CACHE_
#缓存key是否使用前缀
spring.cache.redis.use-key-prefix=true
#是否缓存空值,防止缓存穿透
spring.cache.redis.cache-null-values=true
#-------------------springdoc-openapi配置---------------------------------
#springdoc资料文档地址:https://springdoc.org/
#启用springdoc-api-docs
springdoc.api-docs.enabled=true
#swagger-ui上显示用户登录接口信息。(使用无效?)
#springdoc.show-login-endpoint=true
#前端页面访问地址
#springdoc.swagger-ui.path=/api-ui
#后端API json地址
#springdoc.api-docs.path=/v3/api-docs
#配置要扫描API的包名,逗号分隔
#springdoc.packages-to-scan=com.framework.backend.utility
#配置不要扫描API的包名,逗号分隔
#springdoc.packages-to-exclude=com.framework.backend.security
#配置要扫描API的URL规则,逗号分隔
#springdoc.paths-to-match=/utility/attachment/**,/utility/dicset/**
#Controler类按字母顺序排列
springdoc.swagger-ui.tagsSorter=alpha
#Controler类中的方法按字母顺序排列
springdoc.swagger-ui.operationsSorter=alpha


2. base-security模块默认配置参数:

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
#后端接口跨域设置
base.security.allowed.origins=
#-------------------安全相关参数配置-----------------------------------
#是否允许用户多次登录,默认为true,当为false时,用户后面一次登录会将前面一次登录“挤下线”
base.security.login.multiple.enabled=true
#需要开放权限的urls,多个以逗号分隔
base.security.permit.custom.urls=
#用户初始密码
base.security.default.pwd=User@6375
#运维管理员名称
base.security.operator=operator
#是否启用登录验证码功能
base.security.login.captcha.enabled=false
#是否启用登录限流功能
base.security.login.rateLimit.enabled=false
#登录限流:令牌桶容量大小
base.security.login.rateLimit.bucket.bandwidth.capacity=2
#登录限流:令牌桶令牌补充时间间隔(秒)
base.security.login.rateLimit.bucket.bandwidth.duration.seconds=20
#登录限流:令牌桶缓存失效时间(秒)
base.security.login.rateLimit.bucket.expiration.seconds=60
#是否启用登录密码过期检查功能
base.security.login.password.expired.enabled=false
#设置用户登录密码过期天数
base.security.login.password.expired.days=90
#是否启用password格式验证过滤器
base.security.password.check.enabled=false
#验证password格式的URL列表
base.security.password.check.url=/*
#用户和组织数据同步一次批量处理最大值
base.security.sync.batch.max-count=500
#系统代号配置
base.security.system.code=adminApp
#-------------------单点登录参数配置-----------------------------------
#是否使用MyBaseSecurityConfig,当使用自定义SecurityConfig时需要设置为false
base.security.config.enable=true
#框架登录验证方式:
#basic:普通账号密码登录方式;sso-cas:单点登录CAS集成方式;sso-oauth2:单点登录oauth2集成方式
base.security.config.mode=basic
#-------------------sso-cas参数配置-----------------------------------
#401无权限访问后返回的登录页面地址,现为CAS登录页面URL
base.security.login.url=http://xxx:xxx/xxx/login?service=http://xxx:xxx/xxx
#CAS登录成功后跳转到的前端页面URL,service参数值
base.security.sso.cas.login.success.url=http://xxx:xxx/xxx
#CAS API地址,后端用来验证CAS的ST有效性
base.security.sso.cas.api.url=http://xxx:xxx/xxx
#CAS ticket验证成功后返回的用户标识属性名称,此属性值对应用户的account值,单点登录成功后此用户会自动登录应用系统
base.security.sso.cas.user.identifier=xxx
#CAS ST保存时间,用于退出时根据ST注销session使用
base.security.sso.cas.st.timeout=24
#-------------------sso-oauth2参数配置-----------------------------------
#oauth2认证服务的URL
base.security.sso.oauth2.authorization.url=http://xxx:xxx
#oauth2认证服务的注册client的id
base.security.sso.oauth2.authorization.client_id=xxx
#oauth2认证服务的注册client的密码
base.security.sso.oauth2.authorization.client_secret=xxx
#oauth2认证服务的认证方式
base.security.sso.oauth2.authorization.grant_type=xxx
#oauth2认证服务登录成功后跳转到的前端页面URL
base.security.sso.oauth2.authorization.redirect_uri=http://xxx:xxx/xxx
#oauth2资源服务获取登录用户信息的URL
base.security.sso.oauth2.resource.userinfoUrl=http://xxx:xxx/services/resource/user/getUserInfo
#-------------------框架操作日志配置---------------------------------------
base.security.log.template.organization.create=新增组织
base.security.log.template.organization.update=编辑组织
base.security.log.template.organization.delete=删除组织
base.security.log.template.user.create=新增用户
base.security.log.template.user.update=编辑用户
base.security.log.template.user.updatePassword=修改密码
base.security.log.template.user.resetPassword=重置密码
base.security.log.template.user.createUserRoleRel=用户授权角色
base.security.log.template.user.deleteUserRoleRel=用户取消角色授权
base.security.log.template.role.createUserRoleRel=角色关联用户
base.security.log.template.role.deleteUserRoleRel=角色取消关联用户
base.security.log.template.authorization.authorize=角色修改菜单权限
#-------------------框架用户组织同步功能对接配置-----------------------------
#组织用户同步请求组织的url
base.security.sync.impl.request.orgUrl=
#组织用户同步请求用户的url
base.security.sync.impl.request.userUrl=
#定时通过url获取组织用户数据cron配置(-表示不开启同步。每5分钟执行一次表达式:0 0/5 * ? * *)
base.security.sync.impl.request.cron=-
#定时同步组织用户数据cron配置(-表示不开启同步。每5分钟执行一次表达式:0 2/5 * ? * *)
base.security.sync.impl.process.cron=-


3. base-utility模块默认配置参数:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#文件上传最大支持文件大小
spring.servlet.multipart.max-file-size=200MB
#文件上传最大支持请求大小
spring.servlet.multipart.max-request-size=200MB
#文件上传方式:LocalFileOperator(本地存放方式),SeaweedFileOperator(Seaweed存放方式)
base.utility.file.operator=LocalFileOperator
#文件上传本地存放目录
base.utility.file.dir=c:/upload
#------------------LocalFileOperator相关配置参数-----------------------------------------
#本地文件预览地址host
base.utility.attachment.preview.host=xxx://xxx:xxx
#本地文件预览地址path
base.utility.attachment.preview.url=/api/open/preview
#------------------SeaweedFileOperator相关配置参数-----------------------------------------
#seaweedfs master的url
base.utility.file.seaweed.master.url=http://xxx:xxx
#seaweedfs volume的url
base.utility.file.seaweed.volume.ip=http://xxx:xxx
#seaweedfs volume的代理url,当跨网络需要配置文件服务代理,预览文件时使用
base.utility.file.seaweed.volume.ip.proxy=${base.utility.file.seaweed.volume.ip}
#------------------密评相关配置参数--------------------------------------------------------
base.utility.crypto.enable=false
本文由作者按照 CC BY 4.0 进行授权