dev --- 3.8.0.A版本, openProject引用 ; formao-live --- 3.7.0.B 版本, formallProject引用
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

37 строки
1.6 KiB

  1. package me.chanjar.weixin.util.json;
  2. import me.chanjar.weixin.bean.*;
  3. import me.chanjar.weixin.bean.result.*;
  4. import com.google.gson.Gson;
  5. import com.google.gson.GsonBuilder;
  6. public class WxGsonBuilder {
  7. public static final GsonBuilder INSTANCE = new GsonBuilder();
  8. static {
  9. INSTANCE.disableHtmlEscaping();
  10. INSTANCE.registerTypeAdapter(WxCustomMessage.class, new WxCustomMessageGsonAdapter());
  11. INSTANCE.registerTypeAdapter(WxMenu.class, new WxMenuGsonAdapter());
  12. INSTANCE.registerTypeAdapter(WxMassNews.class, new WxMassNewsGsonAdapter());
  13. INSTANCE.registerTypeAdapter(WxMassGroupMessage.class, new WxMassMessageGsonAdapter());
  14. INSTANCE.registerTypeAdapter(WxMassOpenIdsMessage.class, new WxMassOpenIdsMessageGsonAdapter());
  15. INSTANCE.registerTypeAdapter(WxGroup.class, new WxGroupGsonAdapter());
  16. INSTANCE.registerTypeAdapter(WxUser.class, new WxUserGsonAdapter());
  17. INSTANCE.registerTypeAdapter(WxUserList.class, new WxUserListGsonAdapter());
  18. INSTANCE.registerTypeAdapter(WxAccessToken.class, new WxAccessTokenAdapter());
  19. INSTANCE.registerTypeAdapter(WxError.class, new WxErrorAdapter());
  20. INSTANCE.registerTypeAdapter(WxMassVideo.class, new WxMassVideoAdapter());
  21. INSTANCE.registerTypeAdapter(WxMediaUploadResult.class, new WxMediaUploadResultAdapter());
  22. INSTANCE.registerTypeAdapter(WxMassSendResult.class, new WxMassSendResultAdapter());
  23. INSTANCE.registerTypeAdapter(WxMassUploadResult.class, new WxMassUploadResultAdapter());
  24. INSTANCE.registerTypeAdapter(WxQrCodeTicket.class, new WxQrCodeTicketAdapter());
  25. }
  26. public static Gson create() {
  27. return INSTANCE.create();
  28. }
  29. }