Skip to content

Commit 220e38d

Browse files
authored
🆕 #2615 【企业微信】增加应用市场付费订单和版本相关的接口
1 parent 6b93962 commit 220e38d

15 files changed

+831
-3
lines changed

Diff for: weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAuthInfo.java

+12
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,17 @@ public static class Agent implements Serializable {
244244
@SerializedName("expired_time")
245245
private Long expiredTime;
246246

247+
/**
248+
* 是否虚拟版本
249+
*/
250+
@SerializedName("is_virtual_version")
251+
private Boolean isVirtualVersion;
252+
253+
/**
254+
* 是否由互联企业分享安装。详见 <a href='https://developer.work.weixin.qq.com/document/path/93360#24909'>企业互联</a>
255+
*/
256+
@SerializedName("is_shared_from_other_corp")
257+
private Boolean isSharedFromOtherCorp;
247258
}
248259

249260
/**
@@ -290,6 +301,7 @@ public static WxCpTpAuthInfo fromJson(String json) {
290301
return WxCpGsonBuilder.create().fromJson(json, WxCpTpAuthInfo.class);
291302
}
292303

304+
@Override
293305
public String toJson() {
294306
return WxCpGsonBuilder.create().toJson(this);
295307
}

Diff for: weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPermanentCodeInfo.java

+14
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,19 @@ public static class Agent implements Serializable {
240240
*/
241241
@SerializedName("expired_time")
242242
private Long expiredTime;
243+
244+
/**
245+
* 是否虚拟版本
246+
*/
247+
@SerializedName("is_virtual_version")
248+
private Boolean isVirtualVersion;
249+
250+
/**
251+
* 是否由互联企业分享安装。详见 <a href='https://developer.work.weixin.qq.com/document/path/93360#24909'>企业互联</a>
252+
*/
253+
@SerializedName("is_shared_from_other_corp")
254+
private Boolean isSharedFromOtherCorp;
255+
243256
}
244257

245258
/**
@@ -304,6 +317,7 @@ public static WxCpTpPermanentCodeInfo fromJson(String json) {
304317
return WxCpGsonBuilder.create().fromJson(json, WxCpTpPermanentCodeInfo.class);
305318
}
306319

320+
@Override
307321
public String toJson() {
308322
return WxCpGsonBuilder.create().toJson(this);
309323
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package me.chanjar.weixin.cp.bean;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Getter;
5+
import lombok.Setter;
6+
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
7+
8+
/**
9+
* 应用市场延长试用期结果
10+
* @author leiguoqing
11+
* @date 2022年4月24日
12+
*/
13+
@Getter
14+
@Setter
15+
public class WxCpTpProlongTryResult extends WxCpBaseResp {
16+
17+
/**
18+
* The constant serialVersionUID.
19+
*/
20+
private static final long serialVersionUID = -5028321625140879571L;
21+
22+
/**
23+
* 延长后的试用到期时间(秒级时间戳)
24+
*/
25+
@SerializedName("try_end_time")
26+
private Long tryEndTime;
27+
28+
29+
/**
30+
* From json wx cp tp order list get result.
31+
*
32+
* @param json the json
33+
* @return the wx cp tp order list get result
34+
*/
35+
public static WxCpTpProlongTryResult fromJson(String json) {
36+
return WxCpGsonBuilder.create().fromJson(json, WxCpTpProlongTryResult.class);
37+
}
38+
39+
/**
40+
* To json string.
41+
*
42+
* @return the string
43+
*/
44+
@Override
45+
public String toJson() {
46+
return WxCpGsonBuilder.create().toJson(this);
47+
}
48+
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
package me.chanjar.weixin.cp.bean.order;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Getter;
5+
import lombok.Setter;
6+
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
7+
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
8+
9+
/**
10+
* 应用版本付费订单详情
11+
*
12+
* @author leiguoqing
13+
* @date 2022年4月24日
14+
*/
15+
@Getter
16+
@Setter
17+
public class WxCpTpOrderDetails extends WxCpBaseResp {
18+
19+
/**
20+
* The constant serialVersionUID.
21+
*/
22+
private static final long serialVersionUID = -5028321625140879571L;
23+
24+
/**
25+
* 订单号
26+
*/
27+
@SerializedName("orderid")
28+
private String orderId;
29+
30+
/**
31+
* 订单状态。0-未支付,1-已支付,2-已关闭, 3-未支付且已过期, 4-申请退款中, 5-申请退款成功, 6-退款被拒绝
32+
*/
33+
@SerializedName("order_status")
34+
private Integer orderStatus;
35+
36+
/**
37+
* 订单类型。0-普通订单,1-扩容订单,2-续期,3-版本变更
38+
*/
39+
@SerializedName("order_type")
40+
private Integer orderType;
41+
42+
/**
43+
* 客户企业的corpid
44+
*/
45+
@SerializedName("paid_corpid")
46+
private String paidCorpId;
47+
48+
/**
49+
* 下单操作人员userid。如果是服务商代下单,没有该字段。
50+
*/
51+
@SerializedName("operator_id")
52+
private String operatorId;
53+
54+
55+
/**
56+
* 应用id
57+
*/
58+
@SerializedName("suiteid")
59+
private String suiteId;
60+
61+
62+
/**
63+
* 应用id。(仅旧套件有该字段)
64+
*/
65+
@SerializedName("appid")
66+
private String appId;
67+
68+
69+
/**
70+
* 购买版本ID
71+
*/
72+
@SerializedName("edition_id")
73+
private String editionId;
74+
75+
76+
/**
77+
* 购买版本名字
78+
*/
79+
@SerializedName("edition_name")
80+
private String editionName;
81+
82+
83+
/**
84+
* 实付款金额,单位分
85+
*/
86+
@SerializedName("price")
87+
private Long price;
88+
89+
90+
/**
91+
* 购买的人数
92+
*/
93+
@SerializedName("user_count")
94+
private Integer userCount;
95+
96+
97+
/**
98+
* 购买的时间,单位天
99+
*/
100+
@SerializedName("order_period")
101+
private Integer orderPeriod;
102+
103+
/**
104+
* 下单时间,秒级时间戳
105+
*/
106+
@SerializedName("order_time")
107+
private Long orderTime;
108+
109+
/**
110+
* 付款时间,秒级时间戳
111+
*/
112+
@SerializedName("paid_time")
113+
private Long paidTime;
114+
115+
116+
/**
117+
* 购买生效期的开始时间,秒级时间戳
118+
*/
119+
@SerializedName("begin_time")
120+
private Long beginTime;
121+
122+
123+
/**
124+
* 购买生效期的结束时间,秒级时间戳
125+
*/
126+
@SerializedName("end_time")
127+
private Long endTime;
128+
129+
/**
130+
* 下单来源。0-客户下单;1-服务商代下单;2-代理商代下单
131+
*/
132+
@SerializedName("order_from")
133+
private Integer orderFrom;
134+
135+
136+
/**
137+
* 下单方corpid
138+
*/
139+
@SerializedName("operator_corpid")
140+
private String operatorCorpId;
141+
142+
/**
143+
* 服务商分成金额,单位分
144+
*/
145+
@SerializedName("service_share_amount")
146+
private Long serviceShareAmount;
147+
148+
149+
/**
150+
* 平台分成金额,单位分
151+
*/
152+
@SerializedName("platform_share_amount")
153+
private Long platformShareAmount;
154+
155+
156+
/**
157+
* 代理商分成金额,单位分
158+
*/
159+
@SerializedName("dealer_share_amount")
160+
private Long dealerShareAmount;
161+
162+
163+
/**
164+
* 渠道商信息(仅当有渠道商报备后才会有此字段)
165+
*/
166+
@SerializedName("dealer_corp_info")
167+
private DealerCorpInfo dealerCorpInfo;
168+
169+
170+
/**
171+
* 渠道商信息(仅当有渠道商报备后才会有此字段)
172+
*/
173+
@Getter
174+
@Setter
175+
public static class DealerCorpInfo {
176+
/**
177+
* 代理商corpid
178+
*/
179+
@SerializedName("corpid")
180+
private String corpId;
181+
182+
183+
/**
184+
* 代理商名
185+
*/
186+
@SerializedName("corp_name")
187+
private String corpName;
188+
}
189+
190+
/**
191+
* From json wx cp tp order details.
192+
*
193+
* @param json the json
194+
* @return the wx cp tp order details
195+
*/
196+
public static WxCpTpOrderDetails fromJson(String json) {
197+
return WxCpGsonBuilder.create().fromJson(json, WxCpTpOrderDetails.class);
198+
}
199+
200+
/**
201+
* To json string.
202+
*
203+
* @return the string
204+
*/
205+
@Override
206+
public String toJson() {
207+
return WxCpGsonBuilder.create().toJson(this);
208+
}
209+
210+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package me.chanjar.weixin.cp.bean.order;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Getter;
5+
import lombok.Setter;
6+
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
7+
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
8+
9+
import java.util.List;
10+
11+
/**
12+
* 应用版本付费订单列表
13+
*
14+
* @author leiguoqing
15+
* @date 2022年4月24日
16+
*/
17+
@Getter
18+
@Setter
19+
public class WxCpTpOrderListGetResult extends WxCpBaseResp {
20+
21+
/**
22+
* The constant serialVersionUID.
23+
*/
24+
private static final long serialVersionUID = -5028321625140879571L;
25+
26+
/**
27+
* 订单列表
28+
*/
29+
@SerializedName("order_list")
30+
private List<WxCpTpOrderDetails> orderList;
31+
32+
33+
/**
34+
* From json wx cp tp order list get result.
35+
*
36+
* @param json the json
37+
* @return the wx cp tp order list get result
38+
*/
39+
public static WxCpTpOrderListGetResult fromJson(String json) {
40+
return WxCpGsonBuilder.create().fromJson(json, WxCpTpOrderListGetResult.class);
41+
}
42+
43+
/**
44+
* To json string.
45+
*
46+
* @return the string
47+
*/
48+
@Override
49+
public String toJson() {
50+
return WxCpGsonBuilder.create().toJson(this);
51+
}
52+
53+
}

Diff for: weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java

+9
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ interface Tp {
204204
String CONTACT_SEARCH = "/cgi-bin/service/contact/search";
205205
String GET_ADMIN_LIST = "/cgi-bin/service/get_admin_list";
206206

207+
// 获取订单详情
208+
String GET_ORDER = "/cgi-bin/service/get_order";
209+
210+
// 获取订单列表
211+
String GET_ORDER_LIST = "/cgi-bin/service/get_order_list";
212+
213+
// 延长试用期
214+
String PROLONG_TRY = "/cgi-bin/service/prolong_try";
215+
207216
}
208217

209218
interface User {

0 commit comments

Comments
 (0)