|
|
|
@ -1,10 +1,12 @@ |
|
|
|
|
package com.hai.config; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.hai.common.pay.util.sdk.WXPayConstants; |
|
|
|
|
import com.hai.common.utils.HttpsUtils; |
|
|
|
|
import com.hai.common.utils.MD5Util; |
|
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hai.common.utils.WxUtils; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
@ -41,6 +43,23 @@ public class QianZhuConfig { |
|
|
|
|
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getQinzhuUrl()+"/api/v2/platform/getToken", map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static JSONObject getMobileToken(String platformUniqueId,String nickname,String mobile) throws Exception { |
|
|
|
|
Map<String,Object> contentMap = new HashMap<>(); |
|
|
|
|
contentMap.put("platformUniqueId", platformUniqueId); |
|
|
|
|
contentMap.put("nickname", nickname); |
|
|
|
|
contentMap.put("mobile", mobile); |
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("platformId", CommonSysConst.getSysConfig().getQinzhuPlatformId()); |
|
|
|
|
map.put("action", "users.getTokenV2"); |
|
|
|
|
map.put("version", "1.0"); |
|
|
|
|
map.put("content", JSON.toJSONString(contentMap)); |
|
|
|
|
map.put("traceId", WxUtils.makeNonStr()); |
|
|
|
|
map.put("timestamp", new Date().getTime()); |
|
|
|
|
map.put("sign", MD5Util.encode(generateSignature(map,CommonSysConst.getSysConfig().getQinzhuSecret()).getBytes()).toLowerCase()); |
|
|
|
|
return HttpsUtils.doPost("https://live.qianzhu8.com/gateway", JSON.toJSONString(map)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* KFC |
|
|
|
|