Documentation ¶
Index ¶
- type UserController
- func (c *UserController) DeleteById(id uint64) (response model.Response, err error)
- func (c *UserController) GetById(id uint64) (response model.Response, err error)
- func (c *UserController) Init(userService service.UserService)
- func (c *UserController) Post(request *UserRequest) (model.Response, error)
- type UserRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserController ¶
type UserController struct { web.Controller // contains filtered or unexported fields }
RestController
func (*UserController) DeleteById ¶
func (c *UserController) DeleteById(id uint64) (response model.Response, err error)
Delete /id/{id}
func (*UserController) GetById ¶
func (c *UserController) GetById(id uint64) (response model.Response, err error)
Get /id/{id}
func (*UserController) Init ¶
func (c *UserController) Init(userService service.UserService)
Init inject userService automatically
func (*UserController) Post ¶
func (c *UserController) Post(request *UserRequest) (model.Response, error)
Post /user
type UserRequest ¶
type UserRequest struct { model.RequestBody Id uint64 `json:"id"` Name string `json:"name" validate:"required"` Username string `json:"username" validate:"required"` Password string `json:"password" validate:"required"` Email string `json:"email" validate:"required,email"` Age uint `json:"age" validate:"gte=0,lte=130"` Gender uint `json:"gender" validate:"gte=0,lte=2"` }
Click to show internal directories.
Click to hide internal directories.