mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
issue #123 WxCpServiceImpl#tagGet 返回数据中没有tagname
This commit is contained in:
@@ -19,17 +19,17 @@ import java.lang.reflect.Type;
|
||||
*/
|
||||
public class WxCpTagGsonAdapter implements JsonSerializer<WxCpTag>, JsonDeserializer<WxCpTag> {
|
||||
|
||||
public JsonElement serialize(WxCpTag group, Type typeOfSrc, JsonSerializationContext context) {
|
||||
public JsonElement serialize(WxCpTag tag, Type typeOfSrc, JsonSerializationContext context) {
|
||||
JsonObject o = new JsonObject();
|
||||
o.addProperty("tagid", group.getId());
|
||||
o.addProperty("tagname", group.getName());
|
||||
o.addProperty("tagid", tag.getId());
|
||||
o.addProperty("tagname", tag.getName());
|
||||
return o;
|
||||
}
|
||||
|
||||
public WxCpTag deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
|
||||
throws JsonParseException {
|
||||
JsonObject jsonObject = json.getAsJsonObject();
|
||||
return new WxCpTag(GsonHelper.getString(jsonObject, "tagid"), GsonHelper.getString(jsonObject, "name"));
|
||||
return new WxCpTag(GsonHelper.getString(jsonObject, "tagid"), GsonHelper.getString(jsonObject, "tagname"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user