forked from ebhomengo/niki
19 lines
583 B
Go
19 lines
583 B
Go
package benefactor
|
|
|
|
import (
|
|
"context"
|
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/admin"
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
)
|
|
|
|
func (s Service) AddressExistByID(ctx context.Context, req param.GetAddressByIDRequest) (param.GetAddressByIDResponse, error) {
|
|
const op = "adminaddressservice.BenefactorExistByID"
|
|
|
|
address, err := s.repo.GetAddressByID(ctx, req.ID)
|
|
if err != nil {
|
|
return param.GetAddressByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
|
|
}
|
|
|
|
return param.GetAddressByIDResponse{Address: address}, nil
|
|
}
|