在项目中会有特有常量,比如url地址
配置在application.properties文件中(SpringBoot项目)
举例:
#下载的二维码页面路径
base.rqPath=http://47.100.16.134:8001/System_QR_code/downInformation?invitation=
#表示注解
base表示对象
.rqPath表示属性
对象举例:
@ConfigurationProperties(prefix = "base")
public class TextConfig {
private String rqPath;
public String getRqPath() {
return rqPath;
}
public void setRqPath(String rqPath) {
this.rqPath = rqPath;
}
}
@ConfigurationProperties固定注解
对象私有+getset方法
取值举例:
textConfig.getRqPath()