public HttpResponseMessage DelRole([FromBody] CC_Role role) { try { var db = new RedisOperation(_RedisDB); var key = RedisKeys.CCMenuRoleKey(role.CustomerID, role.RoleID); db.DeleteString(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 })); } }
public HttpResponseMessage Del(string key) { try { var db = new RedisOperation(_RedisDB); var result = db.DeleteString(key); return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel <string> { Code = !result ? ResponseCode.Fail : ResponseCode.Success, Message = !result ? "fail" : "success", Result = "" })); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.OK, new ResponseModel { Code = ResponseCode.Fail, Message = "fail:" + ex.Message })); } }
public HttpResponseMessage DelBasicSetting([FromBody] CC_BasicSetting basicSetting) { try { var db = new RedisOperation(_RedisDB); var key = RedisKeys.CCBasicSetting(basicSetting.CustomerId); db.DeleteString(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 })); } }
public HttpResponseMessage DelConnection([FromBody] CC_Connection Connection) { try { var db = new RedisOperation(_RedisDB); var key = RedisKeys.CCConnectionKey(Connection.CustomerID);//根据CustomerID生成对应的key db.DeleteString(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 })); } }