niki/service/benefactor/kind_box/get_all.go

22 lines
737 B
Go
Raw Permalink Normal View History

package benefactorkindboxservice
import (
"context"
2024-07-09 17:17:04 +00:00
params "git.gocasts.ir/ebhomengo/niki/param"
param "git.gocasts.ir/ebhomengo/niki/param/benefactor/kind_box"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
// TODO: Pagination, Filters, Sort.
func (s Service) GetAll(ctx context.Context, req param.KindBoxGetAllRequest) (param.KindBoxGetAllResponse, error) {
const op = "userkindboxservice.GetAll"
2024-07-09 17:17:04 +00:00
allKindBox, _, err := s.repo.GetAllKindBox(ctx, params.FilterRequest{}, params.PaginationRequest{}, params.SortRequest{})
if err != nil {
return param.KindBoxGetAllResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.KindBoxGetAllResponse{AllKindBox: allKindBox}, nil
}