niki/service/kind_box_req/get_by_id.go

16 lines
563 B
Go

package kindboxreqservice
import (
param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
func (s Service) GetByID(req param.KindBoxReqGetByIDRequest) (param.KindBoxReqGetByIDResponse, error) {
const op = "kindboxreqservice.GetByID"
kindBoxReq, err := s.repo.GetKindBoxReqByID(req.KindBoxReqID)
if err != nil {
return param.KindBoxReqGetByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.KindBoxReqGetByIDResponse{KindBoxReq: kindBoxReq}, nil
}