coupon.go 672 B

1234567891011121314151617181920212223242526272829
  1. package http
  2. import (
  3. "go-common/app/service/main/vip/model"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. "go-common/library/net/metadata"
  7. )
  8. func cancelUseCoupon(c *bm.Context) {
  9. var (
  10. err error
  11. arg = new(model.ArgCancelUseCoupon)
  12. )
  13. if err = c.Bind(arg); err != nil {
  14. return
  15. }
  16. c.JSON(nil, vipSvc.CancelUseCoupon(c, arg.Mid, arg.CouponToken, metadata.String(c, metadata.RemoteIP)))
  17. }
  18. func allowanceInfo(c *bm.Context) {
  19. var err error
  20. arg := new(model.ArgCancelUseCoupon)
  21. if err = c.Bind(arg); err != nil {
  22. log.Error("use allowance coupon bind %+v", err)
  23. return
  24. }
  25. c.JSON(vipSvc.AllowanceInfo(c, arg.Mid, arg.CouponToken))
  26. }