예제 #1
0
        public void GetFlashSaleList()
        {
            using (var client = new FlashSaleClient())
            {
                var result = client.GetFlashSaleList(new Guid[] { Guid.Parse("971832e8-5b79-4612-8960-e9bac9e862be") });

                Assert.IsNotNull(result.Result);
            }
        }
예제 #2
0
 public ActionResult SelectQGCache(Guid aid, bool needLog)
 {
     using (var client = new FlashSaleClient())
     {
         var result = client.GetFlashSaleList(new Guid[] { aid });
         result.ThrowIfException(true);
         if (needLog)
         {
             var oprLog = new FlashSaleProductOprLog();
             oprLog.OperateUser    = ThreadIdentity.Operator.Name;
             oprLog.CreateDateTime = DateTime.Now;
             oprLog.BeforeValue    = JsonConvert.SerializeObject(Json(new { actvityid = aid }));
             oprLog.AfterValue     = JsonConvert.SerializeObject(Json(new { actvityid = aid }));
             oprLog.LogType        = "FlashSaleLog";
             oprLog.LogId          = aid.ToString();
             oprLog.Operation      = "刷新缓存";
             LoggerManager.InsertLog("FlashSaleOprLog", oprLog);
         }
         return(Json(result.Result, JsonRequestBehavior.AllowGet));
     }
 }
예제 #3
0
        public List <FlashSaleModel> GetFlashSaleList(Guid[] activityIds)
        {
            List <FlashSaleModel> result = null;

            try
            {
                using (var client = new FlashSaleClient())
                {
                    var data = client.GetFlashSaleList(activityIds);
                    if (!data.Success && data.Exception != null)
                    {
                        throw data.Exception;
                    }
                    result = data.Result;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }

            return(result);
        }