BaseBean.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.xunao.effectdemo.net;
  2. import com.google.gson.Gson;
  3. import com.xunao.effectdemo.utils.StringUtil;
  4. import java.io.IOException;
  5. import java.io.InputStream;
  6. import java.io.Serializable;
  7. public class BaseBean implements Serializable {
  8. public static BaseBean parse(InputStream inputStream) throws IOException {
  9. String jsonStr = StringUtil.inputStream2String(inputStream, "utf-8");
  10. return parse(jsonStr);
  11. }
  12. public static BaseBean parse(String jsonStr) {
  13. Gson gson = new Gson();
  14. BaseBean baseBean = gson.fromJson(jsonStr, BaseBean.class);
  15. return baseBean;
  16. }
  17. private String retCode;
  18. private String retMsgJp;
  19. private String retMsgEn;
  20. public String getRetCode() {
  21. return retCode;
  22. }
  23. public void setRetCode(String retCode) {
  24. this.retCode = retCode;
  25. }
  26. public String getRetMsgJp() {
  27. return retMsgJp;
  28. }
  29. public void setRetMsgJp(String retMsgJp) {
  30. this.retMsgJp = retMsgJp;
  31. }
  32. public String getRetMsgEn() {
  33. return retMsgEn;
  34. }
  35. public void setRetMsgEn(String retMsgEn) {
  36. this.retMsgEn = retMsgEn;
  37. }
  38. }