#136 修复WxMenuRule反序列化的问题tag_id为空的问题

This commit is contained in:
Binary Wang
2017-09-11 11:05:29 +08:00
parent 7c3f6cc907
commit 3875635a8a
3 changed files with 17 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package me.chanjar.weixin.common.bean.menu;
import com.google.gson.annotations.SerializedName;
import me.chanjar.weixin.common.util.ToStringUtils;
import java.io.Serializable;
@@ -7,6 +8,10 @@ import java.io.Serializable;
public class WxMenuRule implements Serializable {
private static final long serialVersionUID = -4587181819499286670L;
/**
* 变态的微信接口,反序列化时这里反人类的使用和序列化时不一样的名字
*/
@SerializedName(value = "tag_id", alternate = "group_id")
private String tagId;
private String sex;
private String country;

View File

@@ -70,6 +70,7 @@ public class WxMenuGsonAdapter implements JsonSerializer<WxMenu>, JsonDeserializ
return matchRule;
}
@Deprecated
private WxMenuRule convertToRule(JsonObject json) {
WxMenuRule menuRule = new WxMenuRule();
//变态的微信接口,这里居然反人类的使用和序列化时不一样的名字