- 配置文件加载


#微信支付的appid
wxpay.appid=w23432432432
#支付密钥
wxpay.sercret=sfweinkkk
#微信支付商户号
wx.mechid=324324
方式一:
① controller上面配置@PropertySource("classpath:resource.properties")
② 增加属性@Value("${test.name}")
package com.gd.dwn.xddemoproject.controller;
import com.gd.dwn.xddemoproject.config.WXConfig;
import com.gd.dwn.xddemoproject.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map