2023-12-25 17:08:19 +00:00
|
|
|
package adminkindboxservice
|
2023-12-20 08:27:13 +00:00
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
import (
|
2023-12-22 21:42:57 +00:00
|
|
|
"context"
|
|
|
|
|
2023-12-25 17:08:19 +00:00
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/kind_box"
|
2023-12-22 21:25:16 +00:00
|
|
|
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-25 17:08:19 +00:00
|
|
|
const op = "adminkindboxservice.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)
|
|
|
|
}
|
2024-01-01 07:22:14 +00:00
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
return param.KindBoxGetAllResponse{AllKindBox: allKindBox}, nil
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|