Skip to content

Commit d993640

Browse files
authored
🎨 #3167 【视频号】视频号小店分享员订单接口增加几个返回参数,并修复openid参数类型
1 parent 9f21f59 commit d993640

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSharerServiceImpl.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Share.SEARCH_SHARER_URL;
88
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Share.UNBIND_SHARER_URL;
99

10+
import com.google.gson.JsonObject;
1011
import java.util.List;
1112
import lombok.extern.slf4j.Slf4j;
1213
import me.chanjar.weixin.channel.api.WxChannelSharerService;
@@ -21,6 +22,7 @@
2122
import me.chanjar.weixin.channel.bean.sharer.SharerUnbindResponse;
2223
import me.chanjar.weixin.channel.util.ResponseUtils;
2324
import me.chanjar.weixin.common.error.WxErrorException;
25+
import me.chanjar.weixin.common.util.json.GsonHelper;
2426

2527
/**
2628
* 视频号小店 分享员服务实现
@@ -39,8 +41,9 @@ public WxChannelSharerServiceImpl(BaseWxChannelServiceImpl shopService) {
3941

4042
@Override
4143
public SharerBindResponse bindSharer(String username) throws WxErrorException {
42-
String reqJson = "{\"username\": " + username + "}";
43-
String resJson = shopService.post(BIND_SHARER_URL, reqJson);
44+
JsonObject jsonObject = GsonHelper.buildJsonObject("username", username);
45+
46+
String resJson = shopService.post(BIND_SHARER_URL, jsonObject);
4447
return ResponseUtils.decode(resJson, SharerBindResponse.class);
4548
}
4649

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/sharer/SharerOrder.java

+38-6
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,56 @@
1515
public class SharerOrder implements Serializable {
1616

1717
private static final long serialVersionUID = 1528673402572025670L;
18-
/** 订单号 */
18+
/**
19+
* 订单号
20+
*/
1921
@JsonProperty("order_id")
2022
private String orderId;
2123

22-
/** 分享场景 {@link me.chanjar.weixin.channel.enums.ShareScene} */
23-
@JsonProperty("sharer_scene")
24+
/**
25+
* 分享场景 {@link me.chanjar.weixin.channel.enums.ShareScene}
26+
*/
27+
@JsonProperty("share_scene")
2428
private Integer sharerScene;
2529

26-
/** 分享员openid */
30+
/**
31+
* 分享员openid
32+
*/
2733
@JsonProperty("sharer_openid")
2834
private String sharerOpenid;
2935

30-
/** 分享员类型 {@link me.chanjar.weixin.channel.enums.SharerType} */
36+
/**
37+
* 分享员类型 {@link me.chanjar.weixin.channel.enums.SharerType}
38+
*/
3139
@JsonProperty("sharer_type")
3240
private Integer sharerType;
3341

34-
/** 视频号场景信息 */
42+
/**
43+
* 商品sku_id
44+
*/
45+
@JsonProperty("sku_id")
46+
private String skuId;
47+
48+
49+
/**
50+
* 商品唯一id
51+
*/
52+
@JsonProperty("product_id")
53+
private String productId;
54+
55+
56+
/**
57+
* 是否从企微分享
58+
*/
59+
@JsonProperty("from_wecom")
60+
private Boolean fromWxWork;
61+
62+
63+
/**
64+
* 视频号场景信息
65+
*/
3566
@JsonProperty("finder_scene_info")
3667
private FinderSceneInfo sceneInfo;
3768

69+
3870
}

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/sharer/SharerOrderParam.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class SharerOrderParam extends PageParam {
2020
private static final long serialVersionUID = 5240085870008898601L;
2121
/** 分享员openid */
2222
@JsonProperty("openid")
23-
private Integer openid;
23+
private String openid;
2424

2525
/** 分享场景 */
2626
@JsonProperty("share_scene")

0 commit comments

Comments
 (0)