コード例 #1
0
        public async Task <IHttpActionResult> Unlink(WishGiftLinkDto participantDto)
        {
            var userId = long.Parse(User.Identity.GetUserId());
            await _linkRepository.Unlink(userId, participantDto.WishId, participantDto.GiftId);

            return(EmptyApiResult());
        }
コード例 #2
0
        public async Task <IHttpActionResult> LinkWithGift(WishGiftLinkDto participantDto)
        {
            var userId = long.Parse(User.Identity.GetUserId());

            try
            {
                var ownerWishUserId =
                    await _linkRepository.LinkWithGift(userId, participantDto.WishId, participantDto.GiftId);

                await _notificationService.SentNotificationToQueue(new JoinQueueNotification()
                {
                    CreatorId    = userId,
                    OwnerWish    = ownerWishUserId,
                    TargetWishId = participantDto.WishId,
                    TargetGiftId = participantDto.GiftId
                });
            }
            catch (ExceptionWithCode e)
            {
                return(ErrorApiResult(e.ErrorCode, e.Message));
            }

            return(EmptyApiResult());
        }