File tree Expand file tree Collapse file tree 6 files changed +43
-23
lines changed
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/config
weixin-java-mp/src/main/java/me/chanjar/weixin/mp Expand file tree Collapse file tree 6 files changed +43
-23
lines changed Original file line number Diff line number Diff line change 9
9
import java .io .File ;
10
10
11
11
/**
12
- * Jedis client implementor for wechat config storage.
13
12
* <pre>
14
- * 使用说明:本实现仅供参考,并不完整,
13
+ * 使用说明:本实现仅供参考,并不完整.
15
14
* 比如为减少项目依赖,未加入redis分布式锁的实现,如有需要请自行实现。
16
15
* </pre>
17
16
*
18
17
* @author gaigeshen
19
18
*/
20
19
public class WxCpJedisConfigStorage implements WxCpConfigStorage {
21
-
22
- /**
23
- * Redis keys here
24
- */
25
20
private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN" ;
26
21
private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME" ;
27
22
private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET" ;
28
23
private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME" ;
29
24
private static final String AGENT_JSAPI_TICKET_KEY = "WX_CP_AGENT_%s_JSAPI_TICKET" ;
30
25
private static final String AGENT_JSAPI_TICKET_EXPIRES_TIME_KEY = "WX_CP_AGENT_%s_JSAPI_TICKET_EXPIRES_TIME" ;
31
- /**
32
- * Redis clients pool
33
- */
26
+
34
27
private final JedisPool jedisPool ;
35
28
private volatile String corpId ;
36
29
private volatile String corpSecret ;
Original file line number Diff line number Diff line change 17
17
* @date 2018-08-30
18
18
*/
19
19
public interface WxMpMemberCardService {
20
- String MEMBER_CARD_CREAET = "https://api.weixin.qq.com/card/create" ;
20
+ String MEMBER_CARD_CREATE = "https://api.weixin.qq.com/card/create" ;
21
21
String MEMBER_CARD_ACTIVATE = "https://api.weixin.qq.com/card/membercard/activate" ;
22
22
String MEMBER_CARD_USER_INFO_GET = "https://api.weixin.qq.com/card/membercard/userinfo/get" ;
23
23
String MEMBER_CARD_UPDATE_USER = "https://api.weixin.qq.com/card/membercard/updateuser" ;
24
24
/**
25
25
* 会员卡激活之微信开卡接口(wx_activate=true情况调用).
26
26
*/
27
- String MEMBER_CARD_ACTIVATEUSERFORM = "https://api.weixin.qq.com/card/membercard/activateuserform/set" ;
27
+ String MEMBER_CARD_ACTIVATE_USER_FORM = "https://api.weixin.qq.com/card/membercard/activateuserform/set" ;
28
28
29
29
/**
30
30
* 获取会员卡开卡插件参数.
@@ -37,7 +37,8 @@ public interface WxMpMemberCardService {
37
37
String MEMBER_CARD_UPDATE = "https://api.weixin.qq.com/card/update" ;
38
38
39
39
/**
40
- * 跳转型会员卡开卡字段,获取用户提交资料(wx_activate=true情况调用),开发者根据activate_ticket获取到用户填写的信息
40
+ * 跳转型会员卡开卡字段.
41
+ * 获取用户提交资料(wx_activate=true情况调用),开发者根据activate_ticket获取到用户填写的信息
41
42
*/
42
43
String MEMBER_CARD_ACTIVATE_TEMP_INFO = "https://api.weixin.qq.com/card/membercard/activatetempinfo/get" ;
43
44
@@ -127,7 +128,7 @@ public interface WxMpMemberCardService {
127
128
CardUpdateResult updateCardInfo (MemberCardUpdateRequest memberCardUpdateRequest ) throws WxErrorException ;
128
129
129
130
/**
130
- * 解析跳转型开卡字段用户提交的资料
131
+ * 解析跳转型开卡字段用户提交的资料.
131
132
* 开发者在URL上截取ticket后须先进行urldecode
132
133
*
133
134
* @param activateTicket 用户提交的资料
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public WxMpCardCreateResult createMemberCard(WxMpMemberCardCreateMessage createM
70
70
return validResult ;
71
71
}
72
72
73
- String response = this .wxMpService .post (MEMBER_CARD_CREAET , GSON .toJson (createMessageMessage ));
73
+ String response = this .wxMpService .post (MEMBER_CARD_CREATE , GSON .toJson (createMessageMessage ));
74
74
return WxMpCardCreateResult .fromJson (response );
75
75
}
76
76
@@ -243,7 +243,7 @@ public WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessa
243
243
244
244
@ Override
245
245
public MemberCardActivateUserFormResult setActivateUserForm (MemberCardActivateUserFormRequest userFormRequest ) throws WxErrorException {
246
- String responseContent = this .getWxMpService ().post (MEMBER_CARD_ACTIVATEUSERFORM , GSON .toJson (userFormRequest ));
246
+ String responseContent = this .getWxMpService ().post (MEMBER_CARD_ACTIVATE_USER_FORM , GSON .toJson (userFormRequest ));
247
247
return MemberCardActivateUserFormResult .fromJson (responseContent );
248
248
}
249
249
Original file line number Diff line number Diff line change @@ -38,12 +38,6 @@ public final class MemberCard implements Serializable {
38
38
@ SerializedName ("auto_activate" )
39
39
private boolean autoActivate ;
40
40
41
- /**
42
- * 是否一键开卡.
43
- */
44
- @ SerializedName ("wx_activate" )
45
- private boolean wxActivate ;
46
-
47
41
/**
48
42
* 显示积分.
49
43
*/
@@ -145,6 +139,24 @@ public final class MemberCard implements Serializable {
145
139
@ SerializedName ("advanced_info" )
146
140
private AdvancedInfo advancedInfo ;
147
141
142
+ /**
143
+ * 是否支持一键激活 ,填true或false.
144
+ */
145
+ @ SerializedName ("wx_activate" )
146
+ private boolean wxActivate ;
147
+
148
+ /**
149
+ * 是否支持跳转型一键激活,填true或false.
150
+ */
151
+ @ SerializedName ("wx_activate_after_submit" )
152
+ private boolean wxActivateAfterSubmit ;
153
+
154
+ /**
155
+ * 跳转型一键激活跳转的地址链接,请填写http:// 或者https://开头的链接.
156
+ */
157
+ @ SerializedName ("wx_activate_after_submit_url" )
158
+ private String wxActivateAfterSubmitUrl ;
159
+
148
160
@ Override
149
161
public String toString () {
150
162
return WxMpGsonBuilder .create ().toJson (this );
Original file line number Diff line number Diff line change 1
1
package me .chanjar .weixin .mp .bean .card ;
2
2
3
- import java .io .Serializable ;
4
-
5
3
import com .google .gson .annotations .SerializedName ;
6
4
import lombok .Data ;
7
5
import me .chanjar .weixin .mp .util .json .WxMpGsonBuilder ;
8
6
7
+ import java .io .Serializable ;
8
+
9
+ /**
10
+ * 创建会员卡请求对象.
11
+ *
12
+ * @author yuanqixun
13
+ */
9
14
@ Data
10
15
public class MemberCardCreateRequest implements Serializable {
16
+ private static final long serialVersionUID = -1044836608401698097L ;
17
+
11
18
@ SerializedName ("card_type" )
12
19
private String cardType = "MEMBER_CARD" ;
13
20
Original file line number Diff line number Diff line change 6
6
7
7
import java .io .Serializable ;
8
8
9
+ /**
10
+ * 更新会员卡请求对象.
11
+ *
12
+ * @author yuanqixun
13
+ */
9
14
@ Data
10
15
public class MemberCardUpdateRequest implements Serializable {
16
+ private static final long serialVersionUID = -1025759626161614466L ;
17
+
11
18
@ SerializedName ("card_id" )
12
19
private String cardId ;
13
20
You can’t perform that action at this time.
0 commit comments