Documentation ¶
Index ¶
- type Controller
- type Repository
- type Service
- func (service Service) Create(req model.RequestCreateItem) (model.Item, error)
- func (service Service) Delete(id uint) error
- func (service Service) Find(query model.RequestFindItem) ([]model.Item, error)
- func (service Service) Replace(id uint, req model.RequestCreateItem) (model.Item, error)
- func (service Service) UpdateStatus(id uint, status constant.ItemStatus) (model.Item, error)
- type Validate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
Service Service
}
func NewController ¶
func NewController(dbconn *gorm.DB) Controller
func (Controller) CreateItem ¶
func (ctrl Controller) CreateItem(ctx *gin.Context)
func (Controller) DeleteItem ¶
func (ctrl Controller) DeleteItem(ctx *gin.Context)
func (Controller) GetItems ¶
func (ctrl Controller) GetItems(ctx *gin.Context)
func (Controller) ReplaceItem ¶
func (ctrl Controller) ReplaceItem(ctx *gin.Context)
func (Controller) UpdateItemStatus ¶
func (ctrl Controller) UpdateItemStatus(ctx *gin.Context)
type Repository ¶
func NewRepository ¶
func NewRepository(dbconn *gorm.DB) Repository
func (Repository) Delete ¶
func (repo Repository) Delete(id uint) error
func (Repository) Find ¶
func (repo Repository) Find(query model.RequestFindItem) ([]model.Item, error)
type Service ¶
type Service struct { Repository Repository Validate Validate }
func NewService ¶
func (Service) UpdateStatus ¶
type Validate ¶
type Validate struct { }
func NewValidate ¶
func NewValidate() Validate
func (Validate) DeleteItem ¶
func (validator Validate) DeleteItem(current constant.ItemStatus) error
func (Validate) ItemStatusFlow ¶
func (validator Validate) ItemStatusFlow(current, next constant.ItemStatus) error
func (Validate) UpdateItem ¶
func (validator Validate) UpdateItem(current constant.ItemStatus) error
Click to show internal directories.
Click to hide internal directories.