topic.go 964 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package http
  2. import (
  3. "go-common/app/interface/bbq/app-bbq/api/http/v1"
  4. topic "go-common/app/service/bbq/topic/api"
  5. bm "go-common/library/net/http/blademaster"
  6. "github.com/pkg/errors"
  7. )
  8. func topicDetail(c *bm.Context) {
  9. arg := new(topic.TopicVideosReq)
  10. if err := c.Bind(arg); err != nil {
  11. errors.Wrap(err, "参数验证失败")
  12. return
  13. }
  14. mid := int64(0)
  15. midValue, exists := c.Get("mid")
  16. if exists {
  17. mid = midValue.(int64)
  18. }
  19. c.JSON(srv.TopicDetail(c, mid, arg))
  20. }
  21. func discoveryList(c *bm.Context) {
  22. arg := new(v1.DiscoveryReq)
  23. if err := c.Bind(arg); err != nil {
  24. errors.Wrap(err, "参数验证失败")
  25. return
  26. }
  27. mid := int64(0)
  28. midValue, exists := c.Get("mid")
  29. if exists {
  30. mid = midValue.(int64)
  31. }
  32. c.JSON(srv.Discovery(c, mid, arg))
  33. }
  34. func topicSearch(c *bm.Context) {
  35. arg := new(v1.TopicSearchReq)
  36. if err := c.Bind(arg); err != nil {
  37. errors.Wrap(err, "参数验证失败")
  38. return
  39. }
  40. c.JSON(srv.TopicSearch(c, arg))
  41. }