2023-12-20 08:41:50 +00:00
|
|
|
package kindboxreqservice
|
2023-12-20 08:27:13 +00:00
|
|
|
|
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
|
|
|
AddKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
|
|
|
|
EditKindBoxReq(ctx context.Context, kindBoxReqID uint, kindBoxReqInput entity.KindBoxReq) (entity.KindBoxReq, error)
|
|
|
|
DeleteKindBoxReq(ctx context.Context, kindBoxReqID uint) error
|
|
|
|
GetAllKindBoxReq(ctx context.Context) ([]entity.KindBoxReq, error)
|
|
|
|
GetKindBoxReqByID(ctx context.Context, kindBoxReq uint) (entity.KindBoxReq, error)
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
|
|
|
}
|
|
|
|
|
|
|
|
func New(repository Repository) Service {
|
|
|
|
return Service{
|
|
|
|
repo: repository,
|
|
|
|
}
|
|
|
|
}
|