public HttpResponseMessage GetRechargeOrder([FromBody] CC_Order order) { try { var db = new RedisOperation(_RedisDB); var key = RedisKeys.CCRechargeOrder(order.CustomerID); var result = db.SelectListQueue <CC_Order>(key); if (result.CustomerID.IsNullStr()) { return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel { Code = ResponseCode.DataNotFound, Message = "success" })); } return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel <CC_Order> { Code = ResponseCode.Success, Message = "success", Result = result })); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel { Code = ResponseCode.Fail, Message = "fail:" + ex.Message })); } }
public HttpResponseMessage SetRechargeOrder([FromBody] CC_Order order) { try { var db = new RedisOperation(_RedisDB); var key = RedisKeys.CCRechargeOrder(order.CustomerID); db.InsertListQueue(key, order); 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 })); } }
public HttpResponseMessage GetRechargeOrderLength([FromBody] CC_Order order) { try { var db = new RedisOperation(_RedisDB); var key = RedisKeys.CCRechargeOrder(order.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 })); } }