Java中Map使用/渠道ID
/**
* 渠道ID
*/
private static final Map<String, String> channelIdAndKey = new HashedMap() {
{
List<String> channelIDs = Arrays.asList(ConfigMgr.getReqServUrl("dinsChannelID").split(";"));
for (String channelid : channelIDs) {
String[] str = channelid.split(":");
//abc:123
put(str[0], str[1]);
}
}
};
String channelSecret= channelIdAndKey.get(reqBody.getChannelID());
if (!channelIdAndKey.containsKey(reqBody.getChannelID())){
...
}