package handler import ( "context" "hilo/api/service/country" "hilo/app/service/country/internal/service" ) // CountryHandler is a country handler. type CountryHandler struct { country.UnimplementedCountryServer svc *service.CountryService } func (h *CountryHandler) GetCountryByShortName(ctx context.Context, req *country.GetCountryByShortNameReq) (*country.GetCountryByShortNameRep, error) { m, err := h.svc.GetCountryByShortName(ctx, req.ShortName) if err != nil { return nil, err } return CountryModelToShortNameRep(m), nil } // NewCountryHandler new a country handler. func NewCountryHandler(uc *service.CountryService) *CountryHandler { return &CountryHandler{svc: uc} } var _ country.CountryServer = &CountryHandler{}