Skip to content

Commit aac1ac6

Browse files
committed
Merge pull request #35 from Liuchy1/master
add ios msg received
2 parents 2d1103c + fd57c32 commit aac1ac6

File tree

2 files changed

+84
-52
lines changed

2 files changed

+84
-52
lines changed
Lines changed: 57 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,76 @@
11
package cn.jpush.api.report;
22

3-
import java.lang.reflect.Type;
4-
import java.util.ArrayList;
5-
import java.util.List;
6-
73
import cn.jpush.api.common.resp.BaseResult;
84
import cn.jpush.api.common.resp.ResponseWrapper;
9-
105
import com.google.gson.annotations.Expose;
116
import com.google.gson.reflect.TypeToken;
127

8+
import java.lang.reflect.Type;
9+
import java.util.ArrayList;
10+
import java.util.List;
11+
1312
public class MessagesResult extends BaseResult {
14-
private static final Type MESSAGE_TYPE = new TypeToken<List<Message>>(){}.getType();
15-
16-
@Expose public List<Message> messages = new ArrayList<Message>();
17-
18-
public static class Message {
19-
@Expose public long msg_id;
20-
@Expose public Android android;
21-
@Expose public Ios ios;
22-
}
23-
13+
private static final Type MESSAGE_TYPE = new TypeToken<List<Message>>() {}.getType();
14+
15+
@Expose
16+
public List<Message> messages = new ArrayList<Message>();
17+
18+
public static class Message {
19+
@Expose
20+
public long msg_id;
21+
@Expose
22+
public Android android;
23+
@Expose
24+
public Ios ios;
25+
@Expose
26+
public Winphone winphone;
27+
}
28+
2429
public static class Android {
25-
@Expose public int received;
26-
@Expose public int target;
27-
@Expose public int online_push;
28-
@Expose public int click;
29-
@Expose public int msg_click;
30+
@Expose
31+
public int received;
32+
@Expose
33+
public int target;
34+
@Expose
35+
public int online_push;
36+
@Expose
37+
public int click;
38+
@Expose
39+
public int msg_click;
3040
}
31-
41+
3242
public static class Ios {
33-
@Expose public int apns_sent;
34-
@Expose public int apns_target;
35-
@Expose public int click;
36-
@Expose public int target;
37-
@Expose public int received;
38-
@Expose public int msg_click;
43+
@Expose
44+
public int apns_sent;
45+
@Expose
46+
public int apns_target;
47+
@Expose
48+
public int click;
49+
@Expose
50+
public int target;
51+
@Expose
52+
public int received;
53+
@Expose
54+
public int msg_click;
55+
}
56+
57+
public static class Winphone {
58+
@Expose
59+
public int mpns_target;
60+
@Expose
61+
public int mpns_sent;
62+
@Expose
63+
public int click;
3964
}
40-
41-
static MessagesResult fromResponse(ResponseWrapper responseWrapper) {
65+
66+
static MessagesResult fromResponse(ResponseWrapper responseWrapper) {
4267
MessagesResult result = new MessagesResult();
4368
if (responseWrapper.isServerResponse()) {
4469
result.messages = _gson.fromJson(responseWrapper.responseContent, MESSAGE_TYPE);
4570
}
46-
71+
4772
result.setResponseWrapper(responseWrapper);
4873
return result;
49-
}
50-
74+
}
75+
5176
}
Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
11
package cn.jpush.api.report;
22

3-
import java.lang.reflect.Type;
4-
import java.util.ArrayList;
5-
import java.util.List;
6-
73
import cn.jpush.api.common.resp.BaseResult;
84
import cn.jpush.api.common.resp.ResponseWrapper;
9-
105
import com.google.gson.annotations.Expose;
116
import com.google.gson.reflect.TypeToken;
127

8+
import java.lang.reflect.Type;
9+
import java.util.ArrayList;
10+
import java.util.List;
11+
1312
public class ReceivedsResult extends BaseResult {
14-
private static final Type RECEIVED_TYPE = new TypeToken<List<Received>>(){}.getType();
15-
16-
@Expose public List<Received> received_list = new ArrayList<Received>();
17-
18-
19-
public static class Received {
20-
@Expose public long msg_id;
21-
@Expose public int android_received;
22-
@Expose public int ios_apns_sent;
23-
}
24-
25-
static ReceivedsResult fromResponse(ResponseWrapper responseWrapper) {
13+
private static final Type RECEIVED_TYPE = new TypeToken<List<Received>>() {}.getType();
14+
15+
@Expose
16+
public List<Received> received_list = new ArrayList<Received>();
17+
18+
19+
public static class Received {
20+
@Expose
21+
public long msg_id;
22+
@Expose
23+
public int android_received;
24+
@Expose
25+
public int ios_apns_sent;
26+
@Expose
27+
public int ios_msg_receive;
28+
@Expose
29+
public int wp_mpns_sent;
30+
}
31+
32+
static ReceivedsResult fromResponse(ResponseWrapper responseWrapper) {
2633
ReceivedsResult result = new ReceivedsResult();
2734
if (responseWrapper.isServerResponse()) {
2835
result.received_list = _gson.fromJson(responseWrapper.responseContent, RECEIVED_TYPE);
2936
}
30-
37+
3138
result.setResponseWrapper(responseWrapper);
3239
return result;
33-
}
34-
40+
}
41+
3542
}

0 commit comments

Comments
 (0)