UploadFileResult.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. package com.sk.weichat.bean;
  2. import com.alibaba.fastjson.annotation.JSONField;
  3. import com.alibaba.fastjson.serializer.JSONSerializer;
  4. import com.alibaba.fastjson.serializer.PropertyPreFilter;
  5. import com.sk.weichat.volley.Result;
  6. import java.util.List;
  7. /**
  8. * NEED
  9. *
  10. *
  11. */
  12. public class UploadFileResult extends Result {
  13. private int failure;
  14. private int success;
  15. private int total;
  16. private Data data;
  17. public int getFailure() {
  18. return failure;
  19. }
  20. public void setFailure(int failure) {
  21. this.failure = failure;
  22. }
  23. public int getSuccess() {
  24. return success;
  25. }
  26. public void setSuccess(int success) {
  27. this.success = success;
  28. }
  29. public int getTotal() {
  30. return total;
  31. }
  32. public void setTotal(int total) {
  33. this.total = total;
  34. }
  35. public Data getData() {
  36. return data;
  37. }
  38. public void setData(Data data) {
  39. this.data = data;
  40. }
  41. public static class Data {
  42. private List<Sources> audios;
  43. private List<Sources> videos;
  44. private List<Sources> images;
  45. private List<Sources> others;
  46. private List<Sources> files;
  47. public List<Sources> getFiles() {
  48. return files;
  49. }
  50. public void setFiles(List<Sources> files) {
  51. this.files = files;
  52. }
  53. public List<Sources> getAudios() {
  54. return audios;
  55. }
  56. public void setAudios(List<Sources> audios) {
  57. this.audios = audios;
  58. }
  59. public List<Sources> getVideos() {
  60. return videos;
  61. }
  62. public void setVideos(List<Sources> videos) {
  63. this.videos = videos;
  64. }
  65. public List<Sources> getImages() {
  66. return images;
  67. }
  68. public void setImages(List<Sources> images) {
  69. this.images = images;
  70. }
  71. public List<Sources> getOthers() {
  72. return others;
  73. }
  74. public void setOthers(List<Sources> others) {
  75. this.others = others;
  76. }
  77. }
  78. public static class Sources {
  79. @JSONField(name = "oFileName")
  80. private String originalFileName;
  81. @JSONField(name = "oUrl")
  82. private String originalUrl;
  83. @JSONField(name = "tUrl")
  84. private String thumbnailUrl;
  85. private int status;
  86. private long length;// 语音视频文件的时长,返回数据后,自己在添加上去的
  87. private long size;// 语音视频文件的大小,返回数据后,自己在添加上去的
  88. public String getOriginalFileName() {
  89. return originalFileName;
  90. }
  91. public void setOriginalFileName(String originalFileName) {
  92. this.originalFileName = originalFileName;
  93. }
  94. public String getOriginalUrl() {
  95. return originalUrl;
  96. }
  97. public void setOriginalUrl(String originalUrl) {
  98. this.originalUrl = originalUrl;
  99. }
  100. public String getThumbnailUrl() {
  101. return thumbnailUrl;
  102. }
  103. public void setThumbnailUrl(String thumbnailUrl) {
  104. this.thumbnailUrl = thumbnailUrl;
  105. }
  106. public int getStatus() {
  107. return status;
  108. }
  109. public void setStatus(int status) {
  110. this.status = status;
  111. }
  112. public long getLength() {
  113. return length;
  114. }
  115. public void setLength(long length) {
  116. this.length = length;
  117. }
  118. public long getSize() {
  119. return size;
  120. }
  121. public void setSize(long size) {
  122. this.size = size;
  123. }
  124. }
  125. // 图片上传的Filter
  126. public static PropertyPreFilter sImagesFilter = new PropertyPreFilter() {
  127. @Override
  128. public boolean apply(JSONSerializer arg0, Object arg1, String arg2) {
  129. if (arg2.equals("oUrl") || arg2.equals("tUrl")) {
  130. return true;
  131. }
  132. return false;
  133. }
  134. };
  135. // 语音视频上传的Filter
  136. public static PropertyPreFilter sAudioVideosFilter = new PropertyPreFilter() {
  137. @Override
  138. public boolean apply(JSONSerializer arg0, Object arg1, String arg2) {
  139. if (arg2.equals("oUrl") || arg2.equals("length")|| arg2.equals("size")) {
  140. return true;
  141. }
  142. return false;
  143. }
  144. };
  145. }