mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-30 08:00:00 +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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user