package topic import ( "github.com/gin-gonic/gin" "live/app/lib" "live/app/lib/back" "live/app/lib/tools" "live/app/logic/topic" ) type Topic struct { } type argsTopicList struct { Keyword string `json:"keyword" form:"keyword"` lib.Page } // @Title 话题列表 func (t *Topic) List(c *gin.Context) { args := argsTopicList{} if err := tools.ParseParams(&args, c); err != nil { back.Fail(c, err.Error()) return } if args.Keyword == "" { back.Fail(c, "参数不全") return } list, count := (&topic.Topic{}).List(args.Keyword, args.Page) back.Suc(c, "操作成功", gin.H{ "list": list, "total": count, }) } // @Title 话题列表 func (t *Topic) Hot(c *gin.Context) { list := (&topic.Topic{}).Hot() back.Suc(c, "操作成功", list) }