Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
谢宇宁
2026-09-29 11:47:47 +07:00
co-authored by Claude Opus 5.5
commit 0fbdba5ccf
622 changed files with 72105 additions and 0 deletions
@@ -0,0 +1,36 @@
package playletser
import (
"strconv"
"strings"
)
func todayUpdatePageURL(pageNum int) string {
if pageNum <= 1 {
return "/recently-added"
}
return "/recently-added/page/" + strconv.Itoa(pageNum)
}
func TodayUpdateCanonicalPath(q TodayUpdateQuery) string {
q.Normalize()
return todayUpdatePageURL(q.PageNum)
}
// BuildTodayUpdatePagination 今日更新分页。
func BuildTodayUpdatePagination(q TodayUpdateQuery, totalCount int64) PaginationVM {
q.Normalize()
return BuildPagination(func(p int) string {
return todayUpdatePageURL(p)
}, q.PageNum, q.PageSize, totalCount)
}
// ParseTodayUpdateQuery 从 query 解析分页。
func ParseTodayUpdateQuery(pageStr string) TodayUpdateQuery {
q := TodayUpdateQuery{PageSize: defaultTodayUpdateSize}
if n, err := strconv.Atoi(strings.TrimSpace(pageStr)); err == nil {
q.PageNum = n
}
q.Normalize()
return q
}