chore: 去掉未上线前的旧兼容垫片,板块流收口到首页

鉴权只认 cookie、SEO 只走 Next、sort 与推荐对齐;删除 Bearer、Go sitemap、post_type 回填等冗余路径。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-16 05:04:47 +08:00
parent 0e61a14ea3
commit 833bcd33a1
33 changed files with 715 additions and 548 deletions

View File

@@ -54,14 +54,13 @@ const (
ContentStatusRejected = "rejected"
)
// 帖子类型(discussion 为默认;兼容旧值 normal → discussion)
// 帖子类型(discussion 为默认)
const (
PostTypeDiscussion = "discussion" // 讨论(默认)
PostTypeQuestion = "question" // 问答
PostTypePoll = "poll" // 投票
PostTypeBounty = "bounty" // 悬赏
PostTypeLottery = "lottery" // 抽奖
PostTypeNormal = "normal" // 旧值,读取时归一为 discussion
)
// ValidPostType 发帖类型白名单
@@ -73,11 +72,8 @@ func ValidPostType(t string) bool {
return false
}
// NormalizePostType 归一化类型(空/旧 normal → discussion)
// NormalizePostType 归一化类型(空或未知 → discussion)
func NormalizePostType(t string) string {
if t == "" || t == PostTypeNormal {
return PostTypeDiscussion
}
if ValidPostType(t) {
return t
}