@Test public void removeMsInst() { Boolean success = redisMsInstService.removeMsInst(1L); assertTrue(success); TacInst tacMsInst = redisMsInstService.getTacMsInst(1L); assertNull(tacMsInst); }
@Override public Boolean removeMsInst(Long instId) { String key = String.valueOf(instId); TacInst tacInst = hashOperations.get(getMainKey(), key); if (tacInst != null) { hashOperations.delete(getMainKey() + tacInst.getMsCode(), key); } hashOperations.delete(getMainKey(), key); return true; }
RedisMsInstService implements IMsInstService { @Override public Boolean removeMsInst(Long instId) { String key = String.valueOf(instId); TacInst tacInst = hashOperations.get(getMainKey(), key); if (tacInst != null) { hashOperations.delete(getMainKey() + tacInst.getMsCode(), key); } hashOperations.delete(getMainKey(), key); return true; } }
RedisMsInstService implements IMsInstService { @Override public Boolean removeMsInst(Long instId) { String key = String.valueOf(instId); TacInst tacInst = hashOperations.get(getMainKey(), key); if (tacInst != null) { hashOperations.delete(getMainKey() + tacInst.getMsCode(), key); } hashOperations.delete(getMainKey(), key); return true; }  }
RedisMsInstService implements IMsInstService { @Override public Boolean removeMsInst(Long instId) { String key = String.valueOf(instId); TacInst tacInst = hashOperations.get(getMainKey(), key); if (tacInst != null) { hashOperations.delete(getMainKey() + tacInst.getMsCode(), key); } hashOperations.delete(getMainKey(), key); return true; }  @Override List<TacInst> getAllTacMsInsts(); @Override TacInst getTacMsInst(Long msInstId); @Override TacInst createTacMsInst(TacInst tacInst); @Override Boolean updateTacMsInst(Long instId, TacInst tacInst); @Override Boolean removeMsInst(Long instId); @Override List<TacInst> getMsInsts(String code); }
RedisMsInstService implements IMsInstService { @Override public Boolean removeMsInst(Long instId) { String key = String.valueOf(instId); TacInst tacInst = hashOperations.get(getMainKey(), key); if (tacInst != null) { hashOperations.delete(getMainKey() + tacInst.getMsCode(), key); } hashOperations.delete(getMainKey(), key); return true; }  @Override List<TacInst> getAllTacMsInsts(); @Override TacInst getTacMsInst(Long msInstId); @Override TacInst createTacMsInst(TacInst tacInst); @Override Boolean updateTacMsInst(Long instId, TacInst tacInst); @Override Boolean removeMsInst(Long instId); @Override List<TacInst> getMsInsts(String code);  }