Пример #1
0
 public HttpResponseMessage GetOrderSend([FromBody] CC_OrderSend OrderSend)
 {
     try
     {
         var db     = new RedisOperation(_RedisDB);
         var key    = RedisKeys.CCOrderSend(OrderSend.CustomerID);
         var result = db.SelectListQueue <CC_OrderSend>(key);
         if (result.CustomerID.IsNullStr() || result.ConfigData == null || result.OrderSendData == null)
         {
             return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
             {
                 Code = ResponseCode.DataNotFound,
                 Message = "success"
             }));
         }
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel <CC_OrderSend>
         {
             Code = ResponseCode.Success,
             Message = "success",
             Result = result
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }
Пример #2
0
 public HttpResponseMessage SetOrderSend([FromBody] CC_OrderSend OrderSend)
 {
     try
     {
         var db  = new RedisOperation(_RedisDB);
         var key = RedisKeys.CCOrderSend(OrderSend.CustomerID);
         db.InsertListQueue(key, OrderSend);
         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
         }));
     }
 }
Пример #3
0
 public HttpResponseMessage GetOrderSendLength([FromBody] CC_OrderSend OrderSend)
 {
     try
     {
         var db     = new RedisOperation(_RedisDB);
         var key    = RedisKeys.CCOrderSend(OrderSend.CustomerID);
         var result = db.GetListLength(key);
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel <long>
         {
             Code = ResponseCode.Success,
             Message = "success",
             Result = result
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }