-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
feat: 补齐视频号售后服务端点 #4103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: 补齐视频号售后服务端点 #4103
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...a-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleCreateResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
| import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class AfterSaleCreateResponse extends WxChannelBaseResponse { | ||
| private static final long serialVersionUID = 2680676438284658410L; | ||
|
|
||
| @JsonProperty("after_sale_order_id") | ||
| private String afterSaleOrderId; | ||
| } |
25 changes: 25 additions & 0 deletions
25
...l/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleGenAfterSaleOrderParam.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.JsonProperty; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class AfterSaleGenAfterSaleOrderParam extends AfterSaleRefundPriceDiffParam { | ||
| private static final long serialVersionUID = -6873909673739068936L; | ||
|
|
||
| @JsonProperty("count") | ||
| private Integer count; | ||
|
|
||
| @JsonProperty("type") | ||
| private String type; | ||
|
|
||
| @JsonProperty("address_id") | ||
| private String addressId; | ||
|
|
||
| @JsonProperty("exchange_sku_info") | ||
| private ExchangeSkuInfo exchangeSkuInfo; | ||
| } |
29 changes: 29 additions & 0 deletions
29
...in/java/me/chanjar/weixin/channel/bean/after/AfterSaleHandleFastExchangeReceiptParam.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.util.List; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class AfterSaleHandleFastExchangeReceiptParam extends AfterSaleIdParam { | ||
| private static final long serialVersionUID = 5430106715116197677L; | ||
|
|
||
| @JsonProperty("act") | ||
| private Integer act; | ||
|
|
||
| @JsonProperty("reject_reason") | ||
| private String rejectReason; | ||
|
|
||
| @JsonProperty("reject_reason_type") | ||
| private Integer rejectReasonType; | ||
|
|
||
| @JsonProperty("merchant_text") | ||
| private String merchantText; | ||
|
|
||
| @JsonProperty("reject_confirm_exchange") | ||
| private List<String> rejectConfirmExchange; | ||
| } |
33 changes: 33 additions & 0 deletions
33
...nel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRefundPriceDiffParam.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.io.Serializable; | ||
| import lombok.Data; | ||
|
|
||
| @Data | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class AfterSaleRefundPriceDiffParam implements Serializable { | ||
| private static final long serialVersionUID = 3875058376021518123L; | ||
|
|
||
| @JsonProperty("request_id") | ||
| private String requestId; | ||
|
|
||
| @JsonProperty("order_id") | ||
| private String orderId; | ||
|
|
||
| @JsonProperty("product_id") | ||
| private String productId; | ||
|
|
||
| @JsonProperty("sku_id") | ||
| private String skuId; | ||
|
|
||
| @JsonProperty("amount") | ||
| private Integer amount; | ||
|
|
||
| @JsonProperty("reason") | ||
| private String reason; | ||
|
|
||
| @JsonProperty("desc") | ||
| private String desc; | ||
| } |
18 changes: 18 additions & 0 deletions
18
...el/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualTelNumResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
| import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class AfterSaleVirtualTelNumResponse extends WxChannelBaseResponse { | ||
| private static final long serialVersionUID = -2715343569103426942L; | ||
|
|
||
| @JsonProperty("virtual_tel_number") | ||
| private String virtualTelNumber; | ||
|
|
||
| @JsonProperty("virtual_tel_expire_time") | ||
| private Long virtualTelExpireTime; | ||
| } |
14 changes: 14 additions & 0 deletions
14
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ExchangeSkuInfo.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.io.Serializable; | ||
| import lombok.Data; | ||
|
|
||
| @Data | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class ExchangeSkuInfo implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
| @JsonProperty("new_sku_id") | ||
| private String newSkuId; | ||
| } |
19 changes: 19 additions & 0 deletions
19
...nnel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantModifyParam.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class GuaranteeMerchantModifyParam extends GuaranteeOrderIdParam { | ||
| private static final long serialVersionUID = 9193536167701367687L; | ||
|
|
||
| @JsonProperty("bad_level") | ||
| private Integer badLevel; | ||
|
|
||
| @JsonProperty("merchant_remark") | ||
| private String merchantRemark; | ||
| } |
19 changes: 19 additions & 0 deletions
19
...annel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantProofParam.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class GuaranteeMerchantProofParam extends GuaranteeOrderIdParam { | ||
| private static final long serialVersionUID = -2365495841866160967L; | ||
|
|
||
| @JsonProperty("content") | ||
| private String content; | ||
|
|
||
| @JsonProperty("pic_list") | ||
| private java.util.List<String> picList; | ||
| } |
16 changes: 16 additions & 0 deletions
16
...va-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.databind.JsonNode; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
| import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class GuaranteeOrderResponse extends WxChannelBaseResponse { | ||
| private static final long serialVersionUID = 3977781489692530604L; | ||
|
|
||
| @JsonProperty("guarantee_order") | ||
| private JsonNode guaranteeOrder; | ||
| } |
79 changes: 79 additions & 0 deletions
79
...n-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/SyncWorkOrderParam.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.io.Serializable; | ||
| import java.util.List; | ||
| import lombok.Data; | ||
|
|
||
| @Data | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class SyncWorkOrderParam implements Serializable { | ||
| private static final long serialVersionUID = -7336088606071452113L; | ||
|
|
||
| @JsonProperty("complaint_id") | ||
| private String complaintId; | ||
|
|
||
| @JsonProperty("work_order_info") | ||
| private WorkOrderInfo workOrderInfo; | ||
|
|
||
| @Data | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public static class WorkOrderInfo implements Serializable { | ||
| private static final long serialVersionUID = 8573016851280130766L; | ||
|
|
||
| @JsonProperty("version") | ||
| private Integer version; | ||
|
|
||
| @JsonProperty("items") | ||
| private List<WorkOrderItem> items; | ||
|
|
||
| @JsonProperty("work_order_id") | ||
| private String workOrderId; | ||
| } | ||
|
|
||
| @Data | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public static class WorkOrderItem implements Serializable { | ||
| private static final long serialVersionUID = 6925580701152256736L; | ||
|
|
||
| @JsonProperty("status") | ||
| private Integer status; | ||
|
|
||
| @JsonProperty("desc") | ||
| private String desc; | ||
|
|
||
| @JsonProperty("update_time") | ||
| private Long updateTime; | ||
|
|
||
| @JsonProperty("result_type") | ||
| private Integer resultType; | ||
|
|
||
| @JsonProperty("refund_amount") | ||
| private Integer refundAmount; | ||
|
|
||
| @JsonProperty("media_list") | ||
| private List<WorkOrderMedia> mediaList; | ||
| } | ||
|
|
||
| @Data | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public static class WorkOrderMedia implements Serializable { | ||
| private static final long serialVersionUID = 2258990333977395631L; | ||
|
|
||
| @JsonProperty("type") | ||
| private Integer type; | ||
|
|
||
| @JsonProperty("picture") | ||
| private WorkOrderPicture picture; | ||
| } | ||
|
|
||
| @Data | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public static class WorkOrderPicture implements Serializable { | ||
| private static final long serialVersionUID = -3339842364541603289L; | ||
|
|
||
| @JsonProperty("tmp_media_id") | ||
| private String tmpMediaId; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ava-channel/src/test/java/me/chanjar/weixin/channel/bean/after/AfterSaleContractTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package me.chanjar.weixin.channel.bean.after; | ||
|
|
||
| import static org.testng.Assert.assertEquals; | ||
| import static org.testng.Assert.assertTrue; | ||
|
|
||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||
| import java.util.Collections; | ||
| import org.testng.annotations.Test; | ||
|
|
||
| public class AfterSaleContractTest { | ||
| private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); | ||
|
|
||
| @Test | ||
| public void shouldUseOfficialAfterSaleAndGuaranteeFieldNames() throws Exception { | ||
| AfterSaleGenAfterSaleOrderParam afterSaleParam = new AfterSaleGenAfterSaleOrderParam(); | ||
| ExchangeSkuInfo exchangeSkuInfo = new ExchangeSkuInfo(); | ||
| exchangeSkuInfo.setNewSkuId("new-sku"); | ||
| afterSaleParam.setExchangeSkuInfo(exchangeSkuInfo); | ||
|
|
||
| AfterSaleHandleFastExchangeReceiptParam receiptParam = new AfterSaleHandleFastExchangeReceiptParam(); | ||
| receiptParam.setRejectConfirmExchange(Collections.singletonList("media-1")); | ||
|
|
||
| GuaranteeOrderIdParam guaranteeParam = new GuaranteeOrderIdParam("guarantee-1"); | ||
| assertTrue(OBJECT_MAPPER.writeValueAsString(afterSaleParam).contains("\"exchange_sku_info\":{\"new_sku_id\":\"new-sku\"}")); | ||
| assertTrue(OBJECT_MAPPER.writeValueAsString(receiptParam).contains("\"reject_confirm_exchange\":[\"media-1\"]")); | ||
| assertTrue(OBJECT_MAPPER.writeValueAsString(guaranteeParam).contains("\"guarantee_order_id\":\"guarantee-1\"")); | ||
| } | ||
|
|
||
| @Test | ||
| public void shouldDecodeOfficialResponseFields() throws Exception { | ||
| AfterSaleCreateResponse createResponse = OBJECT_MAPPER.readValue( | ||
| "{\"errcode\":0,\"after_sale_order_id\":\"after-1\"}", AfterSaleCreateResponse.class); | ||
| GuaranteeOrderResponse guaranteeResponse = OBJECT_MAPPER.readValue( | ||
| "{\"errcode\":0,\"guarantee_order\":{\"guarantee_order_id\":\"guarantee-1\"}}", GuaranteeOrderResponse.class); | ||
|
|
||
| assertEquals(createResponse.getAfterSaleOrderId(), "after-1"); | ||
| assertEquals(guaranteeResponse.getGuaranteeOrder().get("guarantee_order_id").asText(), "guarantee-1"); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.