topfans/backend/gateway/dto/gallery_dto.go
2026-05-07 14:07:36 +08:00

114 lines
5.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 dto
// ========== 展馆相关请求 ==========
// PlaceAssetRequestDTO 放置资产请求
type PlaceAssetRequestDTO struct {
AssetID int64 `json:"asset_id" binding:"required"` // 资产ID必填
GalleryOwnerID int64 `json:"gallery_owner_id" binding:"required"` // 展馆所有者ID必填
SlotID int64 `json:"slot_id" binding:"required"` // 展位ID必填
}
// ========== 展馆相关响应 ==========
// GetMyGalleryResponseDTO 获取我的展馆响应
type GetMyGalleryResponseDTO struct {
GalleryOwnerID int64 `json:"gallery_owner_id"` // 展馆所有者ID
SlotTotal int32 `json:"slot_total"` // 展位总数
Slots []SlotInfoDTO `json:"slots"` // 展位列表
Nickname string `json:"nickname"` // 展馆所有者昵称
}
// GetUserGalleryResponseDTO 获取他人展馆响应(与我的展馆响应相同)
type GetUserGalleryResponseDTO struct {
GalleryOwnerID int64 `json:"gallery_owner_id"` // 展馆所有者ID
SlotTotal int32 `json:"slot_total"` // 展位总数
Slots []SlotInfoDTO `json:"slots"` // 展位列表
Nickname string `json:"nickname"` // 展馆所有者昵称
}
// SlotInfoDTO 展位信息
type SlotInfoDTO struct {
SlotID int64 `json:"slot_id"` // 展位ID
SlotIndex int32 `json:"slot_index"` // 展位序号
Status string `json:"status"` // 状态EMPTY, OCCUPIED, LOCKED
IsEnabled bool `json:"is_enabled"` // 是否已解锁
Visibility string `json:"visibility"` // public / private
Asset *AssetInfoDTO `json:"asset,omitempty"` // 展品信息仅当status为OCCUPIED时存在
OccupierUID int64 `json:"occupier_uid,omitempty"` // 占位者用户ID仅当status为OCCUPIED时存在
OccupiedAt int64 `json:"occupied_at,omitempty"` // 占用开始时间毫秒时间戳仅当status为OCCUPIED时存在
ExpireAt int64 `json:"expire_at,omitempty"` // 占用过期时间毫秒时间戳仅当status为OCCUPIED时存在
UnlockCondition *UnlockConditionDTO `json:"unlock_condition,omitempty"` // 解锁条件仅当status为LOCKED时存在
CanOperate bool `json:"can_operate"` // 当前用户是否可以操作此展位
Operation string `json:"operation"` // 操作类型: "place" | "remove" | "none"
}
// AssetInfoDTO 资产信息(展馆展示用)
type AssetInfoDTO struct {
AssetID int64 `json:"asset_id"` // 资产ID
Name string `json:"name"` // 资产名称
CoverURL string `json:"cover_url"` // 封面图URL
LikeCount int32 `json:"like_count"` // 点赞数
RemainTime int64 `json:"remain_time"` // 剩余时间(秒)
}
// UnlockConditionDTO 解锁条件
type UnlockConditionDTO struct {
Type string `json:"type"` // 解锁类型level等级, crystal水晶
Value int32 `json:"value"` // 解锁条件值(等级或水晶数量)
}
// PlaceAssetResponseDTO 放置资产响应
type PlaceAssetResponseDTO struct {
Status string `json:"status"` // 状态OCCUPIED
OccupiedUntil string `json:"occupied_until"` // 占用到期时间ISO 8601格式
OccupierUID int64 `json:"occupier_uid"` // 占位者用户ID
}
// UnlockSlotResponseDTO 解锁展位响应
type UnlockSlotResponseDTO struct {
SlotTotal int32 `json:"slot_total"` // 展位总数
CrystalBalance int64 `json:"crystal_balance"` // 水晶余额(如果使用水晶购买,显示扣除后的余额)
}
// ExhibitedAssetItemDTO 展出的作品项
type ExhibitedAssetItemDTO struct {
AssetID int64 `json:"asset_id"` // 资产ID
Name string `json:"name"` // 藏品名称
CoverURL string `json:"cover_url"` // 封面图URL
LikeCount int32 `json:"like_count"` // 实时点赞数
ExhibitedAt int64 `json:"exhibited_at"` // 展出开始时间(毫秒时间戳)
ExpireAt int64 `json:"expire_at"` // 展出过期时间(毫秒时间戳)
Earnings int64 `json:"earnings"` // 当前可领取收益
}
// GetMyExhibitedAssetsResponseDTO 获取我展出的作品列表响应
type GetMyExhibitedAssetsResponseDTO struct {
Items []*ExhibitedAssetItemDTO `json:"items"` // 作品列表
Page int32 `json:"page"` // 当前页码
PageSize int32 `json:"page_size"` // 每页数量
Total int64 `json:"total"` // 总数量
HasMore bool `json:"has_more"` // 是否有更多
}
// ========== 灵感瀑布相关 ==========
// InspirationFlowItemDTO 灵感瀑布藏品项
type InspirationFlowItemDTO struct {
AssetID int64 `json:"asset_id"` // 资产ID
Name string `json:"name"` // 藏品名称
CoverURL string `json:"cover_url"` // 封面图URL
LikeCount int32 `json:"like_count"` // 点赞数
OwnerNickname string `json:"owner_nickname"` // 展出者昵称
Span int32 `json:"span"` // 卡片大小: 0-30→1, 31-100→2, 101-200→3, 200+→4
MaterialType string `json:"material_type"` // 素材类型: hot(人气王者), potential(潜力之星), new(新鲜上架)
}
// GetInspirationFlowResponseDTO 获取灵感瀑布藏品列表响应
type GetInspirationFlowResponseDTO struct {
Items []*InspirationFlowItemDTO `json:"items"` // 藏品列表
Cursor string `json:"cursor"` // 下次请求的游标
HasMore bool `json:"has_more"` // 是否有更多
SessionID string `json:"session_id"` // 会话ID
}