Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
package commod
type SortType int
// 1、最新,2、最热/推荐,3、最多播放,4、十分钟以上视频, 5、精华/精选,6、视频 7-最多收藏 8、解锁次数 9、最新热评
const (
New SortType = 1 // 最新上架
MostHot SortType = 2 // 热门推荐
MostWatch SortType = 3 // 最多观看
MostCollect SortType = 7 // 最多收藏
HotComment SortType = 9 // 最新热评
)
var nameMap = map[SortType]string{
New: "最新上架",
MostHot: "热门推荐",
MostWatch: "最多观看",
HotComment: "最新热评",
MostCollect: "最多收藏",
}
func (s SortType) Name() string {
name, ok := nameMap[s]
if !ok {
return "未知排序"
}
return name
}
func (s SortType) Item() SortItemData {
item := SortItemData{
Value: s,
Name: "未知排序",
}
name, ok := nameMap[s]
if !ok {
return item
}
item.Name = name
return item
}
type SortItemData struct {
Value SortType `json:"value"`
Name string `json:"name"`
}
// WebSortRules 后台支持修改的排序规则
var WebSortRules = map[string][]SortItemData{
"acgSort": {
New.Item(),
MostHot.Item(),
MostWatch.Item(),
MostCollect.Item(),
HotComment.Item(),
},
"videoSort": {
New.Item(),
MostHot.Item(),
MostWatch.Item(),
MostCollect.Item(),
HotComment.Item(),
},
}