rating.go 446 B

123456789101112131415161718192021222324
  1. package http
  2. import (
  3. "go-common/library/ecode"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func upRating(c *bm.Context) {
  8. midI, ok := c.Get("mid")
  9. if !ok {
  10. log.Error("error get mid")
  11. c.JSON(nil, ecode.NoLogin)
  12. return
  13. }
  14. mid, _ := midI.(int64)
  15. rating, err := svc.UpRating(c, mid)
  16. if err != nil {
  17. log.Error("svc.UpRating mid(%v) err(%v)", mid, err)
  18. c.JSON(nil, err)
  19. return
  20. }
  21. c.JSON(rating, err)
  22. }