issue #123 WxCpServiceImpl#tagGet 返回数据中没有tagname
This commit is contained in:
@@ -7,6 +7,7 @@ import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.internal.Streams;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.sun.media.sound.SoftTuning;
|
||||
import me.chanjar.weixin.common.bean.WxAccessToken;
|
||||
import me.chanjar.weixin.common.bean.WxJsapiSignature;
|
||||
import me.chanjar.weixin.common.bean.WxMenu;
|
||||
@@ -46,6 +47,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -626,4 +628,12 @@ public class WxCpServiceImpl implements WxCpService {
|
||||
this.sessionManager = sessionManager;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Float a = 3.1f;
|
||||
System.out.println(3.1d);
|
||||
System.out.println(new BigDecimal(3.1d));
|
||||
System.out.println(new BigDecimal(a));
|
||||
System.out.println(a.toString());
|
||||
System.out.println(a.doubleValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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