Example #1
0
 public HttpResponseMessage GetOrderPushMessage([FromBody] CC_OrderPushMessage orderPushMessage)
 {
     try
     {
         var db     = new RedisOperation(_RedisDB);
         var key    = RedisKeys.CCOrderPushMessageKey(orderPushMessage.CustomerID);
         var result = db.SelectListQueue <CC_OrderPushMessage>(key);
         if (result.CustomerID.IsNullStr() || result.OrderID.IsNullStr())
         {
             return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
             {
                 Code = ResponseCode.DataNotFound,
                 Message = "success"
             }));
         }
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel <CC_OrderPushMessage>
         {
             Code = ResponseCode.Success,
             Message = "success",
             Result = result
         }));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel
         {
             Code = ResponseCode.Fail,
             Message = "fail:" + ex.Message
         }));
     }
 }
Example #2
0
 public HttpResponseMessage SetOrderPushMessage([FromBody] CC_OrderPushMessage orderPushMessage)
 {
     try
     {
         var db  = new RedisOperation(_RedisDB);
         var key = RedisKeys.CCOrderPushMessageKey(orderPushMessage.CustomerID);
         db.InsertListQueue(key, orderPushMessage);
         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
         }));
     }
 }
Example #3
0
 public HttpResponseMessage GetOrderPushMessageLength([FromBody] CC_OrderPushMessage orderPushMessage)
 {
     try
     {
         var db     = new RedisOperation(_RedisDB);
         var key    = RedisKeys.CCOrderPushMessageKey(orderPushMessage.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
         }));
     }
 }