yml动态资源配置

从yml文件中读取路径path
yml配置
U9:
 http: http://www/U9C/RestServices/YongWen.IU9InfSV.svc/Do
 entCode: 001
 userCode: 07195
代码读取配置
//导入资源包
import org.springframework.beans.factory.annotation.Value;
//使用注解申明变量
@Value("${U9.http}")
   private String http;

   @Value("${U9.entCode}")
   private String entCode;

   @Value("${U9.userCode}")
   private String userCode;
代码模块

 

yml文件

 

 

posted @ 2023-03-03 09:25  爱豆技术部  阅读(82)  评论(0)    收藏  举报