Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) Create ¶
SaveUser godoc @Summary Save User @Description Save a user by giver form @Tags users @Accept json @Produce json @Param user body CreateDTO true "Add User" @Success 201 {object} DTO @Failure 500 @Router /users [post]
func (*API) Find ¶
FilterUsers godoc @Summary Filter Users @Description Filter Users by query paramenters @Tags users @Accept json @Produce json @Param name query string false "User name" @Param email query string false "User email" @Param start query string false "User createdAt start date" @Param end query string false "User createdAt end date" @Param populate query string false "User populate properties" @Param limit query int false "User pagination limit" @Param offset query int false "User pagination limit" @Success 200 {object} []DTO @Failure 400 @Failure 500 @Router /users [get]
func (*API) FindById ¶
FindOneUser godoc @Summary Find one an User @Description Find one User by ID @Tags users @Accept json @Produce json @Param id path string true "User ID" @Success 200 {object} DTO @Failure 400 @Failure 404 @Failure 500 @Router /users/{id} [get]
func (*API) UpdateById ¶
UpdateOneUser godoc @Summary Update one an User @Description Update one User by ID @Tags users @Accept json @Produce json @Param id path string true "User ID" @Param user body UpdateDTO true "Update User" @Success 200 {object} DTO @Failure 400 @Failure 404 @Failure 500 @Router /users/{id} [post]
type DTO ¶
type Model ¶
type Model struct { gorm.Model ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid()"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Name string Email string `gorm:"uniqueIndex"` Password string Expenses []shared.ExpenseRefModel `gorm:"foreignKey:UserID;references:ID"` }
type Repository ¶
type Repository struct { shared.BaseRepository[Model] }