mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
汇付基础响应
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package com.jsowell.adapay.response;
|
package com.jsowell.adapay.response;
|
||||||
|
|
||||||
|
import com.jsowell.common.enums.adapay.AdapayStatusEnum;
|
||||||
|
import com.jsowell.common.util.StringUtils;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,4 +22,12 @@ public class AdapayBaseResponse {
|
|||||||
private String error_code;
|
private String error_code;
|
||||||
private String error_msg;
|
private String error_msg;
|
||||||
private String error_type;
|
private String error_type;
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return StringUtils.equals(status, AdapayStatusEnum.SUCCEEDED.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNotSuccess() {
|
||||||
|
return !isSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -663,7 +663,7 @@ public class AdapayService {
|
|||||||
|
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
QueryDrawCashResponse queryDrawCashResponse = JSON.parseObject(JSON.toJSONString(response), QueryDrawCashResponse.class);
|
QueryDrawCashResponse queryDrawCashResponse = JSON.parseObject(JSON.toJSONString(response), QueryDrawCashResponse.class);
|
||||||
if (queryDrawCashResponse == null || !StringUtils.equals(queryDrawCashResponse.getStatus(), "succeeded")) {
|
if (queryDrawCashResponse == null || queryDrawCashResponse.isNotSuccess()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
QueryDrawCashResponse.Cash cash = queryDrawCashResponse.getCashList().get(0);
|
QueryDrawCashResponse.Cash cash = queryDrawCashResponse.getCashList().get(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user