新建配置文件vagetabals.properties
新建配置类
新建实体类
vegetables.potato=土豆
vegetables.eggplant=茄子
vegetables.apple=苹果
package com.uncle.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
/**
* @program: SpringBoot-study
* @description: 蔬菜配置类
* @author: 步尔斯特
* @create: 2021-03-01 19:47
**/
@Configuration
@ConfigurationProperties(prefix = "vegetables")
@PropertySource("classpath:ve