report.go 587 B

12345678910111213141516171819202122232425262728293031
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/app/admin/main/spy/model"
  5. "go-common/library/log"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. func report(c *bm.Context) {
  9. var (
  10. params = c.Request.Form
  11. pn, ps int
  12. err error
  13. data *model.ReportPage
  14. )
  15. if ps, err = strconv.Atoi(params.Get("ps")); err != nil {
  16. ps = model.DefPs
  17. }
  18. if pn, err = strconv.Atoi(params.Get("pn")); err != nil {
  19. pn = model.DefPn
  20. }
  21. data, err = spySrv.ReportList(c, ps, pn)
  22. if err != nil {
  23. log.Error("spySrv.ReportList error(%v)", err)
  24. c.JSON(nil, err)
  25. return
  26. }
  27. c.JSON(data, err)
  28. }