forked from ebhomengo/niki
18 lines
564 B
Go
18 lines
564 B
Go
package kindboxservice
|
|
|
|
import (
|
|
"context"
|
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/kind_box"
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
)
|
|
|
|
func (s Service) GetByID(ctx context.Context, req param.KindBoxGetByIDRequest) (param.KindBoxGetByIDResponse, error) {
|
|
const op = "kindboxservice.GetByID"
|
|
kindBox, err := s.repo.GetKindBoxByID(ctx, req.KindBoxID)
|
|
if err != nil {
|
|
return param.KindBoxGetByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
|
|
}
|
|
return param.KindBoxGetByIDResponse{KindBox: kindBox}, nil
|
|
}
|