feat: 百科分类api

This commit is contained in:
Blizzard
2026-02-07 16:42:43 +08:00
parent 9adad90490
commit 15a25555c4
16 changed files with 379 additions and 12 deletions
+3
View File
@@ -52,6 +52,9 @@ func (s *TopicService) TopicPage(req common.PageInfo) (list interface{}, total i
db := global.DB.Model(&plant.Topic{})
var topics []*plant.Topic
err = db.Count(&total).Error
if err != nil {
return
}
err = db.Limit(limit).Offset(offset).Order("created_at desc").Find(&topics).Error
return topics, total, err
}