2023-12-20 08:27:13 +00:00
|
|
|
package kindboxservice
|
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
import (
|
2023-12-22 21:42:57 +00:00
|
|
|
"context"
|
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/kind_box"
|
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
|
|
)
|
2023-12-20 08:27:13 +00:00
|
|
|
|
2023-12-22 21:42:57 +00:00
|
|
|
func (s Service) GetAll(ctx context.Context) (param.KindBoxGetAllResponse, error) {
|
2023-12-22 21:25:16 +00:00
|
|
|
const op = "kindboxservice.GetAll"
|
2023-12-22 21:42:57 +00:00
|
|
|
allKindBox, err := s.repo.GetAllKindBox(ctx)
|
2023-12-22 21:25:16 +00:00
|
|
|
if err != nil {
|
|
|
|
return param.KindBoxGetAllResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
|
|
|
|
}
|
|
|
|
return param.KindBoxGetAllResponse{AllKindBox: allKindBox}, nil
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|