txim/callback/state.go

22 lines
1.3 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"
}