controller

package
v0.0.0-...-90437bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(c echo.Context) error

CreateUser godoc @Summary Create a new user @Description Create a new user with the given information. @Tags [Sample] Users @Accept json @Produce json @Param User body CreateUserRequest true "User information" @Success 201 {object} GetUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 400 {object} object "Invalid Request" @Router /sample/users [post]

func DeleteUser

func DeleteUser(c echo.Context) error

DeleteUser godoc @Summary Delete a user @Description Delete a user with the given information. @Tags [Sample] Users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {string} string "User deletion successful" @Failure 400 {object} object "Invalid Request" @Failure 404 {object} object "User Not Found" @Router /sample/users/{id} [delete]

func GetUser

func GetUser(c echo.Context) error

GetUser godoc @Summary Get specific user information @Description Get information of a user with a specific ID. @Tags [Sample] Users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} GetUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 404 {object} object "User Not Found" @Router /sample/users/{id} [get]

func GetUsers

func GetUsers(c echo.Context) error

GetUsers godoc @Summary Get a list of users @Description Get information of all users. @Tags [Sample] Users @Accept json @Produce json @Success 200 {object} GetUsersResponse "(sample) This is a sample description for success response in Swagger UI" @Failure 404 {object} object "User Not Found" @Router /sample/users [get]

func PatchUser

func PatchUser(c echo.Context) error

PatchUser godoc @Summary Patch a user @Description Patch a user with the given information. @Tags [Sample] Users @Accept json @Produce json @Param id path int true "User ID" @Param User body PatchUserRequest true "User information to update" @Success 200 {object} PatchUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 400 {object} object "Invalid Request" @Failure 404 {object} object "User Not Found" @Router /sample/users/{id} [patch]

func RestGetHealth

func RestGetHealth(c echo.Context) error

RestGetHealth func is for checking Beetle server health. RestGetHealth godoc @Summary Check Beetle is alive @Description Check Beetle is alive @Tags [Admin] System management @Accept json @Produce json @Success 200 {object} model.BasicResponse @Failure 404 {object} model.BasicResponse @Failure 500 {object} model.BasicResponse @Router /health [get]

func UpdateUser

func UpdateUser(c echo.Context) error

UpdateUser godoc @Summary Update a user @Description Update a user with the given information. @Tags [Sample] Users @Accept json @Produce json @Param id path int true "User ID" @Param User body UpdateUserRequest true "User information to update" @Success 201 {object} UpdateUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 400 {object} object "Invalid Request" @Router /sample/users/{id} [put]

Types

type CreateUserRequest

type CreateUserRequest struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type CreateUserResponse

type CreateUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type GetUserResponse

type GetUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type GetUsersResponse

type GetUsersResponse struct {
	Users []model.MyUser `json:"users"`
}

type PatchUserRequest

type PatchUserRequest struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type PatchUserResponse

type PatchUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type UpdateUserRequest

type UpdateUserRequest struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type UpdateUserResponse

type UpdateUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL