viewpoint.go 825 B

123456789101112131415161718192021222324252627282930313233
  1. package http
  2. import (
  3. "go-common/app/interface/main/creative/model/archive"
  4. "go-common/library/ecode"
  5. "go-common/library/log"
  6. bm "go-common/library/net/http/blademaster"
  7. "strconv"
  8. )
  9. // videoViewPoints get video highlight viewpoints
  10. func videoViewPoints(c *bm.Context) {
  11. var (
  12. aid, cid int64
  13. err error
  14. form = c.Request.Form
  15. vp *archive.ViewPointRow
  16. )
  17. if aid, err = strconv.ParseInt(form.Get("aid"), 10, 64); err != nil || aid <= 0 {
  18. c.JSON(nil, ecode.RequestErr)
  19. return
  20. }
  21. if cid, err = strconv.ParseInt(form.Get("cid"), 10, 64); err != nil || cid <= 0 {
  22. c.JSON(nil, ecode.RequestErr)
  23. return
  24. }
  25. if vp, err = arcSvc.VideoPoints(c, aid, cid); err != nil {
  26. log.Error("arcSvc.VideoPoints(%d,%d) error(%v)", aid, cid, err)
  27. c.JSON(nil, ecode.RequestErr)
  28. return
  29. }
  30. c.JSON(vp, nil)
  31. }