@Test public void testGet() { LideaMethodReq req = new LideaMethodReq(); req.setAppName("cabinet-base-server"); req.setServiceName("com.fcbox.edms.terminal.api.CabinetServiceFacade"); req.setMethodName("getCabinetInfo"); LideaMethodResp resp = lideaMethodDAO.get(req); System.out.println("=========================================================================================="); System.out.println(JSON.toJSONString(resp)); }
public LideaMethodResp get(LideaMethodReq req) { log.info("req : {}", JSON.toJSONString(req)); LideaMethodResp resp = new LideaMethodResp(); resp.setAppName(req.getAppName()); resp.setServiceName(req.getServiceName()); resp.setMethodName(req.getMethodName()); List<LideaMethodBO> data = hbaseTemplate.execute(Const.LIDEA_METHOD_TABLE, (table) -> { LideaMethodBO bo = new LideaMethodBO(); bo.setAppName(req.getAppName()); bo.setServiceName(req.getServiceName()); bo.setMethodName(req.getMethodName()); byte[] rowKey = LideaMethodEntry.makeRowKey(bo); Get get = new Get(rowKey); Result result = table.get(get); LideaMethodBO lideaMethodBO = LideaMethodEntry.map(result); return Collections.singletonList(lideaMethodBO); }); resp.setData(data); return resp; }
LideaMethodDAO { public LideaMethodResp get(LideaMethodReq req) { log.info("req : {}", JSON.toJSONString(req)); LideaMethodResp resp = new LideaMethodResp(); resp.setAppName(req.getAppName()); resp.setServiceName(req.getServiceName()); resp.setMethodName(req.getMethodName()); List<LideaMethodBO> data = hbaseTemplate.execute(Const.LIDEA_METHOD_TABLE, (table) -> { LideaMethodBO bo = new LideaMethodBO(); bo.setAppName(req.getAppName()); bo.setServiceName(req.getServiceName()); bo.setMethodName(req.getMethodName()); byte[] rowKey = LideaMethodEntry.makeRowKey(bo); Get get = new Get(rowKey); Result result = table.get(get); LideaMethodBO lideaMethodBO = LideaMethodEntry.map(result); return Collections.singletonList(lideaMethodBO); }); resp.setData(data); return resp; } }
LideaMethodDAO { public LideaMethodResp get(LideaMethodReq req) { log.info("req : {}", JSON.toJSONString(req)); LideaMethodResp resp = new LideaMethodResp(); resp.setAppName(req.getAppName()); resp.setServiceName(req.getServiceName()); resp.setMethodName(req.getMethodName()); List<LideaMethodBO> data = hbaseTemplate.execute(Const.LIDEA_METHOD_TABLE, (table) -> { LideaMethodBO bo = new LideaMethodBO(); bo.setAppName(req.getAppName()); bo.setServiceName(req.getServiceName()); bo.setMethodName(req.getMethodName()); byte[] rowKey = LideaMethodEntry.makeRowKey(bo); Get get = new Get(rowKey); Result result = table.get(get); LideaMethodBO lideaMethodBO = LideaMethodEntry.map(result); return Collections.singletonList(lideaMethodBO); }); resp.setData(data); return resp; }  }
LideaMethodDAO { public LideaMethodResp get(LideaMethodReq req) { log.info("req : {}", JSON.toJSONString(req)); LideaMethodResp resp = new LideaMethodResp(); resp.setAppName(req.getAppName()); resp.setServiceName(req.getServiceName()); resp.setMethodName(req.getMethodName()); List<LideaMethodBO> data = hbaseTemplate.execute(Const.LIDEA_METHOD_TABLE, (table) -> { LideaMethodBO bo = new LideaMethodBO(); bo.setAppName(req.getAppName()); bo.setServiceName(req.getServiceName()); bo.setMethodName(req.getMethodName()); byte[] rowKey = LideaMethodEntry.makeRowKey(bo); Get get = new Get(rowKey); Result result = table.get(get); LideaMethodBO lideaMethodBO = LideaMethodEntry.map(result); return Collections.singletonList(lideaMethodBO); }); resp.setData(data); return resp; }  LideaMethodBO put(LideaMethodBO bo); List<LideaMethodBO> scan(LideaMethodReq req); LideaMethodResp get(LideaMethodReq req); }
LideaMethodDAO { public LideaMethodResp get(LideaMethodReq req) { log.info("req : {}", JSON.toJSONString(req)); LideaMethodResp resp = new LideaMethodResp(); resp.setAppName(req.getAppName()); resp.setServiceName(req.getServiceName()); resp.setMethodName(req.getMethodName()); List<LideaMethodBO> data = hbaseTemplate.execute(Const.LIDEA_METHOD_TABLE, (table) -> { LideaMethodBO bo = new LideaMethodBO(); bo.setAppName(req.getAppName()); bo.setServiceName(req.getServiceName()); bo.setMethodName(req.getMethodName()); byte[] rowKey = LideaMethodEntry.makeRowKey(bo); Get get = new Get(rowKey); Result result = table.get(get); LideaMethodBO lideaMethodBO = LideaMethodEntry.map(result); return Collections.singletonList(lideaMethodBO); }); resp.setData(data); return resp; }  LideaMethodBO put(LideaMethodBO bo); List<LideaMethodBO> scan(LideaMethodReq req); LideaMethodResp get(LideaMethodReq req);  }