87 lines
2.8 KiB
Go
87 lines
2.8 KiB
Go
// Package entity holds admin API shapes for popadmin (not client /v1).
|
|
package entity
|
|
|
|
// ImStats is GET /im/stats.
|
|
type ImStats struct {
|
|
MessageCount int64 `json:"messageCount"`
|
|
ConversationCount int64 `json:"conversationCount"`
|
|
GroupCount int64 `json:"groupCount"`
|
|
RevokedCount int64 `json:"revokedCount"`
|
|
}
|
|
|
|
type ImMessageView struct {
|
|
ID string `json:"id"`
|
|
ClientMsgID string `json:"clientMsgId,omitempty"`
|
|
From int64 `json:"from"`
|
|
To int64 `json:"to,omitempty"`
|
|
GroupID int64 `json:"groupId,omitempty"`
|
|
ChatType string `json:"chatType"`
|
|
Type string `json:"type"`
|
|
Text string `json:"text"`
|
|
Revoked bool `json:"revoked"`
|
|
Ts int64 `json:"ts"`
|
|
}
|
|
|
|
type ImConversationView struct {
|
|
Key string `json:"key"`
|
|
ChatType string `json:"chatType"`
|
|
UserA int64 `json:"userA,omitempty"`
|
|
UserB int64 `json:"userB,omitempty"`
|
|
GroupID int64 `json:"groupId,omitempty"`
|
|
LastMsgID int64 `json:"lastMsgId"`
|
|
LastText string `json:"lastText,omitempty"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
}
|
|
|
|
type GroupView struct {
|
|
GroupID string `json:"groupId"`
|
|
Name string `json:"name"`
|
|
Avatar string `json:"avatar,omitempty"`
|
|
OwnerID int64 `json:"ownerId"`
|
|
MuteAll bool `json:"muteAll"`
|
|
MemberCount int `json:"memberCount"`
|
|
Active bool `json:"active"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
Members []GroupMemberOut `json:"members,omitempty"`
|
|
Messages []ImMessageView `json:"messages,omitempty"`
|
|
}
|
|
|
|
type GroupMemberOut struct {
|
|
UserID int64 `json:"userId"`
|
|
Email string `json:"email,omitempty"`
|
|
Nickname string `json:"nickname,omitempty"`
|
|
Role string `json:"role"`
|
|
}
|
|
|
|
type UserView struct {
|
|
ID int64 `json:"id"`
|
|
Email string `json:"email"`
|
|
Nickname string `json:"nickname"`
|
|
SparkID string `json:"sparkId,omitempty"`
|
|
AvatarURL string `json:"avatarUrl,omitempty"`
|
|
DeviceID string `json:"deviceId,omitempty"`
|
|
Channel string `json:"channel,omitempty"`
|
|
LastActiveAt string `json:"lastActiveAt,omitempty"`
|
|
Banned bool `json:"banned"`
|
|
Status int `json:"status"`
|
|
CreatedAt string `json:"createdAt,omitempty"`
|
|
}
|
|
|
|
type SameIPItem struct {
|
|
IP string `json:"ip"`
|
|
Count int64 `json:"count"`
|
|
UserCount int64 `json:"userCount"`
|
|
DeviceCount int64 `json:"deviceCount"`
|
|
}
|
|
|
|
type ComplaintView struct {
|
|
ID int64 `json:"id"`
|
|
Email string `json:"email"`
|
|
Target string `json:"target"`
|
|
Reason string `json:"reason"`
|
|
Detail string `json:"detail"`
|
|
Status string `json:"status"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|