예제 #1
0
        public async Task <IActionResult> AddActivity(Guid remarkId, [FromBody] AddActivityRequest request)
        {
            var userId = HttpContext.GetUserId();

            var command = new AddActivity
            {
                RemarkId       = remarkId,
                UserId         = userId,
                ActivityTypeId = request.ActivityTypeId,
                Date           = request.Date
            };

            var result = await _remarkService
                         .AddActivityAsync(command)
                         .OrFailAsync();

            return(Ok(result));
        }
예제 #2
0
        /// <summary>
        /// 新增优惠码活动
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public bool AddActivity(DiscountActivityRes request, out string message)
        {
            var param = new AddActivityRequest()
            {
                ActivityName        = request.ActivityName,
                ActivityDescription = request.ActivityDescription,
                StartTime           = request.StartTime,
                EndTime             = request.EndTime,
                Remark          = request.Remark,
                CodeType        = request.CodeType,
                SetCodeCount    = request.SetCodeCount,
                CreateCodeCount = 0,
                LimitCount      = request.LimitCount,
                CouponKeys      = request.CouponKeys,
                CreateTime      = DateTime.Now,
                IsEnable        = true,
                IsDelete        = false,
            };
            var response = MKMSClient.Send <AddActivityResponse>(param);

            message = response.DoResult;
            return(response.DoFlag);
        }