Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ sonar-project.properties
.factorypath
*.zip
.worktrees

# Local Superpowers working documents; do not commit.
/docs/superpowers/
5 changes: 5 additions & 0 deletions weixin-java-channel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,76 @@ WxChannelBaseResponse addComplaintEvidence(String complaintId, String content, L
* @throws WxErrorException 异常
*/
WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException;

/**
* 获取保障单列表。
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_searchguaranteeorder
*
* @param param 查询参数
* @return 保障单列表
* @throws WxErrorException 异常
*/
default GuaranteeOrderListResponse listGuaranteeOrder(GuaranteeOrderListParam param) throws WxErrorException {
throw new UnsupportedOperationException();
}

/**
* 获取保障单详情。
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_getguaranteeorder
*
* @param guaranteeOrderId 保障单号
* @return 保障单详情
* @throws WxErrorException 异常
*/
default GuaranteeOrderInfoResponse getGuaranteeOrder(String guaranteeOrderId) throws WxErrorException {
throw new UnsupportedOperationException();
}

/**
* 同意保障单申请。
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantacceptguarantee
*
* @param guaranteeOrderId 保障单号
* @return 响应结果
* @throws WxErrorException 异常
*/
default WxChannelBaseResponse acceptGuarantee(String guaranteeOrderId) throws WxErrorException {
throw new UnsupportedOperationException();
}

/**
* 商家协商保障单。
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantmodifyguarantee
*
* @param request 协商参数
* @return 响应结果
* @throws WxErrorException 异常
*/
default WxChannelBaseResponse modifyGuarantee(GuaranteeModifyRequest request) throws WxErrorException {
throw new UnsupportedOperationException();
}

/**
* 商家举证保障单。
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantproofguarantee
*
* @param request 举证参数
* @return 响应结果
* @throws WxErrorException 异常
*/
default WxChannelBaseResponse proofGuarantee(GuaranteeProofRequest request) throws WxErrorException {
throw new UnsupportedOperationException();
}

/**
* 拒绝保障单申请。
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantrefuseguarantee
*
* @param request 拒绝参数
* @return 响应结果
* @throws WxErrorException 异常
*/
default WxChannelBaseResponse refuseGuarantee(GuaranteeRefuseRequest request) throws WxErrorException {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,42 @@ public WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdatePara
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public GuaranteeOrderListResponse listGuaranteeOrder(GuaranteeOrderListParam param) throws WxErrorException {
String resJson = shopService.post(GUARANTEE_ORDER_LIST_URL, param);
return ResponseUtils.decode(resJson, GuaranteeOrderListResponse.class);
}

@Override
public GuaranteeOrderInfoResponse getGuaranteeOrder(String guaranteeOrderId) throws WxErrorException {
GuaranteeOrderIdParam param = new GuaranteeOrderIdParam(guaranteeOrderId);
String resJson = shopService.post(GUARANTEE_ORDER_GET_URL, param);
return ResponseUtils.decode(resJson, GuaranteeOrderInfoResponse.class);
}

@Override
public WxChannelBaseResponse acceptGuarantee(String guaranteeOrderId) throws WxErrorException {
GuaranteeOrderIdParam param = new GuaranteeOrderIdParam(guaranteeOrderId);
String resJson = shopService.post(GUARANTEE_ORDER_ACCEPT_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public WxChannelBaseResponse modifyGuarantee(GuaranteeModifyRequest request) throws WxErrorException {
String resJson = shopService.post(GUARANTEE_ORDER_MODIFY_URL, request);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public WxChannelBaseResponse proofGuarantee(GuaranteeProofRequest request) throws WxErrorException {
String resJson = shopService.post(GUARANTEE_ORDER_PROOF_URL, request);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

@Override
public WxChannelBaseResponse refuseGuarantee(GuaranteeRefuseRequest request) throws WxErrorException {
String resJson = shopService.post(GUARANTEE_ORDER_REFUSE_URL, request);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package me.chanjar.weixin.channel.bean.after;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
* 商家协商保障单请求参数。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonInclude(Include.NON_NULL)
public class GuaranteeModifyRequest extends GuaranteeOrderIdParam {

private static final long serialVersionUID = 4268864541609439068L;

/** 商品破损程度。 */
@JsonProperty("bad_level")
private Integer badLevel;

/** 商家协商备注。 */
@JsonProperty("merchant_remark")
private String merchantRemark;

public GuaranteeModifyRequest(String guaranteeOrderId, Integer badLevel, String merchantRemark) {
super(guaranteeOrderId);
this.badLevel = badLevel;
this.merchantRemark = merchantRemark;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package me.chanjar.weixin.channel.bean.after;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 保障单号参数。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
public class GuaranteeOrderIdParam implements Serializable {

private static final long serialVersionUID = -6638498743123537413L;

/** 保障单号。 */
@JsonProperty("guarantee_order_id")
private String guaranteeOrderId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package me.chanjar.weixin.channel.bean.after;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;

/**
* 保障单详情响应。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class GuaranteeOrderInfoResponse extends WxChannelBaseResponse {

private static final long serialVersionUID = 7354122991247317485L;

/** 保障单详情。 */
@JsonProperty("guarantee_order")
private GuaranteeOrder guaranteeOrder;

/**
* 保障单详情。
*/
@Data
@NoArgsConstructor
public static class GuaranteeOrder implements Serializable {

private static final long serialVersionUID = -2398976447575813507L;

/** 保障单号。 */
@JsonProperty("guarantee_order_id")
private String guaranteeOrderId;

/** 保障单状态。 */
@JsonProperty("status")
private String status;

/** 商品信息。 */
@JsonProperty("product_info")
private ProductInfo productInfo;
}

/**
* 详情商品信息。
*/
@Data
@NoArgsConstructor
public static class ProductInfo implements Serializable {

private static final long serialVersionUID = -2455740986246085934L;

/** 商品 SPU ID。 */
@JsonProperty("product_id")
private String productId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package me.chanjar.weixin.channel.bean.after;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 保障单列表请求参数。
*/
@Data
@NoArgsConstructor
@JsonInclude(Include.NON_NULL)
public class GuaranteeOrderListParam implements Serializable {

private static final long serialVersionUID = 1622570776364341988L;

@JsonProperty("guarantee_order_id_list")
private List<String> guaranteeOrderIdList;

@JsonProperty("order_id_list")
private List<String> orderIdList;

@JsonProperty("type")
private Integer type;

@JsonProperty("begin_time")
private Long beginTime;

@JsonProperty("end_time")
private Long endTime;

@JsonProperty("status_list")
private String statusList;

@JsonProperty("offset")
private Integer offset;

@JsonProperty("limit")
private Integer limit;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package me.chanjar.weixin.channel.bean.after;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;

/**
* 保障单列表响应。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class GuaranteeOrderListResponse extends WxChannelBaseResponse {

private static final long serialVersionUID = 9105476087203713187L;

/** 保障单总数。 */
@JsonProperty("total_num")
private Integer totalNum;

/** 保障单列表。 */
@JsonProperty("guarantee_order_list")
private List<GuaranteeOrder> guaranteeOrderList;
Comment thread
binarywang marked this conversation as resolved.

/**
* 保障单列表项。
*/
@Data
@NoArgsConstructor
public static class GuaranteeOrder implements Serializable {

private static final long serialVersionUID = 7151952524213202281L;

/** 保障单号。 */
@JsonProperty("guarantee_order_id")
private String guaranteeOrderId;

/** 保障单状态。 */
@JsonProperty("status")
private String status;

/** 商品信息列表。 */
@JsonProperty("product_info")
private List<ProductInfo> productInfo;
}

/**
* 列表商品信息。
*/
@Data
@NoArgsConstructor
public static class ProductInfo implements Serializable {

private static final long serialVersionUID = -2565763879505631638L;

/** 商品 SPU ID。 */
@JsonProperty("product_id")
private String productId;
}
}
Loading