niki/service/benefactor/address/get_all_cities.go

20 lines
576 B
Go
Raw Normal View History

2024-01-19 16:37:15 +00:00
package benefactoraddressservice
import (
"context"
param "git.gocasts.ir/ebhomengo/niki/param/benefactor/address"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
func (s Service) GetAllCities(ctx context.Context, _ param.GetAllCitiesRequest) (param.GetAllCitiesResponse, error) {
const op = "benefactoraddressservice.GetAllCities"
Cities, err := s.repo.GetAllCities(ctx)
if err != nil {
return param.GetAllCitiesResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.GetAllCitiesResponse{Cities: Cities}, nil
}