feat: 帖子分级置顶(板块/全站)与板块管理员置顶权限、消息管理权限调整

This commit is contained in:
2026-10-15 23:35:30 +08:00
parent e7b0686947
commit 47f87a011c
40 changed files with 822 additions and 207 deletions

View File

@@ -226,6 +226,14 @@ type legacyPostRow struct {
func (legacyPostRow) TableName() string { return "posts" }
// legacyPinLevel 旧库 pinned(0/1,非零=全站置顶)映射到新置顶分级:板块置顶为本站新能力,旧数据无此语义
func legacyPinLevel(v int) int {
if v > 0 {
return model.PinGlobal
}
return model.PinNone
}
type legacyCommentRow struct {
ID uint `gorm:"primaryKey"`
PostID uint `gorm:"column:post_id"`
@@ -757,7 +765,7 @@ func (s *LegacyImportService) importPosts(oldDB *gorm.DB, boardMap map[uint]uint
Content: content,
Tags: p.Tags,
PostType: model.NormalizePostType(p.PostType), // question→question,normal→discussion
Pinned: p.Pinned,
Pinned: legacyPinLevel(p.Pinned),
Recommended: p.Featured,
Status: model.ContentStatusPublished,
LikeCount: p.LikeCount,