|
|
|
@ -8,6 +8,8 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
|
|
import org.springframework.util.MultiValueMap;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
@ -61,18 +63,23 @@ public class DsRequestTemplate {
|
|
|
|
|
Set<String> keySet = data.keySet();
|
|
|
|
|
String[] keyArray = keySet.toArray(new String[0]);
|
|
|
|
|
Arrays.sort(keyArray);
|
|
|
|
|
|
|
|
|
|
MultiValueMap params = new LinkedMultiValueMap();
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
sb.append(dsToken);
|
|
|
|
|
for (int i = 0; i < keyArray.length; i++) {
|
|
|
|
|
if (String.valueOf(data.get(keyArray[i])).length() > 0) {
|
|
|
|
|
sb.append(keyArray[i]).append(data.get(keyArray[i]));
|
|
|
|
|
params.add(keyArray[i], data.get(keyArray[i]));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sb.append(dsToken);
|
|
|
|
|
log.info("sdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsd");
|
|
|
|
|
log.info(sb.toString());
|
|
|
|
|
String sign = SecureUtil.md5(sb.toString());
|
|
|
|
|
headers.set("x-dd-micro-app-sign", sign);
|
|
|
|
|
|
|
|
|
|
return cloudRequestTemplate.executePost(dsHost + url, body, headers);
|
|
|
|
|
return cloudRequestTemplate.executePost(dsHost + url, params, headers);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|