mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-20 00:44:25 +08:00
feat(miniapp): 增加小程序基本信息通知事件
- 添加小程序基本信息通知事件相关的字段和解析逻辑 - 新增 ret、first、second、reason、weAppReason、nickname 和 context 字段 - 修改 fromEncryptedXml 方法,将解密后的原始通知内容保存到 context 字段
This commit is contained in:
parent
62f89987c0
commit
ad6da0c426
@ -212,6 +212,51 @@ public class WxMaMessage implements Serializable {
|
|||||||
@XStreamAlias("SubscribeMsgSentEvent")
|
@XStreamAlias("SubscribeMsgSentEvent")
|
||||||
private WxMaSubscribeMsgEvent.SubscribeMsgSentEvent subscribeMsgSentEvent;
|
private WxMaSubscribeMsgEvent.SubscribeMsgSentEvent subscribeMsgSentEvent;
|
||||||
|
|
||||||
|
// 小程序基本信息
|
||||||
|
|
||||||
|
//region 小程序基本信息 infoType=notify_3rd_wxa_auth_and_icp
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回值
|
||||||
|
*/
|
||||||
|
@XStreamAlias("ret")
|
||||||
|
private String ret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一级类目id
|
||||||
|
*/
|
||||||
|
@XStreamAlias("first")
|
||||||
|
private String first;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二级类目id
|
||||||
|
*/
|
||||||
|
@XStreamAlias("second")
|
||||||
|
private String second;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回原因
|
||||||
|
*/
|
||||||
|
@XStreamAlias("reason")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序代码审核驳回原因
|
||||||
|
*/
|
||||||
|
@XStreamAlias("Reason")
|
||||||
|
private String weAppReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
@XStreamAlias("nickname")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原始通知内容
|
||||||
|
*/
|
||||||
|
private String context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不要直接使用这个字段,
|
* 不要直接使用这个字段,
|
||||||
* 这个字段只是为了适配 SubscribeMsgPopupEvent SubscribeMsgChangeEvent SubscribeMsgSentEvent
|
* 这个字段只是为了适配 SubscribeMsgPopupEvent SubscribeMsgChangeEvent SubscribeMsgSentEvent
|
||||||
@ -261,7 +306,9 @@ public class WxMaMessage implements Serializable {
|
|||||||
WxMaConfig wxMaConfig, String timestamp, String nonce,
|
WxMaConfig wxMaConfig, String timestamp, String nonce,
|
||||||
String msgSignature) {
|
String msgSignature) {
|
||||||
String plainText = new WxMaCryptUtils(wxMaConfig).decryptXml(msgSignature, timestamp, nonce, encryptedXml);
|
String plainText = new WxMaCryptUtils(wxMaConfig).decryptXml(msgSignature, timestamp, nonce, encryptedXml);
|
||||||
return fromXml(plainText);
|
WxMaMessage wxMaMessage = fromXml(plainText);
|
||||||
|
wxMaMessage.setContext(plainText);
|
||||||
|
return wxMaMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WxMaMessage fromEncryptedXml(InputStream is, WxMaConfig wxMaConfig, String timestamp,
|
public static WxMaMessage fromEncryptedXml(InputStream is, WxMaConfig wxMaConfig, String timestamp,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user