public IActionResult Get(string shorturl) { URLModel shortUrl = _urlService.GetShortURL(shorturl); if (shortUrl != null) { return(Ok(shortUrl)); } return(NotFound()); }
public IActionResult Get(string shorturl) { URLModel urlModel = _urlService.GetShortURL(shorturl); if (urlModel != null) { _logger.LogInformation($"Acceso a Redirect de {urlModel.ShortURL} a {urlModel.LongURL}"); _redirectService.SaveInfo(new RedirectModel() { ShortURL = urlModel.ShortURL, LongURL = urlModel.LongURL }); return(Redirect(urlModel.LongURL)); } return(NotFound()); }