From 3485517f3b8beaf036d5257d9d8f64d53d117952 Mon Sep 17 00:00:00 2001 From: Acexy Date: Thu, 7 Jun 2018 11:39:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/thankjava/wqq/entity/msg/SendMsg.java | 217 +++++++++--------- 1 file changed, 109 insertions(+), 108 deletions(-) diff --git a/src/main/java/com/thankjava/wqq/entity/msg/SendMsg.java b/src/main/java/com/thankjava/wqq/entity/msg/SendMsg.java index 7deee5b..55f76ca 100644 --- a/src/main/java/com/thankjava/wqq/entity/msg/SendMsg.java +++ b/src/main/java/com/thankjava/wqq/entity/msg/SendMsg.java @@ -6,113 +6,114 @@ public class SendMsg { - private MsgType msgType; - - @JSONField(name = "group_uin") - private Long groupUin; - private Long to; - private Long did; - private Content content; - - /** - * 发送消息构造 - * @param to 根据 msgType 指定回复对象 - * @param msgType - * @param content 回复内容 Content - * @see Content - */ - public SendMsg(long to, MsgType msgType, Content content) { - - switch (msgType) { - case message: // 好友信息 - this.to = to; - break; - case discu_message: // 讨论组信息 - this.did = to; - break; - case group_message: // 群信息 - this.groupUin = to; - break; - - default: - throw new RuntimeException("msgType can not be null"); - } - this.msgType = msgType; - this.content = content; - } - - public SendMsg(long to, MsgType msgType, String msg) { - - switch (msgType) { - case message: // 好友信息 - this.to = to; - break; - case discu_message: // 讨论组信息 - this.did = to; - break; - case group_message: // 群信息 - this.groupUin = to; - break; - - default: - throw new RuntimeException("msgType can not be null"); - } - this.msgType = msgType; - this.content = new Content(msg); - } - - public SendMsg(PollMsg pollMsg, Content content) { - msgType = pollMsg.getMsgType(); - long to = pollMsg.getTargetFromId(); - switch (msgType) { - case message: // 好友信息 - this.to = to; - break; - case discu_message: // 讨论组信息 - this.did = to; - break; - case group_message: // 群信息 - this.groupUin = to; - break; - } - this.content = content; - } - - public SendMsg(PollMsg pollMsg, String msg) { - msgType = pollMsg.getMsgType(); - long to = pollMsg.getTargetFromId(); - switch (msgType) { - case message: // 好友信息 - this.to = to; - break; - case discu_message: // 讨论组信息 - this.did = to; - break; - case group_message: // 群信息 - this.groupUin = to; - break; - } - this.content = new Content(msg); - } - - public MsgType getMsgType() { - return msgType; - } - - public Long getGroupUin() { - return groupUin; - } - - public Long getTo() { - return to; - } - - public Long getDid() { - return did; - } - - public Content getContent() { - return content; - } + private MsgType msgType; + + @JSONField(name = "group_uin") + private Long groupUin; + private Long to; + private Long did; + private Content content; + + /** + * 发送消息构造 + * + * @param to 根据 msgType 指定回复对象 + * @param msgType + * @param content 回复内容 Content + * @see Content + */ + public SendMsg(long to, MsgType msgType, Content content) { + + switch (msgType) { + case message: // 好友信息 + this.to = to; + break; + case discu_message: // 讨论组信息 + this.did = to; + break; + case group_message: // 群信息 + this.groupUin = to; + break; + + default: + throw new RuntimeException("msgType can not be null"); + } + this.msgType = msgType; + this.content = content; + } + + public SendMsg(long to, MsgType msgType, String msg) { + + switch (msgType) { + case message: // 好友信息 + this.to = to; + break; + case discu_message: // 讨论组信息 + this.did = to; + break; + case group_message: // 群信息 + this.groupUin = to; + break; + + default: + throw new RuntimeException("msgType can not be null"); + } + this.msgType = msgType; + this.content = new Content(msg); + } + + public SendMsg(PollMsg pollMsg, Content content) { + msgType = pollMsg.getMsgType(); + long to = pollMsg.getTargetFromId(); + switch (msgType) { + case message: // 好友信息 + this.to = to; + break; + case discu_message: // 讨论组信息 + this.did = to; + break; + case group_message: // 群信息 + this.groupUin = to; + break; + } + this.content = content; + } + + public SendMsg(PollMsg pollMsg, String msg) { + msgType = pollMsg.getMsgType(); + long to = pollMsg.getTargetFromId(); + switch (msgType) { + case message: // 好友信息 + this.to = to; + break; + case discu_message: // 讨论组信息 + this.did = to; + break; + case group_message: // 群信息 + this.groupUin = to; + break; + } + this.content = new Content(msg); + } + + public MsgType getMsgType() { + return msgType; + } + + public Long getGroupUin() { + return groupUin; + } + + public Long getTo() { + return to; + } + + public Long getDid() { + return did; + } + + public Content getContent() { + return content; + } }