mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
新增 甬城泊车相关接口、controller
This commit is contained in:
@@ -27,6 +27,8 @@ public class CommonResult<T> {
|
||||
|
||||
private String sig;
|
||||
|
||||
private String portName;
|
||||
|
||||
protected CommonResult() {
|
||||
|
||||
}
|
||||
@@ -38,6 +40,14 @@ public class CommonResult<T> {
|
||||
this.sig = sig;
|
||||
}
|
||||
|
||||
protected CommonResult(long ret, String msg, T data, String sig, String portName) {
|
||||
this.ret = ret;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
this.sig = sig;
|
||||
this.portName = portName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
@@ -49,6 +59,16 @@ public class CommonResult<T> {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMsg(), data, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 甬城泊车成功返回结果
|
||||
* @param data
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> YCBCSuccess(T data) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMsg(), data, null, "wcc-pro");
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
@@ -60,11 +80,21 @@ public class CommonResult<T> {
|
||||
public static <T> CommonResult<T> success(T data, String message) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), message, data, null);
|
||||
}
|
||||
// 甬城泊车成功返回结果
|
||||
public static <T> CommonResult<T> YCBCSuccess(T data, String message) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), message, data, null, "wcc-pro");
|
||||
}
|
||||
|
||||
|
||||
public static <T> CommonResult<T> success(Integer ret, String msg, T data, String sig) {
|
||||
return new CommonResult<T>(ret, msg, data, sig);
|
||||
}
|
||||
|
||||
// 甬城泊车成功返回结果
|
||||
public static <T> CommonResult<T> YCBCSuccess(Integer ret, String msg, T data, String sig) {
|
||||
return new CommonResult<T>(ret, msg, data, sig, "wcc-pro");
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
@@ -76,6 +106,10 @@ public class CommonResult<T> {
|
||||
return new CommonResult<T>(resultCode.getCode(), resultCode.getMsg(), null, null);
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> YCBCFailed(ResultCode resultCode) {
|
||||
return new CommonResult<T>(resultCode.getCode(), resultCode.getMsg(), null, null, "wcc-pro");
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回
|
||||
*
|
||||
@@ -88,6 +122,10 @@ public class CommonResult<T> {
|
||||
return new CommonResult<T>(code, msg, null, null);
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> YCBCFailed(long code, String msg, String portName) {
|
||||
return new CommonResult<T>(code, msg, null, null, portName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
@@ -99,6 +137,10 @@ public class CommonResult<T> {
|
||||
return failed(ResultCode.ERROR.getCode(), msg);
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> YCBCFailed(String msg) {
|
||||
return YCBCFailed(ResultCode.ERROR.getCode(), msg, "wcc-pro");
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
@@ -109,6 +151,10 @@ public class CommonResult<T> {
|
||||
return failed(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> YCBCFailed() {
|
||||
return YCBCFailed(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
@@ -141,4 +187,12 @@ public class CommonResult<T> {
|
||||
public void setSig(String sig) {
|
||||
this.sig = sig;
|
||||
}
|
||||
|
||||
public String getPortName() {
|
||||
return portName;
|
||||
}
|
||||
|
||||
public void setPortName(String portName) {
|
||||
this.portName = portName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,10 +217,10 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||
String dataSecret = "vj3RWNsWIxT5MC2K";
|
||||
String dataSecretIV = "jjkySnGlM3pbOUki";
|
||||
String signSecret = "NbELMbWtbHikNSlu";
|
||||
String dataString = "HcKHxaIiuG7H/PUavhtbRg2CNRSJ6X7pTgwKJNdx768+fw0WLo+h5LZEWcAMAOy+DYBQRB6GE9rybFTTTA6dIL1c3OlIBjp/1yoomTNqMlY=";
|
||||
String dataSecret = "SPBNJ1Z5EQNmpK08"; // SPBNJ1Z5EQNmpK08
|
||||
String dataSecretIV = "peRoTcb2C7zqKeII"; // peRoTcb2C7zqKeII
|
||||
String signSecret = "sRjCDeokckFGpYpA"; // sRjCDeokckFGpYpA
|
||||
String dataString = "DLYTJz/I1OkVfqHDPEyF6g==";
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.jsowell.thirdparty.yongchengboche.service;
|
||||
|
||||
import com.jsowell.pile.dto.QueryEquipChargeStatusDTO;
|
||||
import com.jsowell.pile.dto.QueryEquipmentDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
|
||||
|
||||
@@ -108,4 +105,11 @@ public interface YCBCService {
|
||||
* @return
|
||||
*/
|
||||
String pushChargeOrderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送充电站信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String pushStationInfo(PushStationInfoDTO dto);
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.jsowell.thirdparty.yongchengboche.service.impl;
|
||||
|
||||
import com.jsowell.pile.dto.QueryEquipChargeStatusDTO;
|
||||
import com.jsowell.pile.dto.QueryEquipmentDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
|
||||
@@ -162,4 +159,14 @@ public class YCBCServiceImpl implements YCBCService {
|
||||
return lianLianService.pushChargeOrderInfo(orderCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电站信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushStationInfo(PushStationInfoDTO dto) {
|
||||
return zdlService.pushStationInfo(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user