moral.go 926 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/library/ecode"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func moral(ctx *bm.Context) {
  8. var (
  9. err error
  10. mid int64
  11. // moral *model.Moral
  12. params = ctx.Request.Form
  13. midStr = params.Get("mid")
  14. // res = c.Result()
  15. )
  16. if mid, err = strconv.ParseInt(midStr, 10, 64); err != nil {
  17. // res["code"] = ecode.RequestErr
  18. ctx.JSON(nil, ecode.RequestErr)
  19. return
  20. }
  21. // if moral, err = memberSvc.Moral(c, mid); err != nil {
  22. // log.Error("memberSvc.Moral(%d) error(%v)", mid, err)
  23. // res["code"] = err
  24. // return
  25. // }
  26. // res["data"] = moral
  27. ctx.JSON(memberSvc.Moral(ctx, mid))
  28. }
  29. func moralLog(ctx *bm.Context) {
  30. var (
  31. err error
  32. mid int64
  33. params = ctx.Request.Form
  34. midStr = params.Get("mid")
  35. )
  36. if mid, err = strconv.ParseInt(midStr, 10, 64); err != nil {
  37. ctx.JSON(nil, ecode.RequestErr)
  38. return
  39. }
  40. ctx.JSON(memberSvc.MoralLog(ctx, mid))
  41. }