Esempio n. 1
0
 public HttpResponseMessage DeletePrizePoolsList([FromBody] CC_PrizePool prizePoolData)
 {
     try
     {
         var db     = new RedisOperation(_RedisDB);
         var key    = RedisKeys.CCPrizePoolsKey(prizePoolData.CustomerId, prizePoolData.EventId);
         var result = db.Delete(key);
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Success,
             Message = "success"
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }
Esempio n. 2
0
 public HttpResponseMessage SetPrizePools([FromBody] List <CC_PrizePool> prizePoolData)
 {
     try
     {
         var db  = new RedisOperation(_RedisDB);
         var key = RedisKeys.CCPrizePoolsKey(prizePoolData.FirstOrDefault().CustomerId, prizePoolData.FirstOrDefault().EventId);
         //db.InsertListQueue(key, prizePoolData);
         db.InsertListQueueBatch(key, prizePoolData);
         db.Expire(TimeSpan.FromHours(prizePoolData.FirstOrDefault().ValidHours), key);
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Success,
             Message = "success"
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }