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.qy.model.IdParameter;
7 import com.foxinmy.weixin4j.tuple.NotifyTuple;
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 public class NotifyMessage implements Serializable {
25
26 private static final long serialVersionUID = 1219589414293000383L;
27
28
29
30
31 @JSONField(name = "agentid")
32 private int agentId;
33
34
35
36 private int safe;
37
38
39
40 @JSONField(serialize = false)
41 private NotifyTuple tuple;
42
43
44
45 @JSONField(serialize = false)
46 private IdParameter target;
47
48 public NotifyMessage(int agentid, NotifyTuple tuple) {
49 this(agentid, tuple, IdParameter.get(), false);
50 }
51
52 public NotifyMessage(int agentId, NotifyTuple tuple, IdParameter target,
53 boolean isSafe) {
54 this.agentId = agentId;
55 this.safe = isSafe ? 1 : 0;
56 this.tuple = tuple;
57 this.target = target;
58 }
59
60 public int getAgentId() {
61 return agentId;
62 }
63
64 public NotifyTuple getTuple() {
65 return tuple;
66 }
67
68 public IdParameter getTarget() {
69 return target;
70 }
71
72 public void setTarget(IdParameter target) {
73 this.target = target;
74 }
75
76 public int getSafe() {
77 return safe;
78 }
79
80 public void setSafe(boolean isSafe) {
81 this.safe = isSafe ? 1 : 0;
82 }
83
84 @Override
85 public String toString() {
86 return "NotifyMessage [agentId=" + agentId + ", safe=" + safe
87 + ", tuple=" + tuple + ", target=" + target + "]";
88 }
89 }