|
|
|
@@ -2,15 +2,22 @@ package com.iformall.sms.wiwide; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxWiWideInfo; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.enums.EnumVerifyCode; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.service.DataTowerService; |
|
|
|
import com.iformall.sms.SMSExcutor; |
|
|
|
import com.iformall.utils.*; |
|
|
|
import com.sun.glass.ui.Application; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.shiro.codec.Base64; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.boot.SpringApplication; |
|
|
|
import org.springframework.context.ApplicationContext; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
@@ -215,7 +222,7 @@ public class WiwideUtil implements SMSExcutor { |
|
|
|
return data; |
|
|
|
} |
|
|
|
|
|
|
|
public static String queryDataNew(String url, String sign, Map<String, String> params) { |
|
|
|
public static String queryDataNew(String url, String sign, Map<String, Object> params) { |
|
|
|
|
|
|
|
String data = HttpUtil.doPostWiwideNew(url, sign, params); |
|
|
|
return data; |
|
|
|
@@ -223,10 +230,33 @@ public class WiwideUtil implements SMSExcutor { |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
Map<String, String> params = new HashMap<>(2); |
|
|
|
params.put("username", "lianhua"); |
|
|
|
params.put("password", "widash1234"); |
|
|
|
String token = HttpUtil.doPost("http://140.143.33.245/api/user/auth", params); |
|
|
|
System.out.println(DataUtil.unicodeToUtf8(token)); |
|
|
|
} |
|
|
|
params.put("username", "fm_test"); |
|
|
|
params.put("password", "wiwide123"); |
|
|
|
String res = HttpUtil.doPost("http://140.143.33.245/api/user/auth", params); |
|
|
|
System.out.println(res); |
|
|
|
JSONObject result = JSONObject.parseObject(res); |
|
|
|
if (result.getInteger("result") == 0) { |
|
|
|
JSONObject data = result.getJSONObject("data"); |
|
|
|
String secretKey = data.getString("SecretKey"); |
|
|
|
String secretId = data.getString("SecretId"); |
|
|
|
WxWiWideInfo wiWideInfo = new WxWiWideInfo(); |
|
|
|
wiWideInfo.setSignKey("191ffbbb437946318bfecb373e694a13"); |
|
|
|
wiWideInfo.setWiwideId(secretId); |
|
|
|
wiWideInfo.setWiwideKey(secretKey); |
|
|
|
String sign = WiwideEntry.encrypt(wiWideInfo); |
|
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
param.put("pageStart",1); |
|
|
|
param.put("pageSize",10); |
|
|
|
param.put("key",0); |
|
|
|
param.put("value",""); |
|
|
|
param.put("placeStatus",0); |
|
|
|
|
|
|
|
|
|
|
|
String s = queryDataNew("http://140.143.33.245" + "/api/place/place", sign, param); |
|
|
|
System.out.println(DataUtil.unicodeToUtf8(s)); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |