✨ 新增发送单聊消息接口
This commit is contained in:
parent
f51fb38d0b
commit
ce5439d4b2
13
api/message.go
Normal file
13
api/message.go
Normal file
@ -0,0 +1,13 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"gitee.ltd/lxh/txim/api/param"
|
||||
"gitee.ltd/lxh/txim/common"
|
||||
)
|
||||
|
||||
// SendMessageToUser 发送单聊消息给用户
|
||||
func SendMessageToUser(p *param.PushMessageToUserReq) (*param.PushMessageToUserRes, error) {
|
||||
a := param.PushMessageToUserRes{}
|
||||
err := Api(common.SendMessageToUser, p, &a)
|
||||
return &a, err
|
||||
}
|
@ -77,3 +77,11 @@ type PushOrdinaryMsgToGroupReq struct {
|
||||
Random int `json:"Random"` // 随机数
|
||||
MsgBody []callback.TIMMessage `json:"MsgBody"` // 消息内容
|
||||
}
|
||||
|
||||
// PushMessageToUserReq 给用户发单聊消息参数
|
||||
type PushMessageToUserReq struct {
|
||||
FromAccount string `json:"From_Account"` // 发信人
|
||||
ToAccount string `json:"To_Account"` // 收信人
|
||||
Random int `json:"Random"` // 随机数
|
||||
MsgBody []callback.TIMMessage `json:"MsgBody"` // 消息内容
|
||||
}
|
||||
|
@ -54,3 +54,12 @@ type PushOrdinaryMsgToGroupRes struct {
|
||||
MsgTime int `json:"MsgTime"` // 消息发送的时间戳,对应后台 server 时间
|
||||
MsgSeq int `json:"MsgSeq"` // 消息序列号,唯一标示一条消息
|
||||
}
|
||||
|
||||
// PushMessageToUserRes 给用户发单聊消息返回参数
|
||||
type PushMessageToUserRes struct {
|
||||
ActionStatus string `json:"ActionStatus"`
|
||||
ErrorInfo string `json:"ErrorInfo"`
|
||||
ErrorCode int `json:"ErrorCode"`
|
||||
MsgTime int `json:"MsgTime"`
|
||||
MsgKey string `json:"MsgKey"`
|
||||
}
|
||||
|
@ -11,5 +11,6 @@ var (
|
||||
AccountDelete Api = Api{"im_open_login_svc", "account_delete"}
|
||||
GroupCreate Api = Api{"group_open_http_svc", "create_group"}
|
||||
PushOrdinaryMsgToGroup Api = Api{"group_open_http_svc", "send_group_msg"} // 发送普通群消息
|
||||
SendMessageToUser Api = Api{"openim", "sendmsg"} // 发送单聊消息
|
||||
ProfileSet Api = Api{"profile", "portrait_set"}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user