Initial commit: web_hghl_server

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 16:28:14 +08:00
co-authored by Claude Opus 4.7
commit 65fca60622
653 changed files with 135901 additions and 0 deletions
+380
View File
@@ -0,0 +1,380 @@
package proto
import (
"time"
"videoweb/pub/common/response"
"videoweb/pub/models/playletchaptermod"
"videoweb/pub/models/playletmod"
"videoweb/pub/pubdef"
"videoweb/pub/storage/proxy"
)
// PlayletRecommendListReq 推荐短剧分页请求
type PlayletRecommendListReq struct {
pubdef.Page
TagId int64 `form:"tagId" json:"tagId"` // 标签ID,不传查询全部标签
TagSlug string `form:"tagSlug" json:"tagSlug"` // 标签slug,非空时优先按slug解析标签ID
CategoryId int64 `form:"categoryId" json:"categoryId"` // 短剧分类ID,不传查询全部分类
CategorySlug string `form:"categorySlug" json:"categorySlug"` // 分类slug,非空时优先按slug解析分类ID
SortList int64 `form:"sortList" json:"sortList"` // 排序方式 1-推荐 2-最新 3-最热
}
// PlayletRecommendSort 推荐短剧排序方式
type PlayletRecommendSort int64
const (
PlayletRecommendSortRecommend PlayletRecommendSort = 1 // 推荐 后台配置 isRecommend=true
PlayletRecommendSortNewest PlayletRecommendSort = 2 // 最新 按短剧最后更新时间从近到远排序
PlayletRecommendSortHot PlayletRecommendSort = 3 // 最热 按短剧累计点击量从高到低排序
)
// PlayletRecommendItemType 推荐短剧列表项类型
type PlayletRecommendItemType int64
const (
PlayletRecommendItemTypePlaylet PlayletRecommendItemType = 0 // 短剧数据
PlayletRecommendItemTypeAdvertise PlayletRecommendItemType = 2 // 广告数据
)
// PlayletRecommendListResp 推荐短剧响应
type PlayletRecommendListResp struct {
response.BasePageResp
}
// PlayletThemeListResp 已启用短剧题材列表响应
type PlayletThemeListResp struct {
List []PlayletThemeItem `json:"list"` // 全部已启用题材
}
// PlayletThemeItem 短剧题材列表项
type PlayletThemeItem struct {
Id int64 `json:"id"` // 题材ID
Name string `json:"name"` // 题材名称
Slug string `json:"slug"` // 题材slug
Icon string `json:"icon"` // 题材图标完整地址
Rank int64 `json:"rank"` // 排序值,越大越靠前
SeoInfo pubdef.SeoValue `json:"seoInfo"` // SEO信息
}
// PlayletGuessListReq 猜你喜欢短剧分页请求
type PlayletGuessListReq struct {
pubdef.Page
Id int64 `form:"id" json:"id"` // 当前短剧ID,可选,传入时排除该短剧
}
// PlayletGuessListResp 猜你喜欢短剧分页响应
type PlayletGuessListResp struct {
response.BasePageResp
}
// PlayletListReq 短剧列表分页请求
type PlayletListReq struct {
pubdef.Page
ThemeId int64 `form:"themeId" json:"themeId"` // 题材 ID,不传查询全部题材
ThemeSlug string `form:"themeSlug" json:"themeSlug"` // 题材 slug,非空时优先于 themeId
SortType int64 `form:"sortType" json:"sortType"` // 排序方式,1 热度优先,2 最近更新,默认 1
}
// PlayletListResp 短剧与广告混排分页响应
type PlayletListResp struct {
response.BasePageResp
Advitise AdvitiseData `json:"advitise"` // 完整广告配置
}
// PlayletContentListReq 短剧或视频分页请求
type PlayletContentListReq struct {
pubdef.Page
DataType int64 `form:"dataType" json:"dataType"` // 数据类型,1 短剧,2 视频,必填
}
// PlayletContentListResp 短剧或视频与广告混排分页响应
type PlayletContentListResp struct {
response.BasePageResp
Advitise AdvitiseData `json:"advitise"` // 完整广告配置,postList 为列表广告
}
// PlayletContentListItem 短剧、视频或广告列表项
type PlayletContentListItem struct {
Type int64 `json:"type"` // 数据类型,0 内容,2 广告
Playlet *PlayletData `json:"playlet,omitempty"` // 短剧数据,dataType 为 1 且 type 为 0 时返回
Video *VideoInfo `json:"video,omitempty"` // 视频数据,dataType 为 2 且 type 为 0 时返回
Advertise *proxy.AdvitiseInfo `json:"advertise,omitempty"` // 广告数据,type 为 2 时返回
}
// PlayletRecommendListItem 推荐短剧列表项,type=0时返回短剧信息,type=2时返回广告信息
type PlayletRecommendListItem struct {
Type PlayletRecommendItemType `json:"type"` // 数据类型 0-短剧数据 2-广告
AdvertiseId string `json:"advertiseId"` // 广告ID,type=2时返回
Link string `json:"link"` // 广告跳转链接,type=2时返回
Location int64 `json:"location"` // 广告位置ID,type=2时返回
PlayletData
}
// LikePlayletReq 点赞或取消点赞短剧请求
type LikePlayletReq struct {
// ID
Id int64 `json:"id" binding:"required"`
// 是否点赞,true-点赞、false-取消点赞
IsLike *bool `json:"isLike" binding:"required"`
}
// LikePlayletResp 点赞或取消点赞短剧响应
type LikePlayletResp struct {
// ID
Id int64 `json:"id"`
// 是否点赞,true-点赞、false-取消点赞
IsLike bool `json:"isLike"`
// 点赞展示数
LikeNum int64 `json:"likeNum"`
}
// QueryLikePlayletListReq 当前用户点赞短剧分页请求
type QueryLikePlayletListReq struct {
pubdef.Page
}
// QueryLikePlayletListResp 当前用户点赞短剧分页响应
type QueryLikePlayletListResp struct {
response.BasePageResp
Translations AppTranslationInfo `json:"translations"` // 导航
BottonTranslations AppTranslationInfo `json:"bottonTranslations"` // 底部翻译
}
// PlayletHistoryListReq 当前用户短剧观看历史分页请求
type PlayletHistoryListReq struct {
pubdef.Page
}
// PlayletHistoryReportReq 播放成功后上报短剧观看历史
type PlayletHistoryReportReq struct {
PlayletID int64 `json:"playletId" binding:"required,gt=0"` // 短剧 ID
ChapterID int64 `json:"chapterId" binding:"required,gt=0"` // 当前播放剧集 ID
}
// PlayletHistoryReportResp 短剧观看历史上报响应
type PlayletHistoryReportResp struct {
WatchedAt time.Time `json:"watchedAt"` // 最近观看时间
}
// PlayletHistoryListResp 当前用户短剧观看历史分页响应
type PlayletHistoryListResp struct {
response.BasePageResp
Translations AppTranslationInfo `json:"translations"` // 导航
BottonTranslations AppTranslationInfo `json:"bottonTranslations"` // 底部翻译
}
// PlayletHistoryItem 短剧观看历史卡片
type PlayletHistoryItem struct {
PlayletData
ChapterID int64 `json:"chapterId"` // 最近观看剧集 ID
Episode int64 `json:"episode"` // 最近观看集数
WatchedAt time.Time `json:"watchedAt"` // 最近观看时间
}
// PlayletHistoryClearResp 清空短剧观看历史响应
type PlayletHistoryClearResp struct {
DeletedCount int64 `json:"deletedCount"` // 删除记录数
}
// FavoritePlayletReq 收藏或取消收藏短剧请求
type FavoritePlayletReq struct {
Id int64 `json:"id" binding:"required"` // 短剧ID
IsFavorite *bool `json:"isFavorite" binding:"required"` // true 收藏 false 取消收藏
}
// FavoritePlayletResp 收藏或取消收藏短剧响应
type FavoritePlayletResp struct {
Id int64 `json:"id"` // 短剧ID
IsFavorite bool `json:"isFavorite"` // 当前收藏状态
CountCollect int64 `json:"countCollect"` // 收藏展示数
}
// QueryFavoritePlayletListReq 当前用户收藏短剧分页请求
type QueryFavoritePlayletListReq struct {
pubdef.Page
}
// QueryFavoritePlayletListResp 当前用户收藏短剧分页响应
type QueryFavoritePlayletListResp struct {
response.BasePageResp
Translations AppTranslationInfo `json:"translations"` // 导航
BottonTranslations AppTranslationInfo `json:"bottonTranslations"` // 底部翻译
}
// PlayletRankReq 短剧排行榜分页请求
type PlayletRankReq struct {
pubdef.Page
// 榜单类型 0-点赞榜 1-周榜 2-月榜 3-年榜
RankPeriod int64 `json:"rankPeriod" form:"rankPeriod"`
}
// PlayletRankPeriod 短剧排行榜类型
type PlayletRankPeriod int64
const (
PlayletRankPeriodLike PlayletRankPeriod = 0 // 点赞榜,按累计点赞量降序,最多50条,不足随机补位
PlayletRankPeriodWeek PlayletRankPeriod = 1 // 周榜,按本周观看量降序,最多50条,不足随机补位
PlayletRankPeriodMonth PlayletRankPeriod = 2 // 月榜,按本月观看量降序,最多50条,不足随机补位
PlayletRankPeriodYear PlayletRankPeriod = 3 // 年榜,按本年观看量降序,最多50条,不足随机补位
)
// PlayletRankResp 短剧排行榜分页响应
type PlayletRankResp struct {
response.BasePageResp
// 导航
Translations AppTranslationInfo `json:"translations"`
// 底部翻译
BottonTranslations AppTranslationInfo `json:"bottonTranslations"`
}
// PlayletRankData 短剧排行榜数据
type PlayletRankData struct {
PlayletData
// 榜单分数,点赞榜为累计展示点赞数,周/月/年榜为对应周期观看数
RankScore int64 `json:"rankScore"`
}
// QueryPlayletInfoReq 短剧详情请求
type QueryPlayletInfoReq struct {
// 短剧ID
Id int64 `json:"id" form:"id"`
// 短剧slug,非空时优先按slug解析短剧ID
Slug string `json:"slug" form:"slug"`
}
// QueryPlayletInfoResp 短剧详情响应
type QueryPlayletInfoResp struct {
FreeEpisodeCount int64 `json:"freeEpisodeCount"` // 官网开放集数 1至1000表示开放第1集到第N集 -1表示开放全集 未配置按2集返回
// 当前路径
Path string `json:"path"`
// 导航
Translations AppTranslationInfo `json:"translations"`
// 配置信息
Config ConfigInfo `json:"config"`
// 底部翻译
BottonTranslations AppTranslationInfo `json:"bottonTranslations"`
// 广告
Advitise AdvitiseData `json:"advitise"`
// 公告
Announcement AnnouncementInfo `json:"announcement"`
// 短剧详情数据
PlayletInfo PlayletDetailInfo `json:"playletInfo"`
// 剧集列表
ChapterList []PlayletChapterInfo `json:"chapterList"`
// 当前登录用户是否已点赞该短剧
IsLike bool `json:"isLike"`
// 当前登录用户是否已收藏该短剧
IsFavorite bool `json:"isFavorite"`
}
// QueryPlayletChapterInfoReq 短剧剧集详情请求
type QueryPlayletChapterInfoReq struct {
// 剧集ID
Id int64 `json:"id" form:"id" binding:"required"`
}
// QueryPlayletChapterInfoResp 短剧剧集详情响应
type QueryPlayletChapterInfoResp struct {
FreeEpisodeCount int64 `json:"freeEpisodeCount"` // 官网开放集数 1至1000表示开放第1集到第N集 -1表示开放全集 未配置按2集返回
// 当前路径
Path string `json:"path"`
// 导航
Translations AppTranslationInfo `json:"translations"`
// 配置信息
Config ConfigInfo `json:"config"`
// 底部翻译
BottonTranslations AppTranslationInfo `json:"bottonTranslations"`
// 广告
Advitise AdvitiseData `json:"advitise"`
// 公告
Announcement AnnouncementInfo `json:"announcement"`
// 当前剧集详情
ChapterInfo PlayletChapterInfo `json:"chapterInfo"`
// 所属短剧详情
PlayletInfo PlayletData `json:"playletInfo"`
// 剧集列表
ChapterList []PlayletChapterInfo `json:"chapterList"`
// 热门短剧列表
HotPlayletList []PlayletData `json:"hotPlayletList"`
// 当前登录用户是否已点赞该短剧
IsLike bool `json:"isLike"`
// 当前登录用户是否已收藏该短剧
IsFavorite bool `json:"isFavorite"`
}
// PlayletDetailInfo 短剧详情数据
type PlayletDetailInfo struct {
PlayletData
// 评论数量
CountComment int64 `json:"countComment"`
// 当前登录用户是否已点赞该短剧
IsLike bool `json:"isLike"`
// 当前登录用户是否已收藏该短剧
IsFavorite bool `json:"isFavorite"`
}
// PlayletChapterInfo 短剧剧集数据
type PlayletChapterInfo struct {
IsOfficialOpen *bool `json:"isOfficialOpen,omitempty"` // 本集是否在官网开放
Id int64 `json:"id"` // 剧集ID
PlayletId int64 `json:"playletId"` // 短剧ID
MediaContentId uint `json:"mediaContentId"` // 媒资中心章节ID
CurrentEpisode int64 `json:"currentEpisode"` // 第几集
Title string `json:"title"` // 章节名
Md5 string `json:"md5"` // 媒体md5
Hash string `json:"hash"` // 媒体hash
Height int64 `json:"height"` // 高
Width int64 `json:"width"` // 宽
Ratio float64 `json:"ratio"` // 宽高比
VideoUrl string `json:"videoUrl"` // 视频播放地址,优先返回水印地址
MediaSize int64 `json:"mediaSize"` // 资源大小
MediaTime int64 `json:"mediaTime"` // 影片长度(秒)
CountBrowse int64 `json:"countBrowse"` // 浏览数
CountCollect int64 `json:"countCollect"` // 收藏数
CountLike int64 `json:"countLike"` // 喜欢数
CountComment int64 `json:"countComment"` // 评论数
PayType playletchaptermod.PayType `json:"payType"` // 支付方式 0-免费 1-金币 2-VIP
SingleCoins int64 `json:"singleCoins"` // 单集金币
WatermarkStatus playletchaptermod.WatermarkStatus `json:"watermarkStatus"` // 水印状态 0-未处理 1-已登记 2-处理中 3-已完成
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 修改时间
}
// PlayletData 短剧数据
type PlayletData struct {
Id int64 `json:"id"` // 短剧id
Status playletmod.Status `json:"status"` // 状态 0-下架 1-上架
IsRecommend bool `json:"isRecommend"` // 是否推荐 true-推荐 false-不推荐
IsNew bool `json:"isNew"` // 是否上新 本周内上架为true
IsFeatured bool `json:"isFeatured"` // 是否爆剧 后台设置
IsOriginal bool `json:"isOriginal"` // 是否原创 后台新增或无媒资中心ID
ShowOriginal bool `json:"showOriginal"` // 页面是否展示原创标识
OnlineAt time.Time `json:"onlineAt"` // 上架时间
MediaCreatedAt time.Time `json:"mediaCreatedAt"` // 媒资中心创建时间
MediaUpdatedAt time.Time `json:"mediaUpdatedAt"` // 媒资中心更新时间
Title string `json:"title"` // 标题
Slug string `json:"slug"` // slug
Desc string `json:"desc"` // 简介
Anchor string `json:"anchor"` // 作者或演员
Cover string `json:"cover"` // 封面,已拼接图片域名
Preview string `json:"preview"` // 预告,已拼接图片域名
TagIds []int64 `json:"tagIds"` // 标签ID集合
TagNames []string `json:"tagNames"` // 标签名称集合
TagSlugs []string `json:"tagSlugs"` // 标签slug集合 与tagNames顺序一致
ThemeIds []int64 `json:"themeIds"` // 题材ID集合
ThemeNames []string `json:"themeNames"` // 题材名称集合
ContentType playletmod.ContentType `json:"contentType"` // 内容类型 0-短剧 1-普通短剧影集 2-漫画短剧 3-动漫 4-漫画
PayType playletmod.PayType `json:"payType"` // 支付方式 0-免费 1-金币 2-VIP
SingleCoins int64 `json:"singleCoins"` // 单集金币,支付方式为金币时生效
TotalEpisode int64 `json:"totalEpisode"` // 总集数
UpdateStatus int `json:"updateStatus"` // 更新状态 1-连载中 2-已完结
CountBrowse int64 `json:"countBrowse"` // 观看展示数
HeatValue int64 `json:"heatValue"` // 热度值
CountCollect int64 `json:"countCollect"` // 收藏展示数
CountLike int64 `json:"countLike"` // 点赞展示数
VirtualCountLike int64 `json:"virtualCountLike"` // 后台虚拟点赞数
DisplayCountLike int64 `json:"displayCountLike"` // 点赞展示数
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 修改时间
SeoInfo pubdef.SeoValue `json:"seoInfo"` // Seo相关信息
}