forked from ebhomengo/niki
20 lines
596 B
Go
20 lines
596 B
Go
package adminbenefactorservice
|
|
|
|
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
|
|
}
|