forked from ebhomengo/niki
22 lines
737 B
Go
22 lines
737 B
Go
package benefactorkindboxservice
|
|
|
|
import (
|
|
"context"
|
|
|
|
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"
|
|
|
|
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
|
|
}
|