forked from ebhomengo/niki
18 lines
601 B
Go
18 lines
601 B
Go
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) GetByID(ctx context.Context, req param.KindBoxReqGetByIDRequest) (param.KindBoxReqGetByIDResponse, error) {
|
|
const op = "kindboxreqservice.GetByID"
|
|
kindBoxReq, err := s.repo.GetKindBoxReqByID(ctx, req.KindBoxReqID)
|
|
if err != nil {
|
|
return param.KindBoxReqGetByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
|
|
}
|
|
return param.KindBoxReqGetByIDResponse{KindBoxReq: kindBoxReq}, nil
|
|
}
|