135 lines
5.3 KiB
Go
135 lines
5.3 KiB
Go
package dto
|
||
|
||
// ========== 基础结构 ==========
|
||
|
||
// FanIdentityDTO 粉丝身份信息
|
||
type FanIdentityDTO struct {
|
||
StarID int64 `json:"star_id"` // 明星ID
|
||
IdentityID string `json:"identity_id"` // stars.identity_id(如"wyb")
|
||
Name string `json:"name"` // stars.name(原始名称,如"王一博")
|
||
Tag string `json:"tag"` // stars.tag(昵称标签,如"小摩托")
|
||
}
|
||
|
||
// CurrentIdentityDTO 当前身份详情
|
||
type CurrentIdentityDTO struct {
|
||
StarId int64 `json:"star_id"` // 明星ID
|
||
IdentityID string `json:"identity_id"` // "wyb"
|
||
IdentityName string `json:"identity_name"` // "王一博"
|
||
Tag string `json:"tag"` // "小摩托"
|
||
Level int32 `json:"level"`
|
||
CrystalBalance int64 `json:"crystal_balance"`
|
||
}
|
||
|
||
// ========== 用户信息 ==========
|
||
|
||
// UserWithIdentityDTO 用户信息(含身份)
|
||
type UserWithIdentityDTO struct {
|
||
UID int64 `json:"uid"` // 使用 uid,值为数据库ID
|
||
Nickname string `json:"nickname"`
|
||
AvatarURL string `json:"avatar_url,omitempty"`
|
||
ChainAddress string `json:"chain_address,omitempty"`
|
||
FanIdentity FanIdentityDTO `json:"fan_identity"`
|
||
FanLevel int32 `json:"fan_level"`
|
||
StarbookLimit int32 `json:"starbook_limit"`
|
||
SlotLimit int32 `json:"slot_limit"`
|
||
AssetsNum int32 `json:"assets_num"` // assets_count
|
||
CrystalBalance int64 `json:"crystal_balance"`
|
||
MobileMasked string `json:"mobile_masked,omitempty"` // 脱敏手机号,如 139****0001
|
||
}
|
||
|
||
// ========== 认证相关响应 ==========
|
||
|
||
// RegisterResponseDTO 注册响应
|
||
type RegisterResponseDTO struct {
|
||
AccessToken string `json:"access_token"`
|
||
ExpiresIn int64 `json:"expires_in"`
|
||
User UserWithIdentityDTO `json:"user"`
|
||
}
|
||
|
||
// LoginResponseDTO 登录响应
|
||
type LoginResponseDTO struct {
|
||
AccessToken string `json:"access_token"`
|
||
ExpiresIn int64 `json:"expires_in"`
|
||
RefreshToken string `json:"refresh_token,omitempty"`
|
||
User UserWithIdentityDTO `json:"user"`
|
||
}
|
||
|
||
// GetMeResponseDTO 获取当前用户响应
|
||
type GetMeResponseDTO struct {
|
||
UID int64 `json:"uid"`
|
||
Nickname string `json:"nickname"`
|
||
AvatarURL string `json:"avatar_url,omitempty"`
|
||
ChainAddress string `json:"chain_address,omitempty"`
|
||
CurrentIdentity CurrentIdentityDTO `json:"current_identity"`
|
||
}
|
||
|
||
// ========== 个人信息相关响应 ==========
|
||
|
||
// ProfileResponseDTO 个人信息页响应
|
||
type ProfileResponseDTO struct {
|
||
UID int64 `json:"uid"`
|
||
Nickname string `json:"nickname"`
|
||
ChainAddress string `json:"chain_address,omitempty"`
|
||
FanIdentity FanIdentityDTO `json:"fan_identity"`
|
||
FanLevel int32 `json:"fan_level"`
|
||
StarbookLimit int32 `json:"starbook_limit"`
|
||
SlotLimit int32 `json:"slot_limit"`
|
||
AssetsNum int32 `json:"assets_num"`
|
||
CrystalBalance int64 `json:"crystal_balance"`
|
||
}
|
||
|
||
// UpdateNicknameResponseDTO 更新昵称响应
|
||
type UpdateNicknameResponseDTO struct {
|
||
Nickname string `json:"nickname"`
|
||
}
|
||
|
||
// ========== 粉丝身份相关响应 ==========
|
||
|
||
// FanIdentityListItemDTO 粉丝身份列表项
|
||
type FanIdentityListItemDTO struct {
|
||
StarID int64 `json:"star_id"` // 88(star 的主键 ID,用于切换身份)
|
||
IdentityID string `json:"identity_id"` // "wyb"
|
||
Name string `json:"name"` // "王一博"
|
||
Tag string `json:"tag"` // "小摩托"
|
||
PicURL string `json:"pic_url,omitempty"`
|
||
}
|
||
|
||
// FanIdentityListResponseDTO 粉丝身份列表响应(所有可用明星)
|
||
type FanIdentityListResponseDTO struct {
|
||
Items []FanIdentityListItemDTO `json:"items"`
|
||
Total int `json:"total"`
|
||
}
|
||
|
||
// MyFanIdentityItemDTO 我的粉丝身份项
|
||
type MyFanIdentityItemDTO struct {
|
||
StarID int64 `json:"star_id"` // 明星ID
|
||
IdentityID string `json:"identity_id"` // 身份ID(如 "xz")
|
||
StarName string `json:"star_name"` // 明星名称
|
||
StarTag string `json:"star_tag"` // 明星标签
|
||
Nickname string `json:"nickname"` // 用户昵称
|
||
Level int32 `json:"level"` // 等级
|
||
Experience int64 `json:"experience"` // 经验值
|
||
CrystalBalance int64 `json:"crystal_balance"` // 水晶余额
|
||
IsActive bool `json:"is_active"` // 是否激活(当前使用)
|
||
}
|
||
|
||
// MyFanIdentitiesResponseDTO 我的粉丝身份列表响应
|
||
type MyFanIdentitiesResponseDTO struct {
|
||
Items []MyFanIdentityItemDTO `json:"items"`
|
||
Total int `json:"total"`
|
||
CurrentStarID int64 `json:"current_star_id"` // 当前激活的明星ID
|
||
}
|
||
|
||
// AddIdentityResponseDTO 添加身份响应
|
||
type AddIdentityResponseDTO struct {
|
||
Bound bool `json:"bound"`
|
||
IdentityID string `json:"identity_id"`
|
||
}
|
||
|
||
// SwitchIdentityResponseDTO 切换身份响应
|
||
type SwitchIdentityResponseDTO struct {
|
||
AccessToken string `json:"access_token"`
|
||
ExpiresIn int64 `json:"expires_in"`
|
||
CurrentIdentity CurrentIdentityDTO `json:"current_identity"`
|
||
}
|