예제 #1
0
        public async Task <IActionResult> Get()
        {
            var entity = await _client.SearchAsync();

            var result = _mapper.Map <List <Gourmet> >(entity);

            if (result == null || result.Count == 0)
            {
                return(NotFound());
            }
            return(Ok(result));
        }
예제 #2
0
        public async Task <IActionResult> Get(string keyword)
        {
            var geocode = await GeocodeClient.GetGeocodeAsync(HttpUtility.UrlDecode(keyword));

            var entity = await GourmetClient.SearchAsync(geocode.results[0].geometry.location.lng, geocode.results[0].geometry.location.lat);

            var result = _mapper.Map <List <Gourmet> >(entity);

            if (result == null || result.Count == 0)
            {
                return(NotFound());
            }
            return(Ok(result));
        }