topfans/backend/gateway/dto/response_dto.go
2026-04-08 10:59:46 +08:00

135 lines
5.3 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 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"` // 88star 的主键 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"`
}