コード例 #1
0
        /// <summary>
        /// 用户领取砍价优惠券
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <OperationResult <ShareBargainBaseResult> > ReceiveBargainCouponAsync(ReceiveBargainCouponRequest request)
        {
            string inputStr = $"入参:ownerId={request.OwnerId},apId={request.ActivityProductId},pid={request.Pid}";

            Logger.Info($"用户领取砍价优惠券ReceiveBargainCouponAsync {inputStr}");
            if (request.OwnerId == Guid.Empty ||
                request.ActivityProductId < 1 ||
                string.IsNullOrWhiteSpace(request.Pid))
            {
                return(OperationResult.FromError <ShareBargainBaseResult>(ErrorCode.ParameterError, "参数不正确"));
            }

            var result = await BargainManager.ReceiveBargainCouponAsync(request);

            Logger.Info($"用户领取砍价优惠券ReceiveBargainCouponAsync 出参:result={JsonConvert.SerializeObject(result)} {inputStr}");

            return(OperationResult.FromResult(result));
        }