mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-04 04:37:46 +08:00
🎨 优化部分代码
This commit is contained in:
parent
03d9f2d19e
commit
a81550f79f
@ -1,27 +1,10 @@
|
||||
package com.github.binarywang.wxpay.bean.result;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.xpath.XPathConstants;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
|
||||
import com.github.binarywang.wxpay.util.XmlConfig;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.github.binarywang.wxpay.util.SignUtils;
|
||||
import com.github.binarywang.wxpay.util.XmlConfig;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
@ -30,8 +13,22 @@ import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import org.w3c.dom.*;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.xpath.XPathConstants;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@ -42,9 +39,7 @@ import org.w3c.dom.*;
|
||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||
*/
|
||||
@Data
|
||||
public abstract class BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = -3559552761816864481L;
|
||||
|
||||
public abstract class BaseWxPayResult {
|
||||
/**
|
||||
* 返回状态码.
|
||||
*/
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 授权码查询openid接口请求结果类
|
||||
@ -18,7 +20,8 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayAuthcode2OpenidResult extends BaseWxPayResult {
|
||||
public class WxPayAuthcode2OpenidResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = -2409408725777108398L;
|
||||
/**
|
||||
* <pre>
|
||||
* 用户标识.
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.binarywang.wxpay.bean.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 交易时间:2017-04-06 01:00:02 公众账号ID: 商户号: 子商户号:0 设备号:WEB 微信订单号: 商户订单号:2017040519091071873216 用户标识: 交易类型:NATIVE
|
||||
* 交易状态:REFUND 付款银行:CFT 货币种类:CNY 总金额:0.00 企业红包金额:0.00 微信退款单号: 商户退款单号:20170406010000933 退款金额:0.01 企业红包退款金额:0.00
|
||||
|
@ -3,6 +3,8 @@ package com.github.binarywang.wxpay.bean.result;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 微信支付结果仅包含有return 和result等相关信息的的属性类
|
||||
@ -12,7 +14,9 @@ import org.w3c.dom.Document;
|
||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||
*/
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayCommonResult extends BaseWxPayResult {
|
||||
public class WxPayCommonResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = -8051324891539367420L;
|
||||
|
||||
@Override
|
||||
protected void loadXml(Document d) {
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import org.w3c.dom.Document;
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayFacepayResult extends BaseWxPayResult {
|
||||
|
||||
private static final long serialVersionUID = -4116580976046716911L;
|
||||
|
||||
/**
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.binarywang.wxpay.bean.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 记账时间:2018-02-01 04:21:23 微信支付业务单号:50000305742018020103387128253 资金流水单号:1900009231201802015884652186 业务名称:退款
|
||||
* 业务类型:退款 收支类型:支出 收支金额(元):0.02 账户结余(元):0.17 资金变更提交申请人:system 备注:缺货 业务凭证号:REF4200000068201801293084726067
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.github.binarywang.wxpay.bean.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 下载资金账单接口响应结果对象类
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 提交刷卡支付接口响应结果对象类
|
||||
@ -18,7 +20,7 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayMicropayResult extends BaseWxPayResult {
|
||||
public class WxPayMicropayResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = 529670965722059189L;
|
||||
|
||||
/**
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 关闭订单结果对象类
|
||||
@ -18,8 +20,8 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayOrderCloseResult extends BaseWxPayResult {
|
||||
|
||||
public class WxPayOrderCloseResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = 800873502890274834L;
|
||||
/**
|
||||
* 业务结果描述
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayOrderQueryResult extends BaseWxPayResult {
|
||||
public class WxPayOrderQueryResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = 8241891654782412789L;
|
||||
|
||||
/**
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 撤销订单响应结果类
|
||||
@ -18,8 +20,8 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayOrderReverseResult extends BaseWxPayResult {
|
||||
|
||||
public class WxPayOrderReverseResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = 3615350465758009338L;
|
||||
/**
|
||||
* <pre>
|
||||
* 是否重调
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 汇率查询响应.
|
||||
*
|
||||
@ -16,7 +18,7 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayQueryExchangeRateResult extends BaseWxPayResult {
|
||||
public class WxPayQueryExchangeRateResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = 2269734222658532364L;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayRedpackQueryResult extends BaseWxPayResult {
|
||||
public class WxPayRedpackQueryResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = -3849864122189552906L;
|
||||
|
||||
/**
|
||||
|
@ -5,6 +5,8 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 退款代金券信息.
|
||||
@ -16,7 +18,8 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WxPayRefundCouponInfo {
|
||||
public class WxPayRefundCouponInfo implements Serializable {
|
||||
private static final long serialVersionUID = -8493640819570138722L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:退款代金券ID.
|
||||
|
@ -1,21 +1,18 @@
|
||||
package com.github.binarywang.wxpay.bean.result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.*;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 微信支付-退款查询返回结果
|
||||
@ -28,7 +25,8 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayRefundQueryResult extends BaseWxPayResult {
|
||||
public class WxPayRefundQueryResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = 5392369423225328754L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:设备号.
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Created by BinaryWang on 2017/6/18.
|
||||
@ -17,8 +19,8 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPaySandboxSignKeyResult extends BaseWxPayResult {
|
||||
|
||||
public class WxPaySandboxSignKeyResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = -5793375529340378941L;
|
||||
/**
|
||||
* <pre>
|
||||
* 沙箱密钥
|
||||
|
@ -18,6 +18,7 @@ import java.io.Serializable;
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPaySendMiniProgramRedpackResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = 5847928569755121611L;
|
||||
/**
|
||||
* 商户订单号.
|
||||
*/
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 转换短链接结果对象类
|
||||
@ -18,7 +20,8 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayShorturlResult extends BaseWxPayResult {
|
||||
public class WxPayShorturlResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = -2121902492357304418L;
|
||||
/**
|
||||
* <pre>
|
||||
* URL链接
|
||||
|
@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 在发起微信支付前,需要调用统一下单接口,获取"预支付交易会话标识"返回的结果
|
||||
@ -18,7 +20,8 @@ import org.w3c.dom.Document;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class WxPayUnifiedOrderResult extends BaseWxPayResult {
|
||||
public class WxPayUnifiedOrderResult extends BaseWxPayResult implements Serializable {
|
||||
private static final long serialVersionUID = -4006038483273621997L;
|
||||
|
||||
/**
|
||||
* 微信生成的预支付回话标识,用于后续接口调用中使用,该值有效期为2小时
|
||||
|
Loading…
Reference in New Issue
Block a user