package request import ( pb "sghgogs.com/sghblog/authorization-service/proto" "time" ) type AdminUser struct { ID int64 `gorm:"primary_key;not_null;auto_increment;" json:"id"` Username string `gorm:"unique_index;not_null" json:"username"` Password string `json:"-" gorm:"unique_index;not_null"` // 这里使用 "-" 表示在 JSON 输出时不包含密码字段 PhoneNumber string `json:"phone_number"` Email string `json:"email"` Avatar string `json:"avatar"` Status pb.StatusEnum `json:"status" gorm:"unique_index;not_null"` // 可以是 "enabled", "disabled", "deleted" 等 IsReserved bool `json:"is_reserved"` // 禁止删除 CreatedAt time.Time `json:"created_at"` // 创建时间 UpdatedAt *time.Time `json:"updated_at"` // 更新时间 CreatorID int64 `json:"creator_id"` // 创建人 UpdaterID string `json:"updater_id"` // 操作人 Teams []AdminTeam `gorm:"many2many:admin_team_member;" json:"teams"` Roles []AdminRole `gorm:"many2many:admin_user_role;" json:"roles"` }