/**
* 生成签名信息
* @param appSecret 产品私钥
* @param params 接口请求参数名和参数值map,不包括signature参数名
*/
public String genSignature(String appSecret, Map<String, String> params) {
String[] paramNames = params.keySet().toArray(new String[0]);
Arrays.sort(paramNames);
StringBuilder sb = new StringBuilder();
sb.append(appSecret);
for (String name : paramNames) {
String value = ObjectUtils.defaultIfNull(params.get(name), StringUtils.EMPTY);
sb.append(name).append(value);
}
sb.append(appSecret);
//DigestUtils.md5Hex(sb.toString().getBytes(StandardCharsets.UTF_8));
return sb.toString();
}