auth.go 822 B

123456789101112131415161718192021222324252627282930313233
  1. package controller
  2. import (
  3. "github.com/sirupsen/logrus"
  4. "net/http"
  5. )
  6. type Auth struct {
  7. BaseController
  8. }
  9. // SignUp godoc
  10. // @Summary 用户添加
  11. // @tags Auth
  12. // @Description 用户添加
  13. // @Accept x-www-form-urlencoded
  14. // @Produce json
  15. // @Param userCode formData string true "用户名"
  16. // @Param password formData string true "密码"
  17. // @Param email formData string false "邮箱"
  18. // @Param phone formData string false "手机号"
  19. // @Param name formData string false "姓名"
  20. // @Success 200 {object} controller.ResponseBase
  21. // @Router /Auth/SignUp [post]
  22. func (a *Auth) HttpPostSignUp() (err error) {
  23. userCode := a.Ctx().PostForm("userCode")
  24. test := a.PostFromInt("test")
  25. test2 := a.PostFromIntPtr("test2")
  26. logrus.Info(userCode, test, test2)
  27. a.Ctx().JSON(http.StatusOK, newResponseBase())
  28. return
  29. }