tlias管理系统-配置文件-@ConfigurationProperties配置类对象(硬编码)功能实现

This commit is contained in:
2025-10-13 15:23:39 +08:00
parent 29f56e563c
commit 6b5b025cca
5 changed files with 107 additions and 69 deletions

View File

@@ -1,32 +1,29 @@
server:
port: 8080
#mybatis连接四要素
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/tlias1
username: root
password: 1234
servlet:
multipart:
#单个文件上传大小限制10兆
max-file-size: 10MB
#一次请求多个文件上传大小限制100兆
max-request-size: 100MB
#定义对象
user:
name: zhangsan
age: 18
password: 123456
mybatis:
configuration:
#输出mybatis的日志
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#驼峰自动映射
map-underscore-to-camel-case: true
#定义map集合
userMap:
name: zhangsan
age: 18
password: 123456
#定义数组/list/set
hobbys:
- 吃饭
- 睡觉
- 玩手机
#定义对象数组 User[] 定义User对象的list
users:
- name: lisi
age: 20
gender: 1
- name: wangwu
age: 21
gender: 2
- name: zhaoliu
age: 22
gender: 1
#阿里云OSS配置信息
aliyun:
oss:
endpoint: https://oss-cn-hangzhou.aliyuncs.com
bucketName: inmind-test1
region: cn-hangzhou