Documentation
¶
Index ¶
- type ListUserResponse
- type User
- type UserController
- func (c *UserController) DeleteUser(_ struct{ ... }, id int) (response *UserResponse, err error)
- func (c *UserController) GetUser(_ struct{ ... }, id int, ctx context.Context) (response *UserResponse, err error)
- func (c *UserController) GetUserByName(_ struct{ ... }, name string) (response *UserResponse, err error)
- func (c *UserController) GetUserQuery(_ struct{ ... }, ctx context.Context) (response *UserResponse, err error)
- func (c *UserController) GetUsers(_ struct{ ... }, request *UserRequests, ctx context.Context) (response *ListUserResponse, err error)
- type UserRequests
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListUserResponse ¶
type ListUserResponse struct {
at.ResponseBody `json:"-"`
model.BaseResponse
Data *UserRequests `json:"data"`
}
type UserController ¶
type UserController struct {
at.RestController
at.RequestMapping `value:"/user" `
}
func (*UserController) DeleteUser ¶
func (c *UserController) DeleteUser(_ struct { at.DeleteMapping `value:"/{id}"` at.Operation `id:"Update Employee" description:"Delete User by ID"` }, id int) (response *UserResponse, err error)
GetUser
func (*UserController) GetUser ¶
func (c *UserController) GetUser(_ struct { at.GetMapping `value:"/{id}"` at.Operation `id:"Update Employee" description:"Get User by ID"` // /user/{id} -> `values:"user:read" type:"path" in:"id"` at.RequiresPermissions `values:"user:read" type:"path" in:"id"` }, id int, ctx context.Context) (response *UserResponse, err error)
GetUser
func (*UserController) GetUserByName ¶
func (c *UserController) GetUserByName(_ struct { at.GetMapping `value:"/name/{name}"` // /user/{id} -> `values:"user:read" type:"path" in:"id"` at.RequiresPermissions `values:"user:read" type:"path" in:"name"` }, name string) (response *UserResponse, err error)
GetUser
func (*UserController) GetUserQuery ¶
func (c *UserController) GetUserQuery(_ struct { at.GetMapping `value:"/query"` at.Operation `id:"Update Employee" description:"Query User"` // /user?id=12345 -> `values:"user:read" type:"query" in:"id"` at.RequiresPermissions `values:"user:read" type:"query" in:"id"` }, ctx context.Context) (response *UserResponse, err error)
GetUser
func (*UserController) GetUsers ¶
func (c *UserController) GetUsers(_ struct { at.GetMapping `value:"/"` at.Operation `id:"Update Employee" description:"Get User List"` at.RequiresPermissions `values:"user:list" type:"query:pagination" in:"page,per_page,id" out:"expr,total"` }, request *UserRequests, ctx context.Context) (response *ListUserResponse, err error)
GetUser
type UserRequests ¶
type UserRequests struct {
at.RequestParams
at.Schema
// For paginated result sets, page of results to retrieve.
Page int `url:"page,omitempty" json:"page,omitempty" validate:"min=1"`
// For paginated result sets, the number of results to include per page.
PerPage int `url:"per_page,omitempty" json:"per_page,omitempty" validate:"min=1"`
Total int `json:"total"`
Expr string `json:"expr"`
}
type UserResponse ¶
type UserResponse struct {
at.ResponseBody `json:"-"`
model.BaseResponse
Data *User `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.