promotion.go 755 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package http
  2. import (
  3. rpcV1 "go-common/app/service/openplatform/ticket-sales/api/grpc/v1"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. func getPromo(c *bm.Context) {
  7. arg := new(rpcV1.PromoID)
  8. if err := c.Bind(arg); err != nil {
  9. return
  10. }
  11. c.JSON(svc.GetPromo(c, arg))
  12. }
  13. func createPromo(c *bm.Context) {
  14. arg := new(rpcV1.CreatePromoRequest)
  15. if err := c.Bind(arg); err != nil {
  16. return
  17. }
  18. c.JSON(svc.CreatePromo(c, arg))
  19. }
  20. func operatePromo(c *bm.Context) {
  21. arg := new(rpcV1.OperatePromoRequest)
  22. if err := c.Bind(arg); err != nil {
  23. return
  24. }
  25. c.JSON(svc.OperatePromo(c, arg))
  26. }
  27. func editPromo(c *bm.Context) {
  28. arg := new(rpcV1.EditPromoRequest)
  29. if err := c.Bind(arg); err != nil {
  30. return
  31. }
  32. c.JSON(svc.EditPromo(c, arg))
  33. }