Skip to content

Commit

Permalink
feat: add c2c message callback
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Apr 27, 2023
1 parent 4cbe5b9 commit f981a51
Show file tree
Hide file tree
Showing 2 changed files with 198 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class CallbackCommand {
*/
public static final String C2C_CALLBACK_AFTER_MSG_WITHDRAW = "C2C.CallbackAfterMsgWithDraw";

// --------------------------------------------------------------------------------------------------------

/**
* 创建群组之前回调(群组系统)
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
package io.github.doocs.im.model.callback;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.doocs.im.model.message.TIMMsgElement;

import java.util.List;

/**
* 单聊机器人消息回调
*
* @author bingo
* @since 2023/4/27 16:51
*/
public class BotOnC2cMessageCallback {
/**
* 回调命令
*/
@JsonProperty("CallbackCommand")
private String callbackCommand;

/**
* 消息发送者 UserID
*/
@JsonProperty("From_Account")
private String fromAccount;

/**
* 消息接收者 UserID
*/
@JsonProperty("To_Account")
private String toAccount;

/**
* 消息序列号,用于标记该条消息(32位无符号整数)
*/
@JsonProperty("MsgSeq")
private Long msgSeq;

/**
* 消息随机数,用于标记该条消息(32位无符号整数)
*/
@JsonProperty("MsgRandom")
private Long msgRandom;

/**
* 消息的发送时间戳,单位为秒<br />单聊消息优先使用 MsgTime 进行排序,同一秒发送的消息则按 MsgSeq 排序,MsgSeq 值越大消息越靠后
*/
@JsonProperty("MsgTime")
private Integer msgTime;

/**
* 该条消息的唯一标识,可根据该标识进行 REST API 撤回单聊消息
*/
@JsonProperty("MsgKey")
private String msgKey;

/**
* 是否仅发送给在线用户标识。1代表仅发送给在线用户,否则为0
*/
@JsonProperty("OnlineOnlyFlag")
private Integer onlineOnlyFlag;

/**
* 该条消息的发送结果,0表示发送成功,非0表示发送失败,具体可参见 错误码
*/
@JsonProperty("SendMsgResult")
private Integer sendMsgResult;

/**
* 该条消息下发失败的错误信息,若消息发送成功,则为"send msg succeed"
*/
@JsonProperty("ErrorInfo")
private String errorInfo;

/**
* To_Account 未读的单聊消息总数量(包含所有的单聊会话)。若该条消息下发失败(例如被脏字过滤),该字段值为-1
*/
@JsonProperty("UnreadMsgNum")
private Integer unreadMsgNum;

/**
* 消息体,具体参见 消息格式描述
*/
@JsonProperty("MsgBody")
private List<TIMMsgElement> msgBody;

/**
* 消息自定义数据(云端保存,会发送到对端,程序卸载重装后还能拉取到
*/
@JsonProperty("CloudCustomData")
private String cloudCustomData;

public String getCallbackCommand() {
return callbackCommand;
}

public void setCallbackCommand(String callbackCommand) {
this.callbackCommand = callbackCommand;
}

public String getFromAccount() {
return fromAccount;
}

public void setFromAccount(String fromAccount) {
this.fromAccount = fromAccount;
}

public String getToAccount() {
return toAccount;
}

public void setToAccount(String toAccount) {
this.toAccount = toAccount;
}

public Long getMsgSeq() {
return msgSeq;
}

public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq;
}

public Long getMsgRandom() {
return msgRandom;
}

public void setMsgRandom(Long msgRandom) {
this.msgRandom = msgRandom;
}

public Integer getMsgTime() {
return msgTime;
}

public void setMsgTime(Integer msgTime) {
this.msgTime = msgTime;
}

public String getMsgKey() {
return msgKey;
}

public void setMsgKey(String msgKey) {
this.msgKey = msgKey;
}

public Integer getOnlineOnlyFlag() {
return onlineOnlyFlag;
}

public void setOnlineOnlyFlag(Integer onlineOnlyFlag) {
this.onlineOnlyFlag = onlineOnlyFlag;
}

public Integer getSendMsgResult() {
return sendMsgResult;
}

public void setSendMsgResult(Integer sendMsgResult) {
this.sendMsgResult = sendMsgResult;
}

public String getErrorInfo() {
return errorInfo;
}

public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}

public Integer getUnreadMsgNum() {
return unreadMsgNum;
}

public void setUnreadMsgNum(Integer unreadMsgNum) {
this.unreadMsgNum = unreadMsgNum;
}

public List<TIMMsgElement> getMsgBody() {
return msgBody;
}

public void setMsgBody(List<TIMMsgElement> msgBody) {
this.msgBody = msgBody;
}

public String getCloudCustomData() {
return cloudCustomData;
}

public void setCloudCustomData(String cloudCustomData) {
this.cloudCustomData = cloudCustomData;
}
}

0 comments on commit f981a51

Please sign in to comment.