mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 10:38:42 +08:00 
			
		
		
		
	reformat some code
This commit is contained in:
		| @ -1,16 +1,11 @@ | |||||||
| package me.chanjar.weixin.mp.util.json; | package me.chanjar.weixin.mp.util.json; | ||||||
|  |  | ||||||
| import java.lang.reflect.Type; | import com.google.gson.*; | ||||||
|  |  | ||||||
| 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 me.chanjar.weixin.common.util.json.GsonHelper; | import me.chanjar.weixin.common.util.json.GsonHelper; | ||||||
| import me.chanjar.weixin.mp.bean.WxMpCard; | import me.chanjar.weixin.mp.bean.WxMpCard; | ||||||
|  |  | ||||||
|  | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Created by YuJian on 15/11/11. |  * Created by YuJian on 15/11/11. | ||||||
|  * |  * | ||||||
|  | |||||||
| @ -1,18 +1,13 @@ | |||||||
| package me.chanjar.weixin.mp.util.json; | package me.chanjar.weixin.mp.util.json; | ||||||
|  |  | ||||||
| import java.lang.reflect.Type; | import com.google.gson.*; | ||||||
|  |  | ||||||
| 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.reflect.TypeToken; | import com.google.gson.reflect.TypeToken; | ||||||
|  |  | ||||||
| import me.chanjar.weixin.common.util.json.GsonHelper; | import me.chanjar.weixin.common.util.json.GsonHelper; | ||||||
| import me.chanjar.weixin.mp.bean.WxMpCard; | import me.chanjar.weixin.mp.bean.WxMpCard; | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpCardResult; | import me.chanjar.weixin.mp.bean.result.WxMpCardResult; | ||||||
|  |  | ||||||
|  | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Created by YuJian on 15/11/11. |  * Created by YuJian on 15/11/11. | ||||||
|  * |  * | ||||||
|  | |||||||
| @ -2,33 +2,12 @@ package me.chanjar.weixin.mp.util.json; | |||||||
|  |  | ||||||
| import com.google.gson.Gson; | import com.google.gson.Gson; | ||||||
| import com.google.gson.GsonBuilder; | import com.google.gson.GsonBuilder; | ||||||
|  | import me.chanjar.weixin.mp.bean.*; | ||||||
| import me.chanjar.weixin.mp.bean.WxMpCard; |  | ||||||
| import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage; |  | ||||||
| import me.chanjar.weixin.mp.bean.WxMpMassNews; |  | ||||||
| import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage; |  | ||||||
| import me.chanjar.weixin.mp.bean.WxMpMassPreviewMessage; |  | ||||||
| import me.chanjar.weixin.mp.bean.WxMpMassTagMessage; |  | ||||||
| import me.chanjar.weixin.mp.bean.WxMpMassVideo; |  | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMpMaterialArticleUpdate; |  | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews; |  | ||||||
| import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate; | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate; | ||||||
| import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserSummary; | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserSummary; | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMediaImgUploadResult; | import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage; | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpCardResult; | import me.chanjar.weixin.mp.bean.material.*; | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult; | import me.chanjar.weixin.mp.bean.result.*; | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMpMaterialCountResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMpMaterialFileBatchGetResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMpMaterialNewsBatchGetResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; |  | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket; |  | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpSemanticQueryResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpUser; |  | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpUserBlacklistGetResult; |  | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpUserList; |  | ||||||
| import me.chanjar.weixin.mp.bean.template.WxMpTemplateIndustry; | import me.chanjar.weixin.mp.bean.template.WxMpTemplateIndustry; | ||||||
| import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; | import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; | ||||||
|  |  | ||||||
|  | |||||||
| @ -11,6 +11,13 @@ import java.lang.reflect.Type; | |||||||
|  */ |  */ | ||||||
| public class WxMpIndustryGsonAdapter | public class WxMpIndustryGsonAdapter | ||||||
|   implements JsonSerializer<WxMpTemplateIndustry>, JsonDeserializer<WxMpTemplateIndustry> { |   implements JsonSerializer<WxMpTemplateIndustry>, JsonDeserializer<WxMpTemplateIndustry> { | ||||||
|  |   private static WxMpTemplateIndustry.Industry convertFromJson(JsonObject json) { | ||||||
|  |     WxMpTemplateIndustry.Industry industry = new WxMpTemplateIndustry.Industry(); | ||||||
|  |     industry.setFirstClass(GsonHelper.getString(json, "first_class")); | ||||||
|  |     industry.setSecondClass(GsonHelper.getString(json, "second_class")); | ||||||
|  |     return industry; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   public JsonElement serialize(WxMpTemplateIndustry wxMpIndustry, Type type, |   public JsonElement serialize(WxMpTemplateIndustry wxMpIndustry, Type type, | ||||||
|                                JsonSerializationContext jsonSerializationContext) { |                                JsonSerializationContext jsonSerializationContext) { | ||||||
| @ -33,11 +40,4 @@ public class WxMpIndustryGsonAdapter | |||||||
|     wxMpIndustry.setSecondIndustry(convertFromJson(secondaryIndustry)); |     wxMpIndustry.setSecondIndustry(convertFromJson(secondaryIndustry)); | ||||||
|     return wxMpIndustry; |     return wxMpIndustry; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   private static WxMpTemplateIndustry.Industry convertFromJson(JsonObject json) { |  | ||||||
|     WxMpTemplateIndustry.Industry industry = new WxMpTemplateIndustry.Industry(); |  | ||||||
|     industry.setFirstClass(GsonHelper.getString(json, "first_class")); |  | ||||||
|     industry.setSecondClass(GsonHelper.getString(json, "second_class")); |  | ||||||
|     return industry; |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -15,9 +15,7 @@ import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult; | |||||||
| import java.lang.reflect.Type; | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  *  |  | ||||||
|  * @author Daniel Qian |  * @author Daniel Qian | ||||||
|  * |  | ||||||
|  */ |  */ | ||||||
| public class WxMpMassUploadResultAdapter implements JsonDeserializer<WxMpMassUploadResult> { | public class WxMpMassUploadResultAdapter implements JsonDeserializer<WxMpMassUploadResult> { | ||||||
|  |  | ||||||
|  | |||||||
| @ -17,9 +17,7 @@ import me.chanjar.weixin.mp.bean.WxMpMassVideo; | |||||||
| import java.lang.reflect.Type; | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  *  |  | ||||||
|  * @author Daniel Qian |  * @author Daniel Qian | ||||||
|  * |  | ||||||
|  */ |  */ | ||||||
| public class WxMpMassVideoAdapter implements JsonSerializer<WxMpMassVideo> { | public class WxMpMassVideoAdapter implements JsonSerializer<WxMpMassVideo> { | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,16 +1,11 @@ | |||||||
| package me.chanjar.weixin.mp.util.json; | package me.chanjar.weixin.mp.util.json; | ||||||
|  |  | ||||||
| import java.lang.reflect.Type; | import com.google.gson.*; | ||||||
|  |  | ||||||
| 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 me.chanjar.weixin.common.util.json.GsonHelper; | import me.chanjar.weixin.common.util.json.GsonHelper; | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; | import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; | ||||||
|  |  | ||||||
|  | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| public class WxMpOAuth2AccessTokenAdapter implements JsonDeserializer<WxMpOAuth2AccessToken> { | public class WxMpOAuth2AccessTokenAdapter implements JsonDeserializer<WxMpOAuth2AccessToken> { | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|  | |||||||
| @ -15,9 +15,7 @@ import me.chanjar.weixin.mp.bean.result.WxMpSemanticQueryResult; | |||||||
| import java.lang.reflect.Type; | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  *  |  | ||||||
|  * @author Daniel Qian |  * @author Daniel Qian | ||||||
|  * |  | ||||||
|  */ |  */ | ||||||
| public class WxMpSemanticQueryResultAdapter implements JsonDeserializer<WxMpSemanticQueryResult> { | public class WxMpSemanticQueryResultAdapter implements JsonDeserializer<WxMpSemanticQueryResult> { | ||||||
|  |  | ||||||
|  | |||||||
| @ -12,7 +12,6 @@ import com.google.gson.JsonElement; | |||||||
| import com.google.gson.JsonObject; | import com.google.gson.JsonObject; | ||||||
| import com.google.gson.JsonSerializationContext; | import com.google.gson.JsonSerializationContext; | ||||||
| import com.google.gson.JsonSerializer; | import com.google.gson.JsonSerializer; | ||||||
|  |  | ||||||
| import me.chanjar.weixin.mp.bean.template.WxMpTemplateData; | import me.chanjar.weixin.mp.bean.template.WxMpTemplateData; | ||||||
| import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; | import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; | ||||||
|  |  | ||||||
|  | |||||||
| @ -8,24 +8,16 @@ | |||||||
|  */ |  */ | ||||||
| package me.chanjar.weixin.mp.util.json; | package me.chanjar.weixin.mp.util.json; | ||||||
|  |  | ||||||
|  | import com.google.gson.*; | ||||||
|  | import me.chanjar.weixin.common.util.json.GsonHelper; | ||||||
|  | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate; | ||||||
|  | import org.apache.commons.lang3.time.FastDateFormat; | ||||||
|  |  | ||||||
| import java.lang.reflect.Type; | import java.lang.reflect.Type; | ||||||
| import java.text.ParseException; | import java.text.ParseException; | ||||||
|  |  | ||||||
| import org.apache.commons.lang3.time.FastDateFormat; |  | ||||||
|  |  | ||||||
| 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 me.chanjar.weixin.common.util.json.GsonHelper; |  | ||||||
| import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate; |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  *  |  | ||||||
|  * @author Daniel Qian |  * @author Daniel Qian | ||||||
|  * |  | ||||||
|  */ |  */ | ||||||
| public class WxMpUserCumulateGsonAdapter implements JsonDeserializer<WxDataCubeUserCumulate> { | public class WxMpUserCumulateGsonAdapter implements JsonDeserializer<WxDataCubeUserCumulate> { | ||||||
|  |  | ||||||
|  | |||||||
| @ -8,17 +8,12 @@ | |||||||
|  */ |  */ | ||||||
| package me.chanjar.weixin.mp.util.json; | package me.chanjar.weixin.mp.util.json; | ||||||
|  |  | ||||||
| import java.lang.reflect.Type; | import com.google.gson.*; | ||||||
|  |  | ||||||
| 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 me.chanjar.weixin.common.util.json.GsonHelper; | import me.chanjar.weixin.common.util.json.GsonHelper; | ||||||
| import me.chanjar.weixin.mp.bean.result.WxMpUser; | import me.chanjar.weixin.mp.bean.result.WxMpUser; | ||||||
|  |  | ||||||
|  | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| public class WxMpUserGsonAdapter implements JsonDeserializer<WxMpUser> { | public class WxMpUserGsonAdapter implements JsonDeserializer<WxMpUser> { | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|  | |||||||
| @ -8,19 +8,13 @@ | |||||||
|  */ |  */ | ||||||
| package me.chanjar.weixin.mp.util.json; | package me.chanjar.weixin.mp.util.json; | ||||||
|  |  | ||||||
| import java.lang.reflect.Type; | import com.google.gson.*; | ||||||
| import java.text.ParseException; |  | ||||||
|  |  | ||||||
| import org.apache.commons.lang3.time.FastDateFormat; |  | ||||||
|  |  | ||||||
| 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 me.chanjar.weixin.common.util.json.GsonHelper; | import me.chanjar.weixin.common.util.json.GsonHelper; | ||||||
| import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserSummary; | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserSummary; | ||||||
|  | import org.apache.commons.lang3.time.FastDateFormat; | ||||||
|  |  | ||||||
|  | import java.lang.reflect.Type; | ||||||
|  | import java.text.ParseException; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * @author Daniel Qian |  * @author Daniel Qian | ||||||
|  | |||||||
| @ -15,9 +15,7 @@ import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket; | |||||||
| import java.lang.reflect.Type; | import java.lang.reflect.Type; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  *  |  | ||||||
|  * @author Daniel Qian |  * @author Daniel Qian | ||||||
|  * |  | ||||||
|  */ |  */ | ||||||
| public class WxQrCodeTicketAdapter implements JsonDeserializer<WxMpQrCodeTicket> { | public class WxQrCodeTicketAdapter implements JsonDeserializer<WxMpQrCodeTicket> { | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Binary Wang
					Binary Wang