mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-24 18:04:38 +08:00
修复模板消息的MsgID的问题 #165
This commit is contained in:
parent
612beb2c10
commit
3d3ab2b5a9
@ -49,7 +49,7 @@ public class XStreamTransformer {
|
||||
* @param clz 类型
|
||||
* @param xStream xml解析器
|
||||
*/
|
||||
public static void register(Class<?> clz, XStream xStream) {
|
||||
private static void register(Class<?> clz, XStream xStream) {
|
||||
CLASS_2_XSTREAM_INSTANCE.put(clz, xStream);
|
||||
}
|
||||
|
||||
@ -57,10 +57,15 @@ public class XStreamTransformer {
|
||||
* 会自动注册该类及其子类
|
||||
* @param clz 要注册的类
|
||||
*/
|
||||
public static void registerClass(Class<?> clz) {
|
||||
private static void registerClass(Class<?> clz) {
|
||||
XStream xstream = XStreamInitializer.getInstance();
|
||||
xstream.processAnnotations(clz);
|
||||
xstream.processAnnotations(getInnerClasses(clz));
|
||||
if(clz.equals(WxMpXmlMessage.class)){
|
||||
// 操蛋的微信,模板消息推送成功的消息是MsgID,其他消息推送过来是MsgId
|
||||
xstream.aliasField("MsgID", WxMpXmlMessage.class, "msgId");
|
||||
}
|
||||
|
||||
register(clz, xstream);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user