venue.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package http
  2. import (
  3. item "go-common/app/service/openplatform/ticket-item/api/grpc/v1"
  4. "go-common/app/service/openplatform/ticket-item/model"
  5. bm "go-common/library/net/http/blademaster"
  6. "github.com/pkg/errors"
  7. )
  8. // @params VenueSearchParam
  9. // @router get /openplatform/internal/ticket/item/venue/search
  10. // @response VenueSearchList
  11. func venueSearch(c *bm.Context) {
  12. req := &model.VenueSearchParam{}
  13. if err := c.Bind(req); err != nil {
  14. return
  15. }
  16. c.JSON(itemSvc.VenueSearch(c, req))
  17. }
  18. // @params VenueInfoParam
  19. // @router post /openplatform/internal/ticket/item/venueInfo
  20. // @response VenueInfoReply
  21. func venueInfo(c *bm.Context) {
  22. arg := new(model.VenueInfoParam)
  23. if err := c.Bind(arg); err != nil {
  24. errors.Wrap(err, "参数验证失败")
  25. return
  26. }
  27. c.JSON(itemSvc.VenueInfo(c, &item.VenueInfoRequest{
  28. ID: arg.ID,
  29. Name: arg.Name,
  30. Status: arg.Status,
  31. Province: arg.Province,
  32. City: arg.City,
  33. District: arg.District,
  34. AddressDetail: arg.AddressDetail,
  35. Traffic: arg.Traffic,
  36. }))
  37. }