mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-04 12:47:46 +08:00
🎨 优化规范部分代码
This commit is contained in:
parent
bd100bf846
commit
aca8dbabbc
@ -87,7 +87,6 @@
|
||||
<dependency>
|
||||
<groupId>com.github.jedis-lock</groupId>
|
||||
<artifactId>jedis-lock</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -8,6 +8,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -18,70 +19,69 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class ApplymentStateQueryResult {
|
||||
public class ApplymentStateQueryResult implements Serializable {
|
||||
private static final long serialVersionUID = 6539090917423486409L;
|
||||
/**
|
||||
* 业务申请编号
|
||||
*/
|
||||
@SerializedName("business_code")
|
||||
private String businessCode;
|
||||
/**
|
||||
* 微信支付申请单号
|
||||
*/
|
||||
@SerializedName("applyment_id")
|
||||
private String applymentId;
|
||||
/**
|
||||
* 特约商户号
|
||||
*/
|
||||
@SerializedName("sub_mchid")
|
||||
private String subMchid;
|
||||
/**
|
||||
* 超级管理员签约链接
|
||||
*/
|
||||
@SerializedName("sign_url")
|
||||
private String signUrl;
|
||||
|
||||
/**
|
||||
* 业务申请编号
|
||||
*/
|
||||
@SerializedName("business_code")
|
||||
private String businessCode;
|
||||
/**
|
||||
* 微信支付申请单号
|
||||
*/
|
||||
@SerializedName("applyment_id")
|
||||
private String applymentId;
|
||||
/**
|
||||
* 特约商户号
|
||||
*/
|
||||
@SerializedName("sub_mchid")
|
||||
private String subMchid;
|
||||
/**
|
||||
* 超级管理员签约链接
|
||||
*/
|
||||
@SerializedName("sign_url")
|
||||
private String signUrl;
|
||||
/**
|
||||
* 申请单状态
|
||||
*/
|
||||
@SerializedName("applyment_state")
|
||||
private ApplymentStateEnum applymentState;
|
||||
/**
|
||||
* 申请状态描述
|
||||
*/
|
||||
@SerializedName("applyment_state_msg")
|
||||
private String applymentStateMsg;
|
||||
/**
|
||||
* 驳回原因详情
|
||||
*/
|
||||
@SerializedName("audit_detail")
|
||||
private List<AuditDetail> auditDetail;
|
||||
|
||||
/**
|
||||
* 驳回原因详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class AuditDetail {
|
||||
/**
|
||||
* 申请单状态
|
||||
*
|
||||
* 字段名
|
||||
*/
|
||||
@SerializedName("applyment_state")
|
||||
private ApplymentStateEnum applymentState;
|
||||
@SerializedName("field")
|
||||
private String field;
|
||||
/**
|
||||
* 申请状态描述
|
||||
* 字段名称
|
||||
*/
|
||||
@SerializedName("applyment_state_msg")
|
||||
private String applymentStateMsg;
|
||||
@SerializedName("field_name")
|
||||
private String fieldName;
|
||||
/**
|
||||
* 驳回原因详情
|
||||
* 驳回原因
|
||||
*/
|
||||
@SerializedName("audit_detail")
|
||||
private List<AuditDetail> auditDetail;
|
||||
@SerializedName("reject_reason")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 驳回原因详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class AuditDetail {
|
||||
/**
|
||||
* 字段名
|
||||
*/
|
||||
@SerializedName("field")
|
||||
private String field;
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
@SerializedName("field_name")
|
||||
private String fieldName;
|
||||
/**
|
||||
* 驳回原因
|
||||
*/
|
||||
@SerializedName("reject_reason")
|
||||
private String rejectReason;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.github.binarywang.wxpay.v3.SpecEncrypt;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 修改结算账户请求对象
|
||||
*/
|
||||
@ -17,7 +19,8 @@ import com.github.binarywang.wxpay.v3.SpecEncrypt;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class ModifySettlementRequest {
|
||||
public class ModifySettlementRequest implements Serializable {
|
||||
private static final long serialVersionUID = 4568552340365230872L;
|
||||
/**
|
||||
*账户类型
|
||||
*/
|
||||
|
@ -7,6 +7,8 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 查询结算账户返回对象信息
|
||||
*/
|
||||
@ -15,9 +17,9 @@ import lombok.experimental.Accessors;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class SettlementInfoResult {
|
||||
|
||||
/**
|
||||
public class SettlementInfoResult implements Serializable {
|
||||
private static final long serialVersionUID = 4568552340365230872L;
|
||||
/**
|
||||
* 账户类型
|
||||
*/
|
||||
@SerializedName("account_type")
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class ApplymentsResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4549193755252593150L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:微信支付申请单号
|
||||
|
@ -144,7 +144,8 @@ public class ApplymentsStatusResult implements Serializable {
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class AccountValidation implements Serializable{
|
||||
public static class AccountValidation implements Serializable {
|
||||
private static final long serialVersionUID = 4379880030965808588L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:付款户名
|
||||
@ -275,7 +276,8 @@ public class ApplymentsStatusResult implements Serializable {
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class AuditDetail implements Serializable{
|
||||
public static class AuditDetail implements Serializable {
|
||||
private static final long serialVersionUID = 5446130564359386809L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:参数名称
|
||||
|
@ -10,18 +10,16 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
* @author zhouyongshen
|
||||
*/
|
||||
public interface Applyment4SubService {
|
||||
/**
|
||||
* 提交申请单API
|
||||
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/tool/applyment4sub/chapter3_1.shtml
|
||||
* 接口链接:https://api.mch.weixin.qq.com/v3/applyment4sub/applyment/
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @return WxPayApplymentCreateResult 响应结果
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
WxPayApplymentCreateResult createApply(WxPayApplyment4SubCreateRequest request) throws WxPayException;
|
||||
|
||||
|
||||
/**
|
||||
* 提交申请单API
|
||||
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/tool/applyment4sub/chapter3_1.shtml
|
||||
* 接口链接:https://api.mch.weixin.qq.com/v3/applyment4sub/applyment/
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @return WxPayApplymentCreateResult 响应结果
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
WxPayApplymentCreateResult createApply(WxPayApplyment4SubCreateRequest request) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 通过业务申请编号查询申请状态
|
||||
@ -29,11 +27,13 @@ public interface Applyment4SubService {
|
||||
* 接口链接:https://api.mch.weixin.qq.com/v3/applyment4sub/applyment/business_code/{business_code}
|
||||
*
|
||||
* @param businessCode 业务申请编号
|
||||
* 1、只能由数字、字母或下划线组成,建议前缀为服务商商户号。
|
||||
* 2、服务商自定义的唯一编号。
|
||||
* 3、每个编号对应一个申请单,每个申请单审核通过后生成一个微信支付商户号。
|
||||
* 4、若申请单被驳回,可填写相同的“业务申请编号”,即可覆盖修改原申请单信息。
|
||||
* 示例值:1900013511_10000
|
||||
* 1、只能由数字、字母或下划线组成,建议前缀为服务商商户号。
|
||||
* 2、服务商自定义的唯一编号。
|
||||
* 3、每个编号对应一个申请单,每个申请单审核通过后生成一个微信支付商户号。
|
||||
* 4、若申请单被驳回,可填写相同的“业务申请编号”,即可覆盖修改原申请单信息。
|
||||
* 示例值:1900013511_10000
|
||||
* @return the applyment state query result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
ApplymentStateQueryResult queryApplyStatusByBusinessCode(String businessCode) throws WxPayException;
|
||||
|
||||
@ -43,6 +43,8 @@ public interface Applyment4SubService {
|
||||
* 接口链接:https://api.mch.weixin.qq.com/v3/applyment4sub/applyment/applyment_id/{applyment_id}
|
||||
*
|
||||
* @param applymentId 微信支付分的申请单号。示例值:2000001234567890
|
||||
* @return the applyment state query result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
ApplymentStateQueryResult queryApplyStatusByApplymentId(String applymentId) throws WxPayException;
|
||||
|
||||
@ -52,6 +54,8 @@ public interface Applyment4SubService {
|
||||
* 接口链接:https://api.mch.weixin.qq.com/v3/apply4sub/sub_merchants/{sub_mchid}/settlement
|
||||
*
|
||||
* @param subMchid 本服务商进件、已签约的特约商户号。
|
||||
* @return the settlement info result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
SettlementInfoResult querySettlementBySubMchid(String subMchid) throws WxPayException;
|
||||
|
||||
@ -59,9 +63,11 @@ public interface Applyment4SubService {
|
||||
* 修改结算帐号
|
||||
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/tool/applyment4sub/chapter3_3.shtml
|
||||
* 接口链接:https://api.mch.weixin.qq.com/v3/apply4sub/sub_merchants/{sub_mchid}/modify-settlement
|
||||
*
|
||||
* @param subMchid 特约商户号
|
||||
* @param request 修改结算账户请求对象信息
|
||||
* @param request 修改结算账户请求对象信息
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
void modifySettlement(String subMchid,ModifySettlementRequest request) throws WxPayException;
|
||||
void modifySettlement(String subMchid, ModifySettlementRequest request) throws WxPayException;
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,8 @@ public interface EcommerceService {
|
||||
* </pre>
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @return .
|
||||
* @return . applyments result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
ApplymentsResult createApply(ApplymentsRequest request) throws WxPayException;
|
||||
|
||||
@ -36,7 +37,8 @@ public interface EcommerceService {
|
||||
* </pre>
|
||||
*
|
||||
* @param applymentId 申请单ID
|
||||
* @return .
|
||||
* @return . applyments status result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
ApplymentsStatusResult queryApplyStatusByApplymentId(String applymentId) throws WxPayException;
|
||||
|
||||
@ -48,7 +50,8 @@ public interface EcommerceService {
|
||||
* </pre>
|
||||
*
|
||||
* @param outRequestNo 业务申请编号
|
||||
* @return .
|
||||
* @return . applyments status result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
ApplymentsStatusResult queryApplyStatusByOutRequestNo(String outRequestNo) throws WxPayException;
|
||||
|
||||
|
@ -9,21 +9,14 @@ import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.github.binarywang.wxpay.v3.util.RsaCryptoUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class EcommerceServiceImpl implements EcommerceService {
|
||||
|
||||
private static final Gson GSON = new GsonBuilder().create();
|
||||
private WxPayService payService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param payService
|
||||
*/
|
||||
public EcommerceServiceImpl(WxPayService payService) {
|
||||
this.payService = payService;
|
||||
}
|
||||
private final WxPayService payService;
|
||||
|
||||
@Override
|
||||
public ApplymentsResult createApply(ApplymentsRequest request) throws WxPayException {
|
||||
|
@ -128,10 +128,10 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl {
|
||||
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
||||
//v3已经改为通过状态码判断200 204 成功
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
String responseString="{}";
|
||||
String responseString = "{}";
|
||||
HttpEntity entity = response.getEntity();
|
||||
if(entity!=null){
|
||||
responseString= EntityUtils.toString(entity, StandardCharsets.UTF_8);
|
||||
if (entity != null) {
|
||||
responseString = EntityUtils.toString(entity, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) {
|
||||
@ -261,7 +261,7 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl {
|
||||
}
|
||||
|
||||
SSLConnectionSocketFactory connectionSocketFactory = new SSLConnectionSocketFactory(sslContext,
|
||||
new DefaultHostnameVerifier());
|
||||
new DefaultHostnameVerifier());
|
||||
httpClientBuilder.setSSLSocketFactory(connectionSocketFactory);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user