init: web_hgcg_server 初始化提交

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 16:44:55 +08:00
co-authored by Claude Opus 4.7
commit 189556e702
627 changed files with 126228 additions and 0 deletions
+568
View File
@@ -0,0 +1,568 @@
package proto
import (
"time"
"videoweb/pub/pubdef"
)
// HomePlayletResponse 首页响应
type HomePlayletResponse struct {
HomeBannerData []*CommonData `json:"homeBannerData"` // 首页banner短剧信息列表
HomeConfigData []*HomeConfigData `json:"homeConfigData"` // 首页配置集合
HotSearch []PlayletHotSearchItem `json:"hotSearch"` // 大家都在搜,按搜索次数排序,最多15个
Announcements []*AnnouncementItem `json:"announcements"` // 启用中的公告,来自独立缓存
Advitise AdvitiseData `json:"advitise"` // 广告
SeoInfo *SeoInfo `json:"seoInfo,omitempty"` // 页面SEO信息(短剧列表页SEO)
}
// HomeConfigData 首页配置数据
type HomeConfigData struct {
Id int64 `json:"id"` // ID
MoreCategoryId int64 `json:"moreCategoryId"` // “更多”跳转导航分类ID
MoreUrl string `json:"moreUrl"` // “更多”跳转地址,空表示不展示
Name string `json:"name"` // 名称
Slug string `json:"slug"` // slug,H5 更多页优先用它
Desc string `json:"desc"` // 描述
Type int32 `json:"type"` // 类型 1-短剧 3-题材
Rank int64 `json:"rank"` // 排序,越大越靠前
SortType int32 `json:"sortType"` // 排序字段 1-推荐 2-热播 3-最近更新 4-新片预告 5-分类
Status bool `json:"status"` // 上下架状态 true-上架 false-下架
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 修改时间
List []*CommonData `json:"list"` // 配置对应短剧集合,type=1时返回
ThemeList []*HomeConfigThemeData `json:"themeList"` // 题材集合,type=3时返回
SeoInfo pubdef.SeoValue `json:"seoInfo"` // Seo相关信息
}
// HomeConfigThemeData 首页配置题材数据
type HomeConfigThemeData struct {
Id int64 `json:"id"` // 题材ID
Name string `json:"name"` // 题材名称
Slug string `json:"slug"` // 题材slug
Icon string `json:"icon"` // 题材图标,已拼接图片域名
Rank int64 `json:"rank"` // 排序,越大越靠前
PlayletCount int64 `json:"playletCount"` // 绑定短剧数量
List []*CommonData `json:"list"` // 题材下短剧集合
SeoInfo *SeoInfo `json:"seoInfo"` // 题材对应页面SEO信息
}
// AnnouncementItem 首页公告
type AnnouncementItem struct {
Id int64 `json:"id"` // 公告ID
Title string `json:"title"` // 标题
Content string `json:"content"` // 内容
}
// PlayletAllListReq 全部短剧分页请求
type PlayletAllListReq struct {
pubdef.Page
SortType int64 `form:"sortType" json:"sortType"` // 1-最新更新 2-当前热播 3-独家原创 4-随机推荐,默认1
}
// PlayletAllListResp 全部短剧分页响应
type PlayletAllListResp struct {
TotalCount int64 `json:"totalCount"` // 总共数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []CommonData `json:"list"` // 短剧集合
SeoInfo *SeoInfo `json:"seoInfo,omitempty"` // 页面SEO信息
}
// PlayletHotListReq 热门短剧分页请求
type PlayletHotListReq struct {
pubdef.Page
ExcludePlayletId int64 `form:"excludePlayletId" json:"excludePlayletId"` // 排除的短剧ID,默认不排除
}
// PlayletHotListResp 热门短剧分页响应
type PlayletHotListResp struct {
TotalCount int64 `json:"totalCount"` // 总共数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []CommonData `json:"list"` // 短剧集合
}
// CommonData 首页通用数据
type CommonData struct {
Id int64 `json:"id"` // 短剧id
Status int32 `json:"status"` // 状态: 0下架 1上架
IsFeatured bool `json:"isFeatured"` // 是否爆剧(true-是,false-否)
IsRecommend bool `json:"isRecommend"` // 是否推荐 true-推荐,false-不推荐
IsNew bool `json:"isNew"` // 是否上新,本周内上架为true
OperateType int32 `json:"operateType"` // 运营类型 1-短剧 2-漫剧
ShowOnBanner bool `json:"showOnBanner"` // 是否显示在首页banner
Banner string `json:"banner"` // banner图,已拼接图片域名
OnlineAt time.Time `json:"onlineAt"` // 上架时间
MediaCreatedAt time.Time `json:"mediaCreatedAt"` // 媒资中心创建时间
MediaUpdatedAt time.Time `json:"mediaUpdatedAt"` // 媒资中心更新时间
ThemeIds []int64 `json:"themeIds"` // 题材ID集合
ThemeNames []string `json:"themeNames"` // 题材名称集合
ThemeSlugs []string `json:"themeSlugs"` // 题材slug集合
CategoryIds []int64 `json:"categoryIds"` // 分类ID集合
Title string `json:"title"` // 标题
Description string `json:"description"` // SEO Description
Slug string `json:"slug"` // slug
Desc string `json:"desc"` // 简介
Anchor string `json:"anchor"` // 作者/演员
Cover string `json:"cover"` // 竖版封面,已拼接图片域名
HorizontalCover string `json:"horizontalCover"` // 横版封面,已拼接图片域名
Preview string `json:"preview"` // 预告地址,详情接口返回时带播放签名
TagIds []int64 `json:"tagIds"` // 标签ID集合
TagNames []string `json:"tagNames"` // 标签名称集合
TagSlugs []string `json:"tagSlugs"` // 标签slug集合
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"` // 点赞数,包含真实点赞数和后台虚拟点赞数
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 修改时间
SeoInfo pubdef.SeoValue `json:"seoInfo"` // Seo相关信息
}
// PlayletHotRankListReq 热榜分页请求
type PlayletHotRankListReq struct {
pubdef.Page
RankType int64 `form:"rankType" json:"rankType"` // 榜单类型 1-热播榜 2-新剧榜 3-追剧榜
}
// PlayletHotRankListResp 热榜分页响应
type PlayletHotRankListResp struct {
TotalCount int64 `json:"totalCount"` // 总共数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
RankType int64 `json:"rankType"` // 榜单类型 1-热播榜 2-新剧榜 3-追剧榜
List []CommonData `json:"list"` // 短剧集合
SeoInfo *SeoInfo `json:"seoInfo,omitempty"` // 页面SEO信息
}
// PlayletGuessLikeListReq 猜你喜欢分页请求
type PlayletGuessLikeListReq struct {
// 普通分页参数,pageNum默认1,pageSize默认6、最大100
pubdef.Page
PlayletId int64 `form:"playletId" json:"playletId" binding:"required"` // 当前短剧ID
}
// PlayletGuessLikeListResp 猜你喜欢分页响应
type PlayletGuessLikeListResp struct {
TotalCount int64 `json:"totalCount"` // 总共数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []CommonData `json:"list"` // 猜你喜欢短剧集合
}
// PlayletTagVideoReq 根据标签ID分页查询短剧请求
type PlayletTagVideoReq struct {
// 普通分页参数,pageNum默认1,pageSize默认10、最大100
pubdef.Page
TagId int64 `form:"tagId" json:"tagId"` // 标签ID,tagSlug为空时必传
TagSlug string `form:"tagSlug" json:"tagSlug"` // 标签slug,非空时优先按slug解析标签ID
SortType int64 `form:"sortType" json:"sortType"` // 排序 1-最新 2-最热 3-收藏最多
}
// PlayletTagVideoResp 根据标签ID分页查询短剧响应
type PlayletTagVideoResp struct {
TotalCount int64 `json:"totalCount"` // 总共数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []CommonData `json:"list"` // 短剧集合
SeoInfo *SeoInfo `json:"seoInfo,omitempty"` // 页面SEO信息(标签SEO)
}
// PlayletSearchReq 短剧ES分页搜索请求
type PlayletSearchReq struct {
// 普通分页参数,pageNum默认1,pageSize默认10、最大100
pubdef.Page
Keyword string `form:"keyword" json:"keyword"` // 搜索关键词,支持剧名、题材名、简介和标签名
}
// PlayletSearchResp 短剧ES分页搜索响应
type PlayletSearchResp struct {
TotalCount int64 `json:"totalCount"` // 总共数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
Keyword string `json:"keyword"` // 搜索词
List []CommonData `json:"list"` // 搜索结果
EveryoneWatching []*CommonData `json:"everyoneWatching"` // 大家都在看,搜索无结果时返回
}
// PlayletSearchSuggestReq 短剧搜索联想请求
type PlayletSearchSuggestReq struct {
Keyword string `form:"keyword" json:"keyword" binding:"required"` // 搜索关键词
}
// PlayletSearchSuggestResp 短剧搜索联想响应
type PlayletSearchSuggestResp struct {
Keyword string `json:"keyword"` // 搜索关键词
List []CommonData `json:"list"` // 短剧列表
}
// PlayletHotSearchItem 热搜词
type PlayletHotSearchItem struct {
Keyword string `json:"keyword"` // 搜索词
Count int64 `json:"count"` // 搜索次数
}
// PlayletHotLikeResp 热搜词和猜你喜欢
type PlayletHotLikeResp struct {
HotSearch []PlayletHotSearchItem `json:"hotSearch"` // 前10个热搜词
GuessLike []*CommonData `json:"guessLike"` // 按收藏量最多的15部上架短剧
}
// PlayletLikeSetReq 短剧点赞设置请求
type PlayletLikeSetReq struct {
Id int64 `json:"id" binding:"required"` // 短剧ID
IsLike *bool `json:"isLike" binding:"required"` // 是否点赞,true-点赞,false-取消点赞
}
// PlayletLikeSetResp 短剧点赞设置响应
type PlayletLikeSetResp struct {
Id int64 `json:"id"` // 短剧ID
IsLike int64 `json:"isLike"` // 点赞状态 1-已点赞 2-未点赞
CountLike int64 `json:"countLike"` // 短剧点赞数
}
// PlayletLikeListReq 我的点赞短剧分页请求
type PlayletLikeListReq struct {
pubdef.Page
}
// PlayletLikeData 我的点赞短剧列表项
type PlayletLikeData struct {
CommonData
IsLike int64 `json:"isLike"` // 点赞状态,固定为1
LikedAt time.Time `json:"likedAt"` // 点赞时间
}
// PlayletLikeListResp 我的点赞短剧分页响应
type PlayletLikeListResp struct {
TotalCount int64 `json:"totalCount"` // 总共数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []PlayletLikeData `json:"list"` // 点赞短剧集合
}
// PlayletCollectSetReq 短剧收藏设置请求
type PlayletCollectSetReq struct {
Id int64 `json:"id" binding:"required"` // 短剧ID
IsCollect *bool `json:"isCollect" binding:"required"` // 是否收藏,true-收藏,false-取消收藏
}
// PlayletCollectSetResp 短剧收藏设置响应
type PlayletCollectSetResp struct {
Id int64 `json:"id"` // 短剧ID
IsCollect int64 `json:"isCollect"` // 收藏状态 1-已收藏 2-未收藏
CountCollect int64 `json:"countCollect"` // 短剧收藏数
}
// PlayletForwardHeatReq 短剧转发加热度请求
type PlayletForwardHeatReq struct {
Id int64 `json:"id" binding:"required"` // 短剧ID
}
// PlayletForwardHeatResp 短剧转发加热度响应
type PlayletForwardHeatResp struct {
Id int64 `json:"id"` // 短剧ID
HeatValue int64 `json:"heatValue"` // 加热后的热度值
}
// PlayletCollectListReq 我的收藏列表请求
type PlayletCollectListReq struct {
// 普通分页参数,pageNum默认1,pageSize默认10、最大100
pubdef.Page
WatchStatus int64 `form:"watchStatus" json:"watchStatus"` // 观看状态 0-全部 1-追剧中 2-已看完
}
// PlayletCollectData 我的收藏列表项
type PlayletCollectData struct {
Id int64 `json:"id"` // 短剧ID
Title string `json:"title"` // 标题
Slug string `json:"slug"` // slug
Cover string `json:"cover"` // 封面,已拼接图片域名
ThemeIds []int64 `json:"themeIds"` // 题材ID集合
ThemeNames []string `json:"themeNames"` // 题材名称集合
ThemeSlugs []string `json:"themeSlugs"` // 题材slug集合
TagIds []int64 `json:"tagIds"` // 标签ID集合
TagNames []string `json:"tagNames"` // 标签名称集合
TagSlugs []string `json:"tagSlugs"` // 标签slug集合
TotalEpisode int64 `json:"totalEpisode"` // 总集数
UpdateStatus int `json:"updateStatus"` // 更新状态 1-连载中 2-已完结
CountBrowse int64 `json:"countBrowse"` // 观看量
HeatValue int64 `json:"heatValue"` // 热度值
CountCollect int64 `json:"countCollect"` // 收藏数
IsCollect int64 `json:"isCollect"` // 收藏状态,收藏列表固定返回1-已收藏
CollectedAt time.Time `json:"collectedAt"` // 收藏时间
WatchedCount int64 `json:"watchedCount"` // 当前用户已看集数
UnwatchedCount int64 `json:"unwatchedCount"` // 当前用户未看集数,按totalEpisode-watchedCount计算
LastChapterId int64 `json:"lastChapterId"` // 最近观看剧集ID,无观看进度时为0
LastEpisode int64 `json:"lastEpisode"` // 最近观看集数,无观看进度时为0
SeoInfo pubdef.SeoValue `json:"seoInfo"` // Seo相关信息
}
// PlayletCollectListResp 我的收藏列表响应
type PlayletCollectListResp struct {
TotalCount int64 `json:"totalCount"` // 总收藏数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []PlayletCollectData `json:"list"` // 收藏短剧集合
}
// PlayletBoughtListReq 我的已购短剧列表请求
type PlayletBoughtListReq struct {
// 普通分页参数,pageNum默认1,pageSize默认10、最大100
pubdef.Page
}
// PlayletBoughtData 我的已购短剧列表项
type PlayletBoughtData struct {
CommonData
BoughtChapterCount int64 `json:"boughtChapterCount"` // 已购剧集数量
CostCoins int64 `json:"costCoins"` // 已消耗金币
BoughtAt time.Time `json:"boughtAt"` // 最近购买时间
LastChapterId int64 `json:"lastChapterId"` // 最近观看剧集ID,无观看进度时为0
LastEpisode int64 `json:"lastEpisode"` // 最近观看集数,无观看进度时为0
WatchedCount int64 `json:"watchedCount"` // 当前用户已看集数
UnwatchedCount int64 `json:"unwatchedCount"` // 当前用户未看集数,按totalEpisode-watchedCount计算
IsFinished bool `json:"isFinished"` // 当前用户是否已看完
}
// PlayletBoughtListResp 我的已购短剧列表响应
type PlayletBoughtListResp struct {
TotalCount int64 `json:"totalCount"` // 总已购短剧数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []PlayletBoughtData `json:"list"` // 已购短剧集合
}
// PlayletHistoryListReq 观看历史列表请求
type PlayletHistoryListReq struct {
// 普通分页参数,pageNum默认1,pageSize默认20、最大100
pubdef.Page
}
// PlayletHistoryData 观看历史列表项
type PlayletHistoryData struct {
CommonData
LastChapterId int64 `json:"lastChapterId"` // 最近观看剧集ID
LastEpisode int64 `json:"lastEpisode"` // 最近观看集数
WatchedCount int64 `json:"watchedCount"` // 当前用户已看集数
UnwatchedCount int64 `json:"unwatchedCount"` // 当前用户未看集数
IsFinished bool `json:"isFinished"` // 是否已看完
HistoryAt string `json:"historyAt"` // 最近观看时间
}
// PlayletHistoryListResp 观看历史列表响应
type PlayletHistoryListResp struct {
TotalCount int64 `json:"totalCount"` // 总历史数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []PlayletHistoryData `json:"list"` // 观看历史集合
}
// PlayletHistoryDeleteReq 删除单条观看历史请求
type PlayletHistoryDeleteReq struct {
PlayletId int64 `json:"playletId" binding:"required"` // 短剧ID
}
// PlayletHistoryDeleteResp 删除单条观看历史响应
type PlayletHistoryDeleteResp struct {
DeletedCount int64 `json:"deletedCount"` // 删除记录数量
}
// PlayletHistoryClearResp 清空观看历史响应
type PlayletHistoryClearResp struct {
DeletedCount int64 `json:"deletedCount"` // 删除记录数量
}
// PlayletChapterLikeSetReq 短剧剧集点赞设置请求
type PlayletChapterLikeSetReq struct {
ChapterId int64 `json:"chapterId" binding:"required"` // 短剧剧集ID
IsLike *bool `json:"isLike" binding:"required"` // 是否点赞,true-点赞,false-取消点赞
}
// PlayletChapterLikeSetResp 短剧剧集点赞设置响应
type PlayletChapterLikeSetResp struct {
ChapterId int64 `json:"chapterId"` // 短剧剧集ID
IsLike int64 `json:"isLike"` // 点赞状态 1-已点赞 2-未点赞
CountLike int64 `json:"countLike"` // 短剧剧集点赞数
}
// PlayletChapterCollectSetReq 短剧剧集收藏设置请求
type PlayletChapterCollectSetReq struct {
ChapterId int64 `json:"chapterId" binding:"required"` // 短剧剧集ID
IsCollect *bool `json:"isCollect" binding:"required"` // 是否收藏,true-收藏,false-取消收藏
}
// PlayletChapterCollectSetResp 短剧剧集收藏设置响应
type PlayletChapterCollectSetResp struct {
ChapterId int64 `json:"chapterId"` // 短剧剧集ID
IsCollect int64 `json:"isCollect"` // 收藏状态 1-已收藏 2-未收藏
CountCollect int64 `json:"countCollect"` // 短剧剧集收藏数
}
// PlayletChapterCollectListReq 我的剧集收藏列表请求
type PlayletChapterCollectListReq struct {
// 普通分页参数,pageNum默认1,pageSize默认10、最大100
pubdef.Page
}
// PlayletChapterCollectData 我的剧集收藏列表项
type PlayletChapterCollectData struct {
PlayletId int64 `json:"playletId"` // 短剧ID
PlayletTitle string `json:"playletTitle"` // 短剧标题
PlayletCover string `json:"playletCover"` // 短剧封面,已拼接图片域名
TotalEpisode int64 `json:"totalEpisode"` // 短剧总集数
UpdateStatus int `json:"updateStatus"` // 更新状态 1-连载中 2-已完结
ChapterId int64 `json:"chapterId"` // 短剧剧集ID
CurrentEpisode int64 `json:"currentEpisode"` // 第几集
ChapterTitle string `json:"chapterTitle"` // 剧集标题
VideoUrl string `json:"videoUrl"` // 播放地址
MediaTime int64 `json:"mediaTime"` // 影片长度(秒)
PayType int32 `json:"payType"` // 支付方式 0-免费 1-金币 2-VIP
SingleCoins int64 `json:"singleCoins"` // 单集金币
CountBrowse int64 `json:"countBrowse"` // 剧集观看数
CountCollect int64 `json:"countCollect"` // 剧集收藏数
IsCollect int64 `json:"isCollect"` // 收藏状态,收藏列表固定返回1-已收藏
CollectedAt time.Time `json:"collectedAt"` // 收藏时间
}
// PlayletChapterCollectListResp 我的剧集收藏列表响应
type PlayletChapterCollectListResp struct {
TotalCount int64 `json:"totalCount"` // 总收藏数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []PlayletChapterCollectData `json:"list"` // 收藏剧集集合
}
// PlayletChapterWatchReportReq 短剧剧集观看上报请求
type PlayletChapterWatchReportReq struct {
PlayletId int64 `json:"playletId"` // 短剧ID,传入时用于校验剧集归属
ChapterId int64 `json:"chapterId" binding:"required"` // 短剧剧集ID
}
// PlayletChapterWatchReportResp 短剧剧集观看上报响应
type PlayletChapterWatchReportResp struct {
PlayletId int64 `json:"playletId"` // 短剧ID
ChapterId int64 `json:"chapterId"` // 短剧剧集ID
CurrentEpisode int64 `json:"currentEpisode"` // 当前集数
WatchedCount int64 `json:"watchedCount"` // 当前用户已看集数
UnwatchedCount int64 `json:"unwatchedCount"` // 当前用户未看集数
LastChapterId int64 `json:"lastChapterId"` // 最近观看剧集ID
LastEpisode int64 `json:"lastEpisode"` // 最近观看集数
}
// PlayletInfoReq 详情请求
type PlayletInfoReq struct {
Id int64 `form:"id" json:"id"` // 短剧id
Slug string `form:"slug" json:"slug"` // 短剧slug,非空时优先按slug解析短剧ID
}
// PlayletChapterInfoReq 短剧剧集详情请求
type PlayletChapterInfoReq struct {
PlayletId int64 `form:"playletId" json:"playletId"` // 短剧ID,传入时用于校验剧集归属
PlayletSlug string `form:"playletSlug" json:"playletSlug"` // 短剧slug,非空时优先按slug解析短剧ID
ChapterId int64 `form:"chapterId" json:"chapterId" binding:"required"` // 短剧剧集ID
}
// PlayletChapterListReq 短剧剧集列表请求
type PlayletChapterListReq struct {
PlayletId int64 `form:"playletId" json:"playletId"` // 短剧ID
PlayletSlug string `form:"playletSlug" json:"playletSlug"` // 短剧slug,非空时优先按slug解析短剧ID
}
// PlayletChapterListResp 短剧剧集列表响应
type PlayletChapterListResp struct {
PlayletId int64 `json:"playletId"` // 短剧ID
List []PlayletChapterData `json:"list"` // 短剧剧集集合
}
// PlayletChapterInfoResp 短剧剧集详情响应
type PlayletChapterInfoResp struct {
Id int64 `json:"id"` // 短剧剧集ID
PlayletId int64 `json:"playletId"` // 短剧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"` // 影片长度(秒)
CountComment int64 `json:"countComment"` // 短剧剧集评论数
CountBrowse int64 `json:"countBrowse"` // 短剧剧集观看数
CountCollect int64 `json:"countCollect"` // 短剧剧集收藏数
CountLike int64 `json:"countLike"` // 短剧剧集点赞数
IsLike int64 `json:"isLike"` // 点赞状态 1-已点赞 2-未点赞
IsCollect int64 `json:"isCollect"` // 收藏状态 1-已收藏 2-未收藏
PayType int32 `json:"payType"` // 支付方式 0-免费 1-金币 2-VIP
SingleCoins int64 `json:"singleCoins"` // 单集金币(支付方式为1-金币时候生效)
CanWatch bool `json:"canWatch"` // 是否可观看
NeedUnlock bool `json:"needUnlock"` // 是否需要金币解锁
NeedVip bool `json:"needVip"` // 是否需要开通VIP
CostCoins int64 `json:"costCoins"` // 本次解锁消耗金币
Balance int64 `json:"balance"` // 当前金币余额
VipValid bool `json:"vipValid"` // 当前用户VIP是否有效
IsUnlocked bool `json:"isUnlocked"` // 当前用户是否已解锁本集
// 页面SEO信息
SeoInfo *SeoInfo `json:"seoInfo,omitempty"`
}
// PlayletChapterUnlockReq 短剧剧集金币解锁请求
type PlayletChapterUnlockReq struct {
PlayletId int64 `json:"playletId" binding:"required"` // 短剧ID
ChapterId int64 `json:"chapterId" binding:"required"` // 短剧剧集ID
}
// PlayletChapterUnlockResp 短剧剧集金币解锁响应
type PlayletChapterUnlockResp struct {
PlayletId int64 `json:"playletId"` // 短剧ID
ChapterId int64 `json:"chapterId"` // 短剧剧集ID
Unlocked bool `json:"unlocked"` // 是否已解锁
CanWatch bool `json:"canWatch"` // 是否可观看
Balance int64 `json:"balance"` // 当前金币余额
CostCoins int64 `json:"costCoins"` // 本次解锁消耗金币
ChangeCoin int64 `json:"changeCoin"` // 本次实际扣减金币,幂等命中时为0
}
// PlayletInfoResp 详情响应
type PlayletInfoResp struct {
CommonData
// 是否点赞(1-已点赞,2-未点赞)
IsLike int64 `json:"isLike"`
// 是否收藏(1-已收藏,2-未收藏)
IsCollect int64 `json:"isCollect"`
// 短剧章节集合
PlayletChapterInfo []PlayletChapterData `json:"playletChapterInfo"`
// 页面SEO信息
SeoInfo *SeoInfo `json:"seoInfo,omitempty"`
// 广告
Advitise AdvitiseData `json:"advitise"`
}
// PlayletChapterData 短剧章节信息
type PlayletChapterData struct {
Id int64 `json:"id"` // 短剧剧集ID
PlayletId int64 `json:"playletId"` // 短剧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"` // 影片长度(秒)
PayType int32 `json:"payType"` // 支付方式 0-免费 1-金币 2-VIP
SingleCoins int64 `json:"singleCoins"` // 单集金币(支付方式为1-金币时候生效)
CanWatch bool `json:"canWatch"` // 是否可观看
NeedUnlock bool `json:"needUnlock"` // 是否需要金币解锁
NeedVip bool `json:"needVip"` // 是否需要开通VIP
CostCoins int64 `json:"costCoins"` // 本次解锁消耗金币
Balance int64 `json:"balance"` // 当前金币余额
VipValid bool `json:"vipValid"` // 当前用户VIP是否有效
IsUnlocked bool `json:"isUnlocked"` // 当前用户是否已解锁本集
}