57 lines
1.9 KiB
Go
Raw 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 user
const (
// AdminRoleHost 表示当前有效主播身份。
AdminRoleHost = "host"
// AdminRoleAgency 表示当前有效公会 owner 身份,普通公会成员不会获得该角色。
AdminRoleAgency = "agency"
// AdminRoleBD 表示当前有效普通 BD 身份。
AdminRoleBD = "bd"
// AdminRoleBDLeader 表示当前有效 BD Leader 身份;它可以和普通 BD 身份同时存在。
AdminRoleBDLeader = "bd_leader"
// AdminRoleCoinSeller 表示当前有效币商身份。
AdminRoleCoinSeller = "coin_seller"
// AdminRoleManager 表示当前有效经理身份。
AdminRoleManager = "manager"
)
const (
// BanSourceAdmin 表示有效封禁来自后台管理员事实表。
BanSourceAdmin = "admin"
// BanSourceManager 表示有效封禁来自经理中心事实表。
BanSourceManager = "manager"
// BanSourceLegacy 表示历史 banned/disabled 状态没有可管理的封禁事实,必须按永久处理。
BanSourceLegacy = "legacy"
)
// ActiveBanSummary 是后台列表读取的合并封禁视图。
// 多个来源重叠时Permanent 只要命中任一永久事实即为 true否则 ExpiresAtMs 取最晚到期时间。
type ActiveBanSummary struct {
Active bool
Source string
BanID string
Permanent bool
ExpiresAtMs int64
UserStatus Status
OperatorType string
OperatorUserID int64
Reason string
CreatedAtMs int64
ActiveBanCount int32
}
// AdminProfile 是 user-service 为后台用户列表提供的 owner 事实投影。
// 钱包余额、等级等其他 owner 的字段由 admin-server 分别批量聚合,不能塞进该查询回查跨库数据。
type AdminProfile struct {
User User
BirthDate string
RegisterDevice string
LastSuccessLoginAtMs int64
Roles []string
Ban ActiveBanSummary
LastOperatorType string
LastOperatorUserID int64
LastOperationReason string
LastOperationAtMs int64
}