将模板消息相关接口代码移到单独的service,并作相应重构调整,增加单元测试 for issue #63

This commit is contained in:
Binary Wang
2016-10-14 19:33:34 +08:00
parent 6682f5ff28
commit 77db3c2dae
9 changed files with 274 additions and 165 deletions

View File

@@ -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;