admin
2022-01-12 4a7367a869ef12375ea6678ca44e102b8919c624
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package cn.jpush.api.report;
 
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
 
import com.google.gson.annotations.Expose;
import com.google.gson.reflect.TypeToken;
 
import cn.jiguang.common.resp.BaseResult;
import cn.jiguang.common.resp.ResponseWrapper;
 
public class MessagesResult extends BaseResult {
    private static final Type MESSAGE_TYPE = new TypeToken<List<Message>>() {}.getType();
    private static final long serialVersionUID = -1582895355000647292L;
 
    @Expose
    public List<Message> messages = new ArrayList<Message>();
 
    public static class Message {
        @Expose
        public String msg_id;
        @Expose
        public Android android;
        @Expose
        public Ios ios;
        @Expose
        public Winphone winphone;
    }
 
    public static class Android {
        @Expose
        public int received;
        @Expose
        public int target;
        @Expose
        public int online_push;
        @Expose
        public int click;
        @Expose
        public int msg_click;
    }
 
    public static class Ios {
        @Expose
        public int apns_sent;
        @Expose
        public int apns_target;
        @Expose
        public int apns_received;
        @Expose
        public int click;
        @Expose
        public int target;
        @Expose
        public int received;
    }
 
    public static class Winphone {
        @Expose
        public int mpns_target;
        @Expose
        public int mpns_sent;
        @Expose
        public int click;
    }
 
    static MessagesResult fromResponse(ResponseWrapper responseWrapper) {
        MessagesResult result = new MessagesResult();
        if (responseWrapper.isServerResponse()) {
            result.messages = _gson.fromJson(responseWrapper.responseContent, MESSAGE_TYPE);
        }
 
        result.setResponseWrapper(responseWrapper);
        return result;
    }
 
}