@Configuration

@PropertySource(value="classpath:application.properties")

public class WeChatConfig {

        @Value("${wxpay.appid}")

     private String appId;

 }

 

 

使用:

 @Autowired

 private WeChatConfig weChatConfig;

 weChatConfig.getAppId();

相关文章: