controllers

package
v0.0.0-...-11fa6ca Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() fx.Option

Types

type DashboardController

type DashboardController struct {
	*app.App
}

func (*DashboardController) Construct

func (*DashboardController) Construct() interface{}

func (*DashboardController) Index

func (c *DashboardController) Index(ctx *fiber.Ctx) error

type UserController

type UserController struct {
	*app.App
	// contains filtered or unexported fields
}

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]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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