coin.go 457 B

123456789101112131415161718192021222324
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/library/ecode"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func coinVideo(c *bm.Context) {
  8. var (
  9. mid, vmid int64
  10. err error
  11. )
  12. vmidStr := c.Request.Form.Get("vmid")
  13. if vmid, err = strconv.ParseInt(vmidStr, 10, 64); err != nil || vmid <= 0 {
  14. c.JSON(nil, ecode.RequestErr)
  15. return
  16. }
  17. if midInter, ok := c.Get("mid"); ok {
  18. mid = midInter.(int64)
  19. }
  20. c.JSON(spcSvc.CoinVideo(c, mid, vmid))
  21. }