Documentation ¶
Index ¶
- func New() fx.Option
- type DashboardController
- type UserController
- func (*UserController) Construct() interface{}
- func (c *UserController) UserCreate(ctx *fiber.Ctx) error
- func (c *UserController) UserDelete(ctx *fiber.Ctx) error
- func (c *UserController) UserFindAll(ctx *fiber.Ctx) error
- func (c *UserController) UserFindByID(ctx *fiber.Ctx) error
- func (c *UserController) UserUpdate(ctx *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DashboardController ¶
func (*DashboardController) Construct ¶
func (*DashboardController) Construct() interface{}
func (*DashboardController) Index ¶
func (c *DashboardController) Index(ctx *fiber.Ctx) error
type UserController ¶
func (*UserController) Construct ¶
func (*UserController) Construct() interface{}
func (*UserController) UserCreate ¶
func (c *UserController) UserCreate(ctx *fiber.Ctx) error
UserCreate godoc
@Summary Create a new user @Description Create a new user with the provided information @Tags Users @Accept json @Produce json @Param user body models.User true "User information" @Success 200 {object} types.Response{data=models.User} "Successfully created user" @Failure 400 {object} validator.GlobalErrorResponse "Bad request" @Failure 500 {object} validator.GlobalErrorResponse "Internal server error" @Router /user [post]
func (*UserController) UserDelete ¶
func (c *UserController) UserDelete(ctx *fiber.Ctx) error
UserDelete godoc
@Summary Delete a user @Description Delete a user by their ID @Tags Users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} types.Response{} "Successfully deleted user" @Failure 400 {object} validator.GlobalErrorResponse "Bad request" @Failure 401 {object} validator.GlobalErrorResponse "Unauthorized" @Failure 500 {object} validator.GlobalErrorResponse "Internal server error" @Router /user/{id} [delete]
func (*UserController) UserFindAll ¶
func (c *UserController) UserFindAll(ctx *fiber.Ctx) error
UserFindAll godoc
@Summary Get all users @Description Retrieve a list of all users with pagination @Tags Users @Accept json @Produce json @Param page query int false "Page number" @Param per_page query int false "Number of items per page" @Success 200 {object} types.Response{data=[]models.User,meta=types.PaginationMeta} "Successfully retrieved users" @Failure 500 {object} validator.GlobalErrorResponse "Internal server error" @Router /user [get]
func (*UserController) UserFindByID ¶
func (c *UserController) UserFindByID(ctx *fiber.Ctx) error
UserFindByID godoc
@Summary Get a user by ID @Description Retrieve a user by their ID @Tags Users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} types.Response{data=models.User} "Successfully retrieved user" @Failure 400 {object} validator.GlobalErrorResponse "Bad request" @Failure 404 {object} validator.GlobalErrorResponse "User not found" @Failure 500 {object} validator.GlobalErrorResponse "Internal server error" @Router /user/{id} [get]
func (*UserController) UserUpdate ¶
func (c *UserController) UserUpdate(ctx *fiber.Ctx) error
UserUpdate godoc
@Summary Update a user @Description Update a user's information by their ID @Tags Users @Accept json @Produce json @Param id path int true "User ID" @Param user body models.User true "Updated user information" @Success 200 {object} types.Response{data=models.User} "Successfully updated user" @Failure 400 {object} validator.GlobalErrorResponse "Bad request" @Failure 500 {object} validator.GlobalErrorResponse "Internal server error" @Router /user/{id} [put]
Click to show internal directories.
Click to hide internal directories.