mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 18:46:10 +08:00 
			
		
		
		
	🎨 优化部分代码
This commit is contained in:
		| @ -7,7 +7,7 @@ import me.chanjar.weixin.cp.bean.oa.doc.*; | |||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 企业微信文档相关接口. |  * 企业微信文档相关接口. | ||||||
|  * https://developer.work.weixin.qq.com/document/path/97392 |  * <a href="https://developer.work.weixin.qq.com/document/path/97392">文档</a> | ||||||
|  * |  * | ||||||
|  * @author Hugo |  * @author Hugo | ||||||
|  */ |  */ | ||||||
| @ -21,8 +21,7 @@ public interface WxCpOaWeDocService { | |||||||
|    * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/create_doc?access_token=ACCESS_TOKEN |    * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/create_doc?access_token=ACCESS_TOKEN | ||||||
|    * |    * | ||||||
|    * @param request 新建文档对应请求参数 |    * @param request 新建文档对应请求参数 | ||||||
|    * @return url 新建文档的访问链接 |    * @return url:新建文档的访问链接,docid:新建文档的docid | ||||||
|    * @return docid  新建文档的docid |  | ||||||
|    * @throws WxErrorException the wx error exception |    * @throws WxErrorException the wx error exception | ||||||
|    */ |    */ | ||||||
|   WxCpDocCreateData docCreate(@NonNull WxCpDocCreateRequest request) throws WxErrorException; |   WxCpDocCreateData docCreate(@NonNull WxCpDocCreateRequest request) throws WxErrorException; | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ import com.google.gson.ExclusionStrategy; | |||||||
| import com.google.gson.FieldAttributes; | import com.google.gson.FieldAttributes; | ||||||
| import com.google.gson.Gson; | import com.google.gson.Gson; | ||||||
| import com.google.gson.GsonBuilder; | import com.google.gson.GsonBuilder; | ||||||
|  | import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder; | ||||||
| import me.chanjar.weixin.mp.bean.*; | import me.chanjar.weixin.mp.bean.*; | ||||||
| import me.chanjar.weixin.mp.bean.card.WxMpCard; | import me.chanjar.weixin.mp.bean.card.WxMpCard; | ||||||
| import me.chanjar.weixin.mp.bean.card.WxMpCardResult; | import me.chanjar.weixin.mp.bean.card.WxMpCardResult; | ||||||
| @ -55,9 +56,11 @@ public class WxMpGsonBuilder { | |||||||
|     INSTANCE.registerTypeAdapter(WxMpMaterialNews.class, new WxMpMaterialNewsGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMaterialNews.class, new WxMpMaterialNewsGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpNewsArticle.class, new WxMpNewsArticleGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpNewsArticle.class, new WxMpNewsArticleGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMaterialNewsBatchGetResult.class, new WxMpMaterialNewsBatchGetGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMaterialNewsBatchGetResult.class, new WxMpMaterialNewsBatchGetGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMaterialNewsBatchGetResult.WxMaterialNewsBatchGetNewsItem.class, new WxMpMaterialNewsBatchGetGsonItemAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMaterialNewsBatchGetResult.WxMaterialNewsBatchGetNewsItem.class, | ||||||
|  |       new WxMpMaterialNewsBatchGetGsonItemAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMaterialFileBatchGetResult.class, new WxMpMaterialFileBatchGetGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMaterialFileBatchGetResult.class, new WxMpMaterialFileBatchGetGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMaterialFileBatchGetResult.WxMaterialFileBatchGetNewsItem.class, new WxMpMaterialFileBatchGetGsonItemAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMaterialFileBatchGetResult.WxMaterialFileBatchGetNewsItem.class, | ||||||
|  |       new WxMpMaterialFileBatchGetGsonItemAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpCardResult.class, new WxMpCardResultGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpCardResult.class, new WxMpCardResultGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpCard.class, new WxMpCardGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpCard.class, new WxMpCardGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMassPreviewMessage.class, new WxMpMassPreviewMessageGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMassPreviewMessage.class, new WxMpMassPreviewMessageGsonAdapter()); | ||||||
| @ -66,7 +69,8 @@ public class WxMpGsonBuilder { | |||||||
|     INSTANCE.registerTypeAdapter(WxMpUserBlacklistGetResult.class, new WxUserBlacklistGetResultGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpUserBlacklistGetResult.class, new WxUserBlacklistGetResultGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMemberCardUserInfoResult.class, new WxMpMemberCardUserInfoResultGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMemberCardUserInfoResult.class, new WxMpMemberCardUserInfoResultGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMemberCardUpdateResult.class, new WxMpMemberCardUpdateResultGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMemberCardUpdateResult.class, new WxMpMemberCardUpdateResultGsonAdapter()); | ||||||
|     INSTANCE.registerTypeAdapter(WxMpMemberCardActivateTempInfoResult.class, new WxMpMemberCardActivateTempInfoResultGsonAdapter()); |     INSTANCE.registerTypeAdapter(WxMpMemberCardActivateTempInfoResult.class, | ||||||
|  |       new WxMpMemberCardActivateTempInfoResultGsonAdapter()); | ||||||
|  |  | ||||||
|     INSTANCE.setExclusionStrategies(new ExclusionStrategy() { |     INSTANCE.setExclusionStrategies(new ExclusionStrategy() { | ||||||
|       @Override |       @Override | ||||||
| @ -76,11 +80,7 @@ public class WxMpGsonBuilder { | |||||||
|  |  | ||||||
|       @Override |       @Override | ||||||
|       public boolean shouldSkipClass(Class<?> aClass) { |       public boolean shouldSkipClass(Class<?> aClass) { | ||||||
|         if (aClass == File.class) { |         return aClass == File.class || aClass == ApacheHttpClientBuilder.class; | ||||||
|           return true; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         return false; |  | ||||||
|       } |       } | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Binary Wang
					Binary Wang