springboot yml注入bean
2022-10-1856
YML文件:
yml属性注入:
student:
stu_name: 沈刚伟
stu_age: 123
stu_email: 123456@qq.com
user_id: ${random.int[1000,2000]} //随机数
user_name: ${student.name2:吴没}//调用properties里面配置 如果为空默认为后面的
${random.uuid}
${random.value}
${random.int/long}
${random.int[1-1000]} 指定范围的随机
${random.int(10)} 10以内的随机