feat: swagger format
This commit is contained in:
@@ -76,6 +76,9 @@ func (s *PostService) PostPage(req plantReq.PostPage, userId string) (list inter
|
||||
if req.Title != "" {
|
||||
db = db.Where("title like ?", "%"+req.Title+"%")
|
||||
}
|
||||
if req.HasReviewed != nil {
|
||||
db = db.Where("has_reviewed = ?", *req.HasReviewed)
|
||||
}
|
||||
//todo 审核帖子
|
||||
err = db.Count(&total).Error
|
||||
if err != nil {
|
||||
|
||||
@@ -50,7 +50,7 @@ func (s *TopicService) TopicPage(req common.PageInfo) (list interface{}, total i
|
||||
limit := req.PageSize
|
||||
offset := req.PageSize * (req.Current - 1)
|
||||
db := global.DB.Model(&plant.Topic{})
|
||||
var topics []*plant.Topic
|
||||
var topics []plant.Topic
|
||||
err = db.Count(&total).Error
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user