2023-12-20 08:27:13 +00:00
|
|
|
package kindboxservice
|
|
|
|
|
2023-12-22 21:42:57 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
|
|
)
|
2023-12-20 08:27:13 +00:00
|
|
|
|
|
|
|
type Repository interface {
|
2023-12-22 21:42:57 +00:00
|
|
|
AddKindBox(ctx context.Context, kindBox entity.KindBox) (entity.KindBox, error)
|
|
|
|
EditKindBox(ctx context.Context, kindBoxID uint, kindBoxInput entity.KindBox) (entity.KindBox, error)
|
|
|
|
DeleteKindBox(ctx context.Context, kindBoxID uint) error
|
|
|
|
GetAllKindBox(ctx context.Context) ([]entity.KindBox, error)
|
|
|
|
GetKindBoxByID(ctx context.Context, kindBox uint) (entity.KindBox, error)
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
|
|
|
}
|
|
|
|
|
|
|
|
func New(repository Repository) Service {
|
|
|
|
return Service{
|
|
|
|
repo: repository,
|
|
|
|
}
|
|
|
|
}
|