背景
配置
dingtalk: farm-notify: farm-0001: https://oapi.dingtalk.com/robot/send?access_token=678b352043933dd7f2cbd09520e32a72d27b2005e23897dbb9b23c2524de122f
@Component @ConfigurationProperties("dingtalk") public class DingTalkProperties { private Map<String,String> farmNotify; //<farmCode,url> DingTalkProperties() { } public Map<String, String> getFarmNotify() { return farmNotify; } public void setFarmNotify(Map<String, String> farmNotify) { this.farmNotify = farmNotify; } @Override public String toString() { return "DingTalkProperties{" + "farmNotify=" + farmNotify + ‘}‘; } }
扩展
farmNotify
。带有破折号的 YAML 属性将自动转换为代码中等效的驼峰式大小写。原文:https://www.cnblogs.com/zuiyue_jing/p/14956068.html