1 package com.foxinmy.weixin4j.qy.message;
2
3 import java.io.Serializable;
4
5 import com.alibaba.fastjson.annotation.JSONField;
6 import com.foxinmy.weixin4j.tuple.NotifyTuple;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 public class CustomeMessage implements Serializable {
22
23 private static final long serialVersionUID = -3620361273175868681L;
24
25 private CustomeTarget sender;
26 private CustomeTarget receiver;
27
28
29
30 @JSONField(serialize = false)
31 private NotifyTuple tuple;
32
33 public CustomeMessage(CustomeTarget sender, CustomeTarget receiver,
34 NotifyTuple tuple) {
35 this.sender = sender;
36 this.receiver = receiver;
37 this.tuple = tuple;
38 }
39
40 public CustomeTarget getSender() {
41 return sender;
42 }
43
44 public CustomeTarget getReceiver() {
45 return receiver;
46 }
47
48 public NotifyTuple getTuple() {
49 return tuple;
50 }
51
52
53
54
55
56
57
58
59
60
61 public enum CustomeIdType {
62
63
64
65 kf,
66
67
68
69 userid,
70
71
72
73 openid
74 }
75
76
77
78
79
80
81
82
83
84
85 public static class CustomeTarget implements Serializable {
86
87 private static final long serialVersionUID = 1L;
88
89 private CustomeIdType type;
90 private String id;
91
92 public CustomeTarget(CustomeIdType type, String id) {
93 this.type = type;
94 this.id = id;
95 }
96
97 public CustomeIdType getType() {
98 return type;
99 }
100
101 public String getId() {
102 return id;
103 }
104 }
105
106 @Override
107 public String toString() {
108 return "CustomeMessage [sender=" + sender + ", receiver=" + receiver
109 + ", tuple=" + tuple + "]";
110 }
111 }