point.go 571 B

12345678910111213141516171819202122232425262728293031
  1. package http
  2. import (
  3. "go-common/app/service/main/point/model"
  4. "go-common/library/ecode"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func pointInfo(c *bm.Context) {
  8. mid, ok := c.Get("mid")
  9. if !ok {
  10. c.JSON(nil, ecode.RequestErr)
  11. return
  12. }
  13. c.JSON(pointSvc.PointInfo(c, mid.(int64)))
  14. }
  15. func pointPage(c *bm.Context) {
  16. var err error
  17. mid, ok := c.Get("mid")
  18. if !ok {
  19. c.JSON(nil, ecode.RequestErr)
  20. return
  21. }
  22. arg := new(model.ArgRPCPointHistory)
  23. if err = c.Bind(arg); err != nil {
  24. return
  25. }
  26. arg.Mid = mid.(int64)
  27. c.JSON(pointSvc.PointPage(c, arg))
  28. }