AsyncUploadRealm.java 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. package com.fxy.realm;
  2. import android.os.Parcel;
  3. import android.os.Parcelable;
  4. import com.fxy.baselibrary.util.JsonUtil;
  5. import com.fxy.detection.bean.DealDiffBean;
  6. import com.luck.picture.lib.entity.LocalMedia;
  7. import io.realm.RealmObject;
  8. import io.realm.annotations.PrimaryKey;
  9. public class AsyncUploadRealm extends RealmObject implements Parcelable {
  10. @PrimaryKey // 必须要有一个主键
  11. private String id ;//
  12. private String uploadType = "" ;// 上传类型(作用于区分不同的功能)
  13. private String notifyKey = "" ; // 分组KEY(作用于一个页面多个图片)
  14. private String uniqueTag = ""; //唯一标识
  15. private String notifyUrl = ""; // 通知地址
  16. private String notifyParam = ""; //通知参数
  17. private String ossUrl ="";//OSS文件路径
  18. private String scanDate = ""; //扫描时间
  19. private Integer isDelete = 0; //是否删除
  20. private Integer pushStatus = 0; // 推送到oss状态 0 -未推送 1 - 推送失败; 2 - 推送成功
  21. private Integer rePush = 0; //重推次数
  22. private Integer isFinish=0; // 是否完成 0未完成 1【上传中】 2上传失败 3上传成功
  23. private Long createTime;
  24. private String localMediaStr = "";
  25. public AsyncUploadRealm() {
  26. }
  27. protected AsyncUploadRealm(Parcel in) {
  28. id = in.readString();
  29. uploadType = in.readString();
  30. notifyKey = in.readString();
  31. uniqueTag = in.readString();
  32. notifyUrl = in.readString();
  33. notifyParam = in.readString();
  34. ossUrl = in.readString();
  35. scanDate = in.readString();
  36. if (in.readByte() == 0) {
  37. isDelete = null;
  38. } else {
  39. isDelete = in.readInt();
  40. }
  41. if (in.readByte() == 0) {
  42. pushStatus = null;
  43. } else {
  44. pushStatus = in.readInt();
  45. }
  46. if (in.readByte() == 0) {
  47. rePush = null;
  48. } else {
  49. rePush = in.readInt();
  50. }
  51. if (in.readByte() == 0) {
  52. isFinish = null;
  53. } else {
  54. isFinish = in.readInt();
  55. }
  56. if (in.readByte() == 0) {
  57. createTime = null;
  58. } else {
  59. createTime = in.readLong();
  60. }
  61. localMediaStr = in.readString();
  62. }
  63. @Override
  64. public void writeToParcel(Parcel dest, int flags) {
  65. dest.writeString(id);
  66. dest.writeString(uploadType);
  67. dest.writeString(notifyKey);
  68. dest.writeString(uniqueTag);
  69. dest.writeString(notifyUrl);
  70. dest.writeString(notifyParam);
  71. dest.writeString(ossUrl);
  72. dest.writeString(scanDate);
  73. if (isDelete == null) {
  74. dest.writeByte((byte) 0);
  75. } else {
  76. dest.writeByte((byte) 1);
  77. dest.writeInt(isDelete);
  78. }
  79. if (pushStatus == null) {
  80. dest.writeByte((byte) 0);
  81. } else {
  82. dest.writeByte((byte) 1);
  83. dest.writeInt(pushStatus);
  84. }
  85. if (rePush == null) {
  86. dest.writeByte((byte) 0);
  87. } else {
  88. dest.writeByte((byte) 1);
  89. dest.writeInt(rePush);
  90. }
  91. if (isFinish == null) {
  92. dest.writeByte((byte) 0);
  93. } else {
  94. dest.writeByte((byte) 1);
  95. dest.writeInt(isFinish);
  96. }
  97. if (createTime == null) {
  98. dest.writeByte((byte) 0);
  99. } else {
  100. dest.writeByte((byte) 1);
  101. dest.writeLong(createTime);
  102. }
  103. dest.writeString(localMediaStr);
  104. }
  105. @Override
  106. public int describeContents() {
  107. return 0;
  108. }
  109. public static final Creator<AsyncUploadRealm> CREATOR = new Creator<AsyncUploadRealm>() {
  110. @Override
  111. public AsyncUploadRealm createFromParcel(Parcel in) {
  112. return new AsyncUploadRealm(in);
  113. }
  114. @Override
  115. public AsyncUploadRealm[] newArray(int size) {
  116. return new AsyncUploadRealm[size];
  117. }
  118. };
  119. public String getId() {
  120. return id;
  121. }
  122. public void setId(String id) {
  123. this.id = id;
  124. }
  125. public String getUploadType() {
  126. return uploadType;
  127. }
  128. public void setUploadType(String uploadType) {
  129. this.uploadType = uploadType;
  130. }
  131. public String getNotifyKey() {
  132. return notifyKey;
  133. }
  134. public void setNotifyKey(String notifyKey) {
  135. this.notifyKey = notifyKey;
  136. }
  137. public String getUniqueTag() {
  138. return uniqueTag;
  139. }
  140. public void setUniqueTag(String uniqueTag) {
  141. this.uniqueTag = uniqueTag;
  142. }
  143. public String getNotifyUrl() {
  144. return notifyUrl;
  145. }
  146. public void setNotifyUrl(String notifyUrl) {
  147. this.notifyUrl = notifyUrl;
  148. }
  149. public String getNotifyParam() {
  150. return notifyParam;
  151. }
  152. public void setNotifyParam(String notifyParam) {
  153. this.notifyParam = notifyParam;
  154. }
  155. public String getOssUrl() {
  156. return ossUrl;
  157. }
  158. public void setOssUrl(String ossUrl) {
  159. this.ossUrl = ossUrl;
  160. }
  161. public String getScanDate() {
  162. return scanDate;
  163. }
  164. public void setScanDate(String scanDate) {
  165. this.scanDate = scanDate;
  166. }
  167. public Integer getIsDelete() {
  168. return isDelete;
  169. }
  170. public void setIsDelete(Integer isDelete) {
  171. this.isDelete = isDelete;
  172. }
  173. public Integer getPushStatus() {
  174. return pushStatus;
  175. }
  176. public void setPushStatus(Integer pushStatus) {
  177. this.pushStatus = pushStatus;
  178. }
  179. public Integer getRePush() {
  180. return rePush;
  181. }
  182. public void setRePush(Integer rePush) {
  183. this.rePush = rePush;
  184. }
  185. public Integer getIsFinish() {
  186. return isFinish;
  187. }
  188. public void setIsFinish(Integer isFinish) {
  189. this.isFinish = isFinish;
  190. }
  191. public Long getCreateTime() {
  192. return createTime;
  193. }
  194. public void setCreateTime(Long createTime) {
  195. this.createTime = createTime;
  196. }
  197. public String getLocalMediaStr() {
  198. return localMediaStr;
  199. }
  200. public void setLocalMediaStr(String localMediaStr) {
  201. this.localMediaStr = localMediaStr;
  202. }
  203. public LocalMedia getLocalMedia() {
  204. return JsonUtil.jsonString2Bean(this.localMediaStr, LocalMedia.class);
  205. }
  206. }