Skip to content

Commit fbca4cd

Browse files
committed
pay模块批量添加缺失的javadoc文档
1 parent a41ebdc commit fbca4cd

40 files changed

+631
-54
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class WxPayApiData {
3535
private String exceptionMsg;
3636

3737
/**
38+
* Instantiates a new Wx pay api data.
39+
*
3840
* @param url 接口请求地址
3941
* @param requestData 请求数据
4042
* @param responseData 响应数据

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*
1414
* @author <a href="https://github.com/binarywang">Binary Wang</a>
1515
*/
16-
1716
@Data
1817
@EqualsAndHashCode(callSuper = true)
1918
@Builder(builderMethodName = "newBuilder")

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*
1414
* @author <a href="https://github.com/binarywang">Binary Wang</a>
1515
*/
16-
1716
@Data
1817
@EqualsAndHashCode(callSuper = true)
1918
@Builder(builderMethodName = "newBuilder")

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/entpay/EntPayRequest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*
2121
* @author <a href="https://github.com/binarywang">Binary Wang</a>
2222
*/
23-
2423
@Data
2524
@EqualsAndHashCode(callSuper = true)
2625
@Builder(builderMethodName = "newBuilder")

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayNotifyResponse.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,25 @@ public class WxPayNotifyResponse {
3232
@XStreamAlias("return_msg")
3333
private String returnMsg;
3434

35+
/**
36+
* Fail string.
37+
*
38+
* @param msg the msg
39+
* @return the string
40+
*/
3541
public static String fail(String msg) {
3642
WxPayNotifyResponse response = new WxPayNotifyResponse(FAIL, msg);
3743
XStream xstream = XStreamInitializer.getInstance();
3844
xstream.autodetectAnnotations(true);
3945
return xstream.toXML(response);
4046
}
4147

48+
/**
49+
* Success string.
50+
*
51+
* @param msg the msg
52+
* @return the string
53+
*/
4254
public static String success(String msg) {
4355
WxPayNotifyResponse response = new WxPayNotifyResponse(SUCCESS, msg);
4456
XStream xstream = XStreamInitializer.getInstance();

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayOrderNotifyCoupon.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
/**
1414
* 支付异步通知代金券详细.
15+
*
1516
* @author aimilin
1617
*/
1718
@Data
@@ -23,6 +24,12 @@ public class WxPayOrderNotifyCoupon implements Serializable {
2324
private String couponType;
2425
private Integer couponFee;
2526

27+
/**
28+
* To map map.
29+
*
30+
* @param index the index
31+
* @return the map
32+
*/
2633
public Map<String, String> toMap(int index) {
2734
Map<String, String> map = new HashMap<>();
2835
map.put("coupon_id_" + index, this.getCouponId());

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayOrderNotifyResult.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ public class WxPayOrderNotifyResult extends BaseWxPayResult {
285285
@XStreamAlias("version")
286286
private String version;
287287

288+
/**
289+
* From xml wx pay order notify result.
290+
*
291+
* @param xmlString the xml string
292+
* @return the wx pay order notify result
293+
*/
288294
public static WxPayOrderNotifyResult fromXML(String xmlString) {
289295
XStream xstream = XStreamInitializer.getInstance();
290296
xstream.processAnnotations(WxPayOrderNotifyResult.class);

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResult.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class WxPayRefundNotifyResult extends BaseWxPayResult implements Serializ
4040
*
4141
* @param xmlString xml字符串
4242
* @param mchKey 商户密钥
43+
* @return the wx pay refund notify result
44+
* @throws WxPayException the wx pay exception
4345
*/
4446
public static WxPayRefundNotifyResult fromXML(String xmlString, String mchKey) throws WxPayException {
4547
WxPayRefundNotifyResult result = BaseWxPayResult.fromXML(xmlString, WxPayRefundNotifyResult.class);
@@ -252,6 +254,12 @@ public String toString() {
252254
@XStreamAlias("refund_request_source")
253255
private String refundRequestSource;
254256

257+
/**
258+
* From xml req info.
259+
*
260+
* @param xmlString the xml string
261+
* @return the req info
262+
*/
255263
public static ReqInfo fromXML(String xmlString) {
256264
XStream xstream = XStreamInitializer.getInstance();
257265
xstream.processAnnotations(ReqInfo.class);

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/BaseWxPayRequest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public abstract class BaseWxPayRequest implements Serializable {
121121
* 将单位为元转换为单位为分.
122122
*
123123
* @param yuan 将要转换的元的数值字符串
124+
* @return the integer
124125
*/
125126
public static Integer yuanToFen(String yuan) {
126127
return new BigDecimal(yuan).setScale(2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue();
@@ -143,6 +144,8 @@ private void checkFields() throws WxPayException {
143144

144145
/**
145146
* 检查约束情况.
147+
*
148+
* @throws WxPayException the wx pay exception
146149
*/
147150
protected abstract void checkConstraints() throws WxPayException;
148151

@@ -178,6 +181,11 @@ public String toString() {
178181
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
179182
}
180183

184+
/**
185+
* To xml string.
186+
*
187+
* @return the string
188+
*/
181189
public String toXML() {
182190
XStream xstream = XStreamInitializer.getInstance();
183191
//涉及到服务商模式的两个参数,在为空值时置为null,以免在请求时将空值传给微信服务器
@@ -189,13 +197,17 @@ public String toXML() {
189197

190198
/**
191199
* 签名时,是否忽略appid.
200+
*
201+
* @return the boolean
192202
*/
193203
protected boolean ignoreAppid() {
194204
return false;
195205
}
196206

197207
/**
198208
* 签名时,忽略的参数.
209+
*
210+
* @return the string [ ]
199211
*/
200212
protected String[] getIgnoredParamsForSign() {
201213
return new String[0];
@@ -210,6 +222,7 @@ protected String[] getIgnoredParamsForSign() {
210222
* </pre>
211223
*
212224
* @param config 支付配置对象,用于读取相应系统配置信息
225+
* @throws WxPayException the wx pay exception
213226
*/
214227
public void checkAndSign(WxPayConfig config) throws WxPayException {
215228
this.checkFields();

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,19 @@ public abstract class BaseWxPayResult implements Serializable {
116116
* 将单位分转换成单位圆.
117117
*
118118
* @param fen 将要被转换为元的分的数值
119+
* @return the string
119120
*/
120121
public static String fenToYuan(Integer fen) {
121122
return BigDecimal.valueOf(Double.valueOf(fen) / 100).setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString();
122123
}
123124

124125
/**
125126
* 从xml字符串创建bean对象.
127+
*
128+
* @param <T> the type parameter
129+
* @param xmlString the xml string
130+
* @param clz the clz
131+
* @return the t
126132
*/
127133
public static <T extends BaseWxPayResult> T fromXML(String xmlString, Class<T> clz) {
128134
XStream xstream = XStreamInitializer.getInstance();
@@ -132,6 +138,11 @@ public static <T extends BaseWxPayResult> T fromXML(String xmlString, Class<T> c
132138
return result;
133139
}
134140

141+
/**
142+
* Gets logger.
143+
*
144+
* @return the logger
145+
*/
135146
protected Logger getLogger() {
136147
return LoggerFactory.getLogger(this.getClass());
137148
}
@@ -143,6 +154,8 @@ public String toString() {
143154

144155
/**
145156
* 将bean通过保存的xml字符串转换成map.
157+
*
158+
* @return the map
146159
*/
147160
public Map<String, String> toMap() {
148161
if (StringUtils.isBlank(this.xmlString)) {
@@ -189,6 +202,9 @@ private Document getXmlDoc() {
189202

190203
/**
191204
* 获取xml中元素的值.
205+
*
206+
* @param path the path
207+
* @return the xml value
192208
*/
193209
String getXmlValue(String... path) {
194210
Document doc = this.getXmlDoc();
@@ -206,6 +222,9 @@ String getXmlValue(String... path) {
206222

207223
/**
208224
* 获取xml中元素的值,作为int值返回.
225+
*
226+
* @param path the path
227+
* @return the xml value as int
209228
*/
210229
Integer getXmlValueAsInt(String... path) {
211230
String result = this.getXmlValue(path);
@@ -219,8 +238,10 @@ Integer getXmlValueAsInt(String... path) {
219238
/**
220239
* 校验返回结果签名.
221240
*
241+
* @param wxPayService the wx pay service
222242
* @param signType 签名类型
223243
* @param checkSuccess 是否同时检查结果是否成功
244+
* @throws WxPayException the wx pay exception
224245
*/
225246
public void checkResult(WxPayService wxPayService, String signType, boolean checkSuccess) throws WxPayException {
226247
//校验返回结果签名

0 commit comments

Comments
 (0)