Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
代码注释优化
Browse files Browse the repository at this point in the history
  • Loading branch information
acexy committed Jun 7, 2018
1 parent 1e456b5 commit 3485517
Showing 1 changed file with 109 additions and 108 deletions.
217 changes: 109 additions & 108 deletions src/main/java/com/thankjava/wqq/entity/msg/SendMsg.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}

0 comments on commit 3485517

Please sign in to comment.