Skip to content

Commit

Permalink
fix(rss): rss功能调整&bug修复
Browse files Browse the repository at this point in the history
- fix: 未显示置顶memo
- fix: 错误显示私密memo
- feat: 展示memo数量修改为15
- feat: 置顶memo在rss中不会置顶,但添加一行 **【置顶】** 作为标识
  • Loading branch information
Jinvic authored Feb 10, 2025
1 parent 348b1ef commit 0366bcb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/handler/rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ func (r RssHandler) generateRss(host string) (string, error) {
// 查询动态
tx := r.base.db.Preload("User", func(x *gorm.DB) *gorm.DB {
return x.Select("username", "nickname", "id")
}).Where("pinned = 0")
tx.Order("createdAt desc").Limit(10).Find(&memos)
}).Where("showType = 1")
tx.Order("createdAt desc").Limit(15).Find(&memos)

for i := range memos {
if *memos[i].Pinned {
memos[i].Content = "**【置顶】**\n" + memos[i].Content
}
}

feed := generateFeed(memos, &sysConfigVO, &user, host)

Expand Down

0 comments on commit 0366bcb

Please sign in to comment.