Skip to content

Commit d594656

Browse files
committed
pay模块进行lombok改造,精简代码
1 parent aa2ca20 commit d594656

50 files changed

Lines changed: 346 additions & 4311 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/WxPayApiData.java‎

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.github.binarywang.wxpay.bean;
22

3+
import lombok.Data;
4+
import lombok.NoArgsConstructor;
5+
36
/**
47
* <pre>
58
* 微信支付接口请求数据封装对象
@@ -8,6 +11,8 @@
811
*
912
* @author <a href="https://github.com/binarywang">Binary Wang</a>
1013
*/
14+
@Data
15+
@NoArgsConstructor
1116
public class WxPayApiData {
1217
/**
1318
* 接口请求地址
@@ -42,38 +47,6 @@ public WxPayApiData(String url, String requestData, String responseData, String
4247
this.exceptionMsg = exceptionMsg;
4348
}
4449

45-
public String getUrl() {
46-
return this.url;
47-
}
48-
49-
public void setUrl(String url) {
50-
this.url = url;
51-
}
52-
53-
public String getRequestData() {
54-
return this.requestData;
55-
}
56-
57-
public void setRequestData(String requestData) {
58-
this.requestData = requestData;
59-
}
60-
61-
public String getResponseData() {
62-
return this.responseData;
63-
}
64-
65-
public void setResponseData(String responseData) {
66-
this.responseData = responseData;
67-
}
68-
69-
public String getExceptionMsg() {
70-
return this.exceptionMsg;
71-
}
72-
73-
public void setExceptionMsg(String exceptionMsg) {
74-
this.exceptionMsg = exceptionMsg;
75-
}
76-
7750
@Override
7851
public String toString() {
7952
if (this.exceptionMsg != null) {

‎weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponInfoQueryRequest.java‎

Lines changed: 7 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.github.binarywang.wxpay.bean.request.WxPayBaseRequest;
44
import com.thoughtworks.xstream.annotations.XStreamAlias;
5+
import lombok.*;
56
import me.chanjar.weixin.common.annotation.Required;
67

78
/**
@@ -12,8 +13,13 @@
1213
*
1314
* @author <a href="https://github.com/binarywang">Binary Wang</a>
1415
*/
16+
@Data
17+
@EqualsAndHashCode(callSuper = true)
18+
@Builder(builderMethodName = "newBuilder")
19+
@NoArgsConstructor
20+
@AllArgsConstructor
1521
@XStreamAlias("xml")
16-
public class WxPayCouponInfoQueryRequest extends WxPayBaseRequest {
22+
public class WxPayCouponInfoQueryRequest extends WxPayBaseRequest {
1723
/**
1824
* <pre>
1925
* 字段名:代金券id
@@ -108,173 +114,10 @@ public class WxPayCouponInfoQueryRequest extends WxPayBaseRequest {
108114
@XStreamAlias("type")
109115
private String type;
110116

111-
private WxPayCouponInfoQueryRequest(Builder builder) {
112-
setAppid(builder.appid);
113-
setMchId(builder.mchId);
114-
setSubAppId(builder.subAppId);
115-
setSubMchId(builder.subMchId);
116-
setNonceStr(builder.nonceStr);
117-
setSign(builder.sign);
118-
setCouponId(builder.couponId);
119-
setStockId(builder.stockId);
120-
setOpenid(builder.openid);
121-
setOpUserId(builder.opUserId);
122-
setDeviceInfo(builder.deviceInfo);
123-
setVersion(builder.version);
124-
setType(builder.type);
125-
}
126-
127-
public static Builder newBuilder() {
128-
return new Builder();
129-
}
130-
131-
public String getCouponId() {
132-
return this.couponId;
133-
}
134-
135-
public void setCouponId(String couponId) {
136-
this.couponId = couponId;
137-
}
138-
139-
public String getStockId() {
140-
return this.stockId;
141-
}
142-
143-
public void setStockId(String stockId) {
144-
this.stockId = stockId;
145-
}
146-
147-
public String getOpenid() {
148-
return this.openid;
149-
}
150-
151-
public void setOpenid(String openid) {
152-
this.openid = openid;
153-
}
154-
155-
public String getOpUserId() {
156-
return this.opUserId;
157-
}
158-
159-
public void setOpUserId(String opUserId) {
160-
this.opUserId = opUserId;
161-
}
162-
163-
public String getDeviceInfo() {
164-
return this.deviceInfo;
165-
}
166-
167-
public void setDeviceInfo(String deviceInfo) {
168-
this.deviceInfo = deviceInfo;
169-
}
170-
171-
public String getVersion() {
172-
return this.version;
173-
}
174-
175-
public void setVersion(String version) {
176-
this.version = version;
177-
}
178-
179-
public String getType() {
180-
return this.type;
181-
}
182-
183-
public void setType(String type) {
184-
this.type = type;
185-
}
186117

187118
@Override
188119
protected void checkConstraints() {
189120
//do nothing
190121
}
191122

192-
193-
public static final class Builder {
194-
private String appid;
195-
private String mchId;
196-
private String subAppId;
197-
private String subMchId;
198-
private String nonceStr;
199-
private String sign;
200-
private String couponId;
201-
private String stockId;
202-
private String openid;
203-
private String opUserId;
204-
private String deviceInfo;
205-
private String version;
206-
private String type;
207-
208-
private Builder() {
209-
}
210-
211-
public Builder appid(String appid) {
212-
this.appid = appid;
213-
return this;
214-
}
215-
216-
public Builder mchId(String mchId) {
217-
this.mchId = mchId;
218-
return this;
219-
}
220-
221-
public Builder subAppId(String subAppId) {
222-
this.subAppId = subAppId;
223-
return this;
224-
}
225-
226-
public Builder subMchId(String subMchId) {
227-
this.subMchId = subMchId;
228-
return this;
229-
}
230-
231-
public Builder nonceStr(String nonceStr) {
232-
this.nonceStr = nonceStr;
233-
return this;
234-
}
235-
236-
public Builder sign(String sign) {
237-
this.sign = sign;
238-
return this;
239-
}
240-
241-
public Builder couponId(String couponId) {
242-
this.couponId = couponId;
243-
return this;
244-
}
245-
246-
public Builder stockId(String stockId) {
247-
this.stockId = stockId;
248-
return this;
249-
}
250-
251-
public Builder openid(String openid) {
252-
this.openid = openid;
253-
return this;
254-
}
255-
256-
public Builder opUserId(String opUserId) {
257-
this.opUserId = opUserId;
258-
return this;
259-
}
260-
261-
public Builder deviceInfo(String deviceInfo) {
262-
this.deviceInfo = deviceInfo;
263-
return this;
264-
}
265-
266-
public Builder version(String version) {
267-
this.version = version;
268-
return this;
269-
}
270-
271-
public Builder type(String type) {
272-
this.type = type;
273-
return this;
274-
}
275-
276-
public WxPayCouponInfoQueryRequest build() {
277-
return new WxPayCouponInfoQueryRequest(this);
278-
}
279-
}
280123
}

0 commit comments

Comments
 (0)