补充状态变化回调数据

This commit is contained in:
李寻欢 2022-01-11 11:48:40 +08:00
parent d568745da2
commit af0b8b46f4
1 changed files with 21 additions and 0 deletions

21
callback/state.go Normal file
View File

@ -0,0 +1,21 @@
package callback
// StateChangeData 状态变化回调数据
// https://cloud.tencent.com/document/product/269/2570
type StateChangeData struct {
CallbackCommand string `json:"CallbackCommand"` // 回调命令
EventTime int64 `json:"EventTime"` // 触发本次回调的时间戳,单位为毫秒
Info StateChangeDataInfo `json:"Info"` // 用户上下线的信息
KickedDevice []StateChangeDataKickedDevice `json:"KickedDevice"` // 如果本次状态变更为 LoginRegister而且有其他设备被踢下线才会有此字段。此字段表示其他被踢下线的设备的信息
}
// StateChangeDataInfo 状态变化回调数据信息
type StateChangeDataInfo struct {
Action string `json:"Action"` // 用户上线或者下线的动作Login 表示上线TCP 建立Logout 表示下线TCP 断开Disconnect 表示网络断开TCP 断开)
ToAccount string `json:"To_Account"` // 用户 UserID
Reason string `json:"Reason"` // 用户上下线触发的原因
}
type StateChangeDataKickedDevice struct {
Platform string `json:"Platform"` // 被踢下线的设备的平台类型,可能的取值有"iOS", "Android", "Web", "Windows", "iPad", "Mac", "Linux"
}