springboot提取url到application并使用"/>
springboot提取url到application并使用
String url = ":8080/PODS/push/equipment/" springboot将url提取到配置文件中,并在Controller中使用
application.properties
#查询设备基本信息文档
api.url = :8080/PODS/push/equipment/
ApiConfig
@Configuration
@ConfigurationProperties(prefix = "api")
public class ApiConfig {private String url;public String getUrl() {return url;}public void setUrl(String url) {this.url = url;}
}
使用
@Autowired
private ApiConfig apiConfig;
String url = apiConfig.getUrl();
更多推荐
springboot提取url到application并使用
发布评论