topfans/backend/gateway/dto/gallery_dto.go
2026-04-07 22:29:48 +08:00

73 lines
3.8 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"` // 水晶余额(如果使用水晶购买,显示扣除后的余额)
}