请求签名相关修改

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
parent ce5b86fa06
commit bbd274d682

@ -5,7 +5,7 @@ curl --location --request POST 'localhost:8080/base/cloud/spi' \
--data-raw '{
"appId":"7264840234423027259",
"authId":"4463798",
"method":"getPlatformAuthUrl",
"method":"searchChoicenessSourceItem",
"data":"{}"
}'

@ -33,15 +33,15 @@ public class SearchChoicenessSourceItemRequestDTO {
/**
*
*/
private int isHideMoved;
private Integer isHideMoved;
/**
*
*/
private int pageNo;
private Integer pageNo;
/**
* 20
*/
private int pageSize;
private Integer pageSize;
}

@ -32,6 +32,7 @@ public class SPIBaseService {
protected String authCode;
public void initHandle(BaseRequest req) {
authCode = "NGNiYzEyODUtNzFhOS01ZmIwLWE5MDEtYzI3ZTAyYWFjOTA2";
shopId = Long.valueOf(req.getAuthId());
// TODO 后面可以redis缓存避免每次都查库

@ -46,7 +46,6 @@ public class GetPlatformAuthUrlService extends SPIBaseService implements Extensi
params.put("shopName",shopInfo.getShopName());
params.put("gmtExpire", "2024-08-30 00:00:00");
params.put("version","3");
log.info("参数" + params);
String res = null;
try {
res = dsJsonRequestTemplate.execute("/platform_shop/get_platform_auth_url", params);

@ -40,7 +40,7 @@ public class MemberAuthCallback extends SPIBaseService implements ExtensionServi
public BaseResponse<Map<String, String>> handle(BaseRequest<MemberAuthCallBackRequestDTO> req) {
// ----参数校验----
MemberAuthCallBackRequestDTO fields = req.getData();
log.info("receive callback: " + JSON.toJSONString(fields));
log.info("receive callback: " + JSON.toJSONString(req.getData()));
authCode = fields.getAuthCode();
// ----逻辑校验----

@ -1,5 +1,6 @@
package com.ms.api.spi.move;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
@ -39,11 +40,12 @@ public class SearchChoicenessSourceItemService extends SPIBaseService implements
params.put("keyword",fields.getKeyword());
params.put("topCid",fields.getTopCid());
params.put("sort",fields.getSort());
params.put("ruleIds", JSON.toJSONString(fields.getRuleIds()));
params.put("isHideMoved",String.valueOf(fields.getIsHideMoved()));
params.put("pageNo",String.valueOf(fields.getPageNo()));
params.put("pageSize",String.valueOf(fields.getPageSize()));
params.put("authCode",""); // TODO 从数据库获取
params.put("ruleIds", fields.getRuleIds());
params.put("isHideMoved",fields.getIsHideMoved());
params.put("pageNo",fields.getPageNo());
params.put("pageSize",fields.getPageSize());
params.put("authCode",authCode); // TODO 从数据库获取
log.info(params.toString());
String res = null;
try {

@ -13,6 +13,7 @@ import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;
import java.util.Set;
/**
@ -68,9 +69,11 @@ public class DsJsonRequestTemplate {
StringBuilder sb = new StringBuilder();
sb.append(dsToken);
for (String s : keyArray) {
String value = JSON.toJSONString(params.get(s));
value = CommonTool.removeQuotes(value);
sb.append(s).append(value);
if (!Objects.isNull(params.get(s))) {
String value = JSON.toJSONString(params.get(s));
value = CommonTool.removeQuotes(value);
sb.append(s).append(value);
}
}
sb.append(dsToken);
log.info("row str:" + sb);

Loading…
Cancel
Save