Skip to content

Commit c84b46a

Browse files
authored
🎨 #2777【企业微信】 增加直播回调事件常量支持
1 parent fe49e5a commit c84b46a

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ public static class EventType {
154154
*/
155155
public static final String MSGAUDIT_NOTIFY = "msgaudit_notify";
156156

157+
/**
158+
* 直播回调事件
159+
*/
160+
public static final String LIVING_STATUS_CHANGE = "living_status_change";
161+
157162
}
158163

159164
/**

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpLivingTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import me.chanjar.weixin.cp.bean.living.*;
99
import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
1010
import me.chanjar.weixin.cp.config.WxCpConfigStorage;
11+
import me.chanjar.weixin.cp.constant.WxCpConsts;
1112
import me.chanjar.weixin.cp.demo.WxCpDemoInMemoryConfigStorage;
1213
import me.chanjar.weixin.cp.util.xml.XStreamTransformer;
1314
import org.eclipse.jetty.util.ajax.JSON;
@@ -64,6 +65,12 @@ public void test() throws WxErrorException {
6465
livingXmlMsg.setAllFieldsMap(XmlUtils.xml2Map(livingXml));
6566
log.info("livingXmlMsg:{}", JSON.toString(livingXmlMsg));
6667

68+
/**
69+
* 直播回调事件常量
70+
* https://developer.work.weixin.qq.com/document/path/94145
71+
*/
72+
String livingStatusChange = WxCpConsts.EventType.LIVING_STATUS_CHANGE;
73+
6774

6875
/**
6976
* 测试创建直播

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMsgAuditTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void test() throws Exception {
104104
* <aesKey></aesKey> // 回调配置的EncodingAESKey
105105
*
106106
* // 企业微信会话存档
107-
* // 1、会话存档私钥,一定要加上前缀!
107+
* // 1、会话存档私钥,最好去除前缀和换行,如下所示
108108
* // 2、仔细配置windows以及linux环境sdk路径
109109
* <msgAuditPriKey>MIxxx893B2pggd1r95T8k2QxxxxbD6xxxxmXsskn+5XunyR1WJlJGqgi0OMVGYvSfkNb9kD50fM21CGLcN1y4miL9fVNBIsvJmIUeJCNS8TioAVGFvh2EgzjqTR1gH</msgAuditPriKey>
110110
* <msgAuditLibPath>/www/osfile/libcrypto-1_1-x64.dll,libssl-1_1-x64.dll,libcurl-x64.dll,WeWorkFinanceSdk.dll,libWeWorkFinanceSdk_Java.so</msgAuditLibPath>
@@ -131,6 +131,17 @@ public void test() throws Exception {
131131
* secret: xIpum7Yt4NMXcyxdzcQ2l_46BG4Qxxxxxxxxxxx
132132
* token:
133133
* aesKey:
134+
* msgAuditPriKey: MIxxx893B2pggd1r95T8k2QxxxxbD6xxxxmXsskn+5XunyR1WJlJGqgi0OMVGYvSfkNb9kD50fM21CGLcN1y4miL9fVNBIsvJmIUeJCNS8TioAVGFvh2EgzjqTR1gHxxx
135+
* msgAuditLibPath: /www/osfile/libcrypto-1_1-x64.dll,libssl-1_1-x64.dll,libcurl-x64.dll,WeWorkFinanceSdk.dll,libWeWorkFinanceSdk_Java.so
136+
*
137+
*
138+
* 在线生成非对称加密公钥私钥对:
139+
* http://web.chacuo.net/netrsakeypair
140+
*
141+
*
142+
* 或者可以在linux上使用如下命令生成公钥私钥对:
143+
* openssl genrsa -out private_key.pem 2048
144+
* openssl rsa -in private_key.pem -pubout -out public_key.pem
134145
* /
135146
136147
/**
@@ -262,7 +273,7 @@ public void test() throws Exception {
262273
}
263274
}
264275
// 注意:
265-
// 当此批次数据拉取完毕后,可以释放此次sdk
276+
// 当此批次数据拉取完毕后,应释放此次sdk
266277
log.info("释放sdk {}", chatDatas.getSdk());
267278
Finance.DestroySdk(chatDatas.getSdk());
268279

0 commit comments

Comments
 (0)