mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
将模板消息相关接口代码移到单独的service,并作相应重构调整,增加单元测试 for issue #63
This commit is contained in:
@@ -1,19 +1,11 @@
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
|
||||
import com.google.gson.*;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.Industry;
|
||||
import me.chanjar.weixin.mp.bean.WxMpIndustry;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* @author miller
|
||||
*/
|
||||
@@ -42,8 +34,8 @@ public class WxMpIndustryGsonAdapter
|
||||
return wxMpIndustry;
|
||||
}
|
||||
|
||||
private static Industry convertFromJson(JsonObject json) {
|
||||
Industry industry = new Industry();
|
||||
private static WxMpIndustry.Industry convertFromJson(JsonObject json) {
|
||||
WxMpIndustry.Industry industry = new WxMpIndustry.Industry();
|
||||
industry.setFirstClass(GsonHelper.getString(json, "first_class"));
|
||||
industry.setSecondClass(GsonHelper.getString(json, "second_class"));
|
||||
return industry;
|
||||
|
||||
Reference in New Issue
Block a user