shot.go 633 B

123456789101112131415161718192021222324252627
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/library/ecode"
  5. "go-common/library/log"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. func videoshot(c *bm.Context) {
  9. params := c.Request.Form
  10. cidStr := params.Get("cid")
  11. aidStr := params.Get("aid")
  12. // check params
  13. cid, err := strconv.ParseInt(cidStr, 10, 64)
  14. if err != nil || cid == 0 {
  15. log.Warn("query (cid) must be number and > 0 but (%s) error(%v)", cidStr, err)
  16. c.JSON(nil, ecode.RequestErr)
  17. return
  18. }
  19. aid, err := strconv.ParseInt(aidStr, 10, 64)
  20. if err != nil || aid == 0 {
  21. log.Warn("videoshot aid(%s) error", aidStr)
  22. }
  23. c.JSON(arcSvc.Videoshot(c, aid, cid))
  24. }