forked from ebhomengo/niki
1
0
Fork 0
niki/service/benefactor/address/city_exit_by_id.go

20 lines
637 B
Go
Raw Normal View History

2024-01-19 16:37:15 +00:00
package benefactoraddressservice
import (
"context"
addressparam "git.gocasts.ir/ebhomengo/niki/param/benefactor/address"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
func (s Service) CityExistByID(ctx context.Context, req addressparam.CityExistByIDRequest) (addressparam.CityExistByIDResponse, error) {
const op = "benefactoraddressservice.CityExistByID"
isExisted, err := s.repo.IsExistCityByID(ctx, req.ID)
if err != nil {
return addressparam.CityExistByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return addressparam.CityExistByIDResponse{Existed: isExisted}, nil
}