apollo 相关配置参数
1、string类型
@Value("${a.q}")
private String aQ;
相当于字符串,直接使用
2.list 类型,用逗号分割
@Value("#{'${account.pidAndName}'.split(',')}")
private List<String> pidAndName;
for (String str : pidAndName) {
String[] arrary = str.split(":");
............
int i = userId.indexOf(a);
mail = baseMail.get(i);
}
3.map类型
@Value("#{${privateKey}}")
private Map<String,String> privateKey;
String sign = MagCore.buildRequestByRSA(send, privateKey.get(accountNo));
4.格式处理
DateFormat format = null;
if(result.getTradeTime().indexOf("-") != -1) {
format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}else if(result.getTradeTime().indexOf("/") != -1) {
format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
}else {
format = new SimpleDateFormat("yyyyMMddHHmmss");
}
try {
dto.setTrandeTime(format.parse(result.getTradeTime().toString()));
}catch (Exception e) {
e.printStackTrace();
}