This commit is contained in:
toom1996
2026-09-02 21:51:35 +08:00
parent 2562fc4aaa
commit 1fd9c48f58
22 changed files with 908 additions and 30 deletions

27
internal/dto/favorite.go Normal file
View File

@ -0,0 +1,27 @@
package dto
// ---------- 收藏 ----------
// FavoriteItem 对外返回的收藏项:id 即 target_uid,便于前端直接比对卡片 id。
type FavoriteItem struct {
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
Cover string `json:"cover"`
Brand string `json:"brand"`
AddedAt uint32 `json:"added_at"`
}
// FavoriteAdd 添加收藏请求体。target_uid 为前端卡片的 it.id(编码串)。
type FavoriteAdd struct {
TargetType string `json:"target_type" binding:"required"` // runway | street
TargetUID string `json:"target_uid" binding:"required"`
Title string `json:"title"`
Cover string `json:"cover"`
Brand string `json:"brand"`
}
// FavoriteCheck 批量查询哪些 target_uid 已收藏(列表页打勾用,与收藏总量解耦)。
type FavoriteCheck struct {
IDs []string `json:"ids" binding:"required"`
}

15
internal/dto/history.go Normal file
View File

@ -0,0 +1,15 @@
package dto
// ---------- 浏览历史 ----------
// HistoryItem 对外返回的浏览历史项:id 即 target_uid(带 r=/s= 前缀的对外编码串)。
// 前端据此判断类型(s= 街拍,其余走秀)并回查公开详情接口取标题/封面用于渲染。
type HistoryItem struct {
ID string `json:"id"`
ViewedAt uint32 `json:"viewed_at"`
}
// HistoryAdd 记录一次浏览请求体:打开某篇文章详情时上报其对外编码串 id。
type HistoryAdd struct {
TargetUID string `json:"target_uid" binding:"required"`
}