Exemple #1
0
        public ShortLinkDto GetShortLink(DeeplinkDto deeplinkDto)
        {
            ShortLinkEntity entity = _repository.GetByDeeplink(deeplinkDto.deeplink);

            if (entity == null)
            {
                string shortlink = ShortLinkHelper.GenerateShortLink();

                WebUrlDto webUrlDto = _helper.ConvertDeeplinkToWebLink(deeplinkDto);

                entity = _repository.Insert(deeplinkDto.deeplink, webUrlDto.webUrl, shortlink);
            }

            return(new ShortLinkDto()
            {
                shortlink = entity.ShortLink
            });
        }
Exemple #2
0
 public WebUrlDto GetWebUrl([FromBody] DeeplinkDto rDto)
 {
     return(_helper.ConvertDeeplinkToWebLink(rDto));
 }