- 新增 GET /api/v1/me/liked-assets 接口 - 新增 GET /api/v1/me/exhibited-assets 接口 - 新增 GetMyLikedAssets 和 GetMyExhibitedAssets RPC 方法 - 新增 ExhibitedAssetItemDTO 和 GetMyExhibitedAssetsResponseDTO - 前端新增 getUserLikedAssetsApi 和 getUserExhibitedAssetsApi(暂不实现) - 更新设计文档,标记他人作品统计接口为暂不实现 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
93 lines
4.8 KiB
Go
93 lines
4.8 KiB
Go
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"` // 是否有更多
|
||
}
|