定义配置文件
person:
middleman:
appId: xxx
appSecret: xxxxxx
具体实现
/**
* @version V1.0
* @description:
* @author: Cdx
* @date: 2023/2/9
*/
@Configuration
public class FrameworkBaseConfig {
@Value("${person.middleman.appId}")
private String middlemanAppId;
@Value("${person.middleman.appSecret}")
private String middlemanAppSecret;
public static String MIDDLEMAN_APP_ID;
public static String MIDDLEMAN_APP_SECRET;
/**
* 初始化静态常量
*/
@PostConstruct
public void init() {
MIDDLEMAN_APP_ID = this.middlemanAppId;
MIDDLEMAN_APP_SECRET = this.middlemanAppSecret;
}
}