niki/service/kind_box_req/get_all.go

18 lines
550 B
Go
Raw Normal View History

package kindboxreqservice
import (
"context"
param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
func (s Service) GetAll(ctx context.Context) (param.KindBoxReqGetAllResponse, error) {
const op = "kindboxreqservice.GetAll"
allKindBoxReq, err := s.repo.GetAllKindBoxReq(ctx)
if err != nil {
return param.KindBoxReqGetAllResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.KindBoxReqGetAllResponse{AllKindBoxReq: allKindBoxReq}, nil
}