face.go 868 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/library/ecode"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func face(c *bm.Context) {
  8. params := c.Request.Form
  9. midStr := params.Get("mid")
  10. if midStr == "" {
  11. c.JSON(nil, ecode.RequestErr)
  12. return
  13. }
  14. fromStr, toStr := params.Get("from"), params.Get("to")
  15. if fromStr == "" || toStr == "" {
  16. c.JSON(nil, ecode.RequestErr)
  17. return
  18. }
  19. mid, err := strconv.ParseInt(midStr, 10, 64)
  20. if err != nil {
  21. c.JSON(nil, ecode.RequestErr)
  22. return
  23. }
  24. if mid < 0 {
  25. c.JSON(nil, ecode.RequestErr)
  26. return
  27. }
  28. from, err := strconv.ParseInt(fromStr, 10, 64)
  29. if err != nil {
  30. c.JSON(nil, ecode.RequestErr)
  31. return
  32. }
  33. to, err := strconv.ParseInt(toStr, 10, 64)
  34. if err != nil {
  35. c.JSON(nil, ecode.RequestErr)
  36. return
  37. }
  38. c.JSON(passportSvc.FaceApplies(c, mid, from, to, params.Get("status"), params.Get("operator")))
  39. }