1 package com.foxinmy.weixin4j.qy.model;
2
3 import com.alibaba.fastjson.JSONArray;
4 import com.alibaba.fastjson.annotation.JSONField;
5 import com.foxinmy.weixin4j.http.weixin.ApiResult;
6 import com.foxinmy.weixin4j.qy.type.BatchStatus;
7 import com.foxinmy.weixin4j.qy.type.BatchType;
8
9
10
11
12
13
14
15
16
17
18 public class BatchResult extends ApiResult {
19
20 private static final long serialVersionUID = 4985338631992208903L;
21
22
23
24 private int status;
25
26
27
28 private String type;
29
30
31
32 private int total;
33
34
35
36 @JSONField(name = "percentage")
37 private int percentAge;
38
39
40
41 @JSONField(name = "remaintime")
42 private int remainTime;
43
44
45
46 private JSONArray result;
47
48 public int getStatus() {
49 return status;
50 }
51
52 @JSONField(serialize = false)
53 public BatchStatus getFormatStatus() {
54 return BatchStatus.values()[status - 1];
55 }
56
57 public String getType() {
58 return type;
59 }
60
61 @JSONField(serialize = false)
62 public BatchType getFormatType() {
63 return type != null ? BatchType.valueOf(type.toUpperCase()) : null;
64 }
65
66 public int getTotal() {
67 return total;
68 }
69
70 public int getPercentAge() {
71 return percentAge;
72 }
73
74 public int getRemainTime() {
75 return remainTime;
76 }
77
78 public JSONArray getResult() {
79 return result;
80 }
81
82
83
84 public void setStatus(int status) {
85 this.status = status;
86 }
87
88 public void setType(String type) {
89 this.type = type;
90 }
91
92 public void setTotal(int total) {
93 this.total = total;
94 }
95
96 public void setPercentAge(int percentAge) {
97 this.percentAge = percentAge;
98 }
99
100 public void setRemainTime(int remainTime) {
101 this.remainTime = remainTime;
102 }
103
104 public void setResult(JSONArray result) {
105 this.result = result;
106 }
107
108 @Override
109 public String toString() {
110 return "BatchResult [" + super.toString() + ", status=" + status + ", type=" + type + ", total=" + total
111 + ", percentAge=" + percentAge + ", remainTime=" + remainTime + ", result=" + result + "]";
112 }
113 }