package user import ( "github.com/gin-gonic/gin" "product/backend/handlers/base" "product/backend/models" ) type PostReq struct { models.User Password string `json:"password"` PasswordSalt string `json:"passwordSalt"` PasswordAgain string `json:"passwordAgain"` } type PutReq struct { ID uint `json:"id" binding:"required"` Password string `json:"password"` PasswordSalt string `json:"passwordSalt"` models.User } type GetReq struct { base.GetReq // } func (getReq *GetReq) BindAndInit(ctx *gin.Context) error { if err := ctx.ShouldBindQuery(&getReq); err != nil { return err } getReq.GetReq.Init() return nil } type DelReq struct { base.DelReq } type LoginReq struct { Password string `json:"password"` Name string `json:"name"` } type ChangePasswordReq struct { UserID uint `json:"userID"` OldPassword string `json:"oldPassword"` NewPassword string `json:"newPassword"` NewPasswordAgain string `json:"newPasswordAgain"` }