mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
update 联联接口
This commit is contained in:
@@ -34,7 +34,7 @@ import com.jsowell.service.MemberService;
|
||||
import com.jsowell.service.OrderService;
|
||||
import com.jsowell.service.PileRemoteService;
|
||||
import com.jsowell.service.PileService;
|
||||
import com.jsowell.thirdparty.lianlian.dto.QueryTokenDTO;
|
||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||
@@ -181,7 +181,7 @@ public class SpringBootTestController {
|
||||
request.put("Sig", sig);
|
||||
String tokenRequest = JSONUtil.toJsonStr(request);
|
||||
|
||||
QueryTokenDTO dto = JSONObject.parseObject(tokenRequest, QueryTokenDTO.class);
|
||||
CommonParamsDTO dto = JSONObject.parseObject(tokenRequest, CommonParamsDTO.class);
|
||||
|
||||
lianLianService.generateToken(dto);
|
||||
}
|
||||
@@ -203,15 +203,15 @@ public class SpringBootTestController {
|
||||
// LianLianGetTokenDTO dto = new LianLianGetTokenDTO();
|
||||
// dto.setOperatorId("MA1JLFUU8");
|
||||
// dto.setOperatorSecret("Nh62XxlIR5OjAzFj");
|
||||
String token = lianLianService.getToken("", "MA1JLFUU8", "fGwLsxW1HdzLw7jp");
|
||||
System.out.println("token:" + token);
|
||||
// String token = lianLianService.getToken("", "MA1JLFUU8", "fGwLsxW1HdzLw7jp");
|
||||
// System.out.println("token:" + token);
|
||||
|
||||
String operatorId = "I4XLPQPV";
|
||||
String operatorSecret = "3DSBTWHVIC6KVCKI";
|
||||
// 请求data
|
||||
Map<String, String> data = new HashMap<>();
|
||||
data.put("OperatorID", operatorId);
|
||||
data.put("OperatorSecret", operatorSecret);
|
||||
// data.put("OperatorID", operatorId);
|
||||
// data.put("OperatorSecret", operatorSecret);
|
||||
String dataJson = JSONUtil.toJsonStr(data);
|
||||
|
||||
// 加密
|
||||
@@ -228,22 +228,23 @@ public class SpringBootTestController {
|
||||
// 生成签名
|
||||
String sig = GBSignUtils.sign(request, operatorSecret);
|
||||
request.put("Sig", sig);
|
||||
|
||||
QueryTokenDTO dto = new QueryTokenDTO();
|
||||
dto.setOperatorID(operatorId);
|
||||
dto.setData(strData);
|
||||
dto.setTimeStamp(timeStamp);
|
||||
dto.setSeq("0001");
|
||||
dto.setSig(sig);
|
||||
Map<String, String> map = lianLianService.generateToken(dto);
|
||||
String data1 = map.get("Data");
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data1),
|
||||
operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
String dataStr = new String(plainText, "UTF-8");
|
||||
Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
|
||||
token = resultMap.get("AccessToken");
|
||||
System.out.println("解密后token:" + token);
|
||||
JSONObject jsonObject = new JSONObject(request);
|
||||
System.out.println(jsonObject);
|
||||
// CommonParamsDTO dto = new CommonParamsDTO();
|
||||
// dto.setOperatorID(operatorId);
|
||||
// dto.setData(strData);
|
||||
// dto.setTimeStamp(timeStamp);
|
||||
// dto.setSeq("0001");
|
||||
// dto.setSig(sig);
|
||||
// Map<String, String> map = lianLianService.generateToken(dto);
|
||||
// String data1 = map.get("Data");
|
||||
// // 解密data
|
||||
// byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data1),
|
||||
// operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
// String dataStr = new String(plainText, "UTF-8");
|
||||
// Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
|
||||
// String token = resultMap.get("AccessToken");
|
||||
// System.out.println("解密后token:" + token);
|
||||
|
||||
|
||||
// LianLianPushStationInfoDTO dto1 = LianLianPushStationInfoDTO.builder()
|
||||
|
||||
Reference in New Issue
Block a user