2023-12-26 17:53:25 +00:00
|
|
|
package userkindboxservice
|
2023-12-26 17:52:20 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-12-26 17:53:25 +00:00
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/benefactor/kind_box"
|
2023-12-26 17:52:20 +00:00
|
|
|
errmsg "git.gocasts.ir/ebhomengo/niki/pkg/err_msg"
|
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
|
|
)
|
|
|
|
|
2023-12-26 17:53:25 +00:00
|
|
|
func (s Service) Get(ctx context.Context, req param.KindBoxGetRequest) (param.KindBoxGetResponse, error) {
|
|
|
|
const op = "userkindboxservice.Get"
|
2023-12-26 17:52:20 +00:00
|
|
|
|
2023-12-26 17:53:25 +00:00
|
|
|
kindBox, err := s.repo.GetKindBox(ctx, req.KindBoxID)
|
2023-12-26 17:52:20 +00:00
|
|
|
if err != nil {
|
2023-12-26 17:53:25 +00:00
|
|
|
return param.KindBoxGetResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
|
2023-12-26 17:52:20 +00:00
|
|
|
}
|
2023-12-28 13:43:06 +00:00
|
|
|
|
2023-12-26 17:52:20 +00:00
|
|
|
|
2023-12-26 17:53:25 +00:00
|
|
|
return param.KindBoxGetResponse{KindBox: kindBox}, nil
|
2023-12-26 17:52:20 +00:00
|
|
|
}
|