public UrlApiController(IShortenUrlService shotenUrlService, IMapper mapper) { _shotenUrlService = shotenUrlService; _mapper = mapper; }
public async Task <ActionResult <UrlStatsViewModel> > GetCodeStats(string code, [FromServices] IShortenUrlService shortenUrlService) { var result = await shortenUrlService.GetStatsByCode(code); return(Ok(result)); }
public async Task <IActionResult> Get(string code, [FromServices] IShortenUrlService shortenUrlService) { var location = await shortenUrlService.GetUrlByCode(code); return(Redirect(location)); }
public async Task <ActionResult <ShortUrlCreatedViewModel> > CreateShortenUrl(ShortenUrlDTO shortenUrlDTO, [FromServices] IShortenUrlService shortenUrlService) { var code = await shortenUrlService.CreateShortenUrl(shortenUrlDTO); return(Created(string.Empty, code)); }
public ShortenUrlController(IShortenUrlService shortenUrlService) { _shortenUrlService = shortenUrlService; }
public UrlShortenerController(IShortenUrlService service) { _service = service; }