예제 #1
0
        public async Task <IActionResult> AddCouponToUser(int couponId, [FromBody] UserLocationRequest model)
        {
            try
            {
                var username = User.FindFirstValue(ClaimTypes.Name);
                var coupon   = await _couponService.AddCouponToUserWithExceptionsAsync(username, couponId, model.TargetX, model.TargetY);

                return(Ok(coupon));
            }
            catch (LogicException ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }