newbie.go 511 B

1234567891011121314151617181920212223242526272829
  1. package http
  2. import (
  3. "go-common/app/interface/main/growup/model"
  4. "go-common/library/ecode"
  5. "go-common/library/net/http/blademaster"
  6. )
  7. func upNewbieLetter(c *blademaster.Context) {
  8. iMid, ok := c.Get("mid")
  9. if !ok {
  10. c.JSON(nil, ecode.NoLogin)
  11. return
  12. }
  13. req := new(model.NewbieLetterReq)
  14. if err := c.Bind(req); err != nil {
  15. c.JSON(nil, ecode.RequestErr)
  16. return
  17. }
  18. req.Mid = iMid.(int64)
  19. res, err := newbieSvr.Letter(c, req)
  20. if err != nil {
  21. c.JSON(nil, err)
  22. return
  23. }
  24. c.JSON(res, nil)
  25. }