@Test public void checkDblist() throws Exception { mvc.perform(MockMvcRequestBuilders.get("/apiext/checkDblist?appid=1001") .contentType(MediaType.APPLICATION_JSON_UTF8) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }
@RequestMapping(value = "/checkDblist") public ServiceResult checkDblist(@RequestParam("appid") String appid, @CurrentUser LoginUser user) { List<ConfigCkeckResult> srlist = new ArrayList<>(); try { if (null != appid) { List<DataBaseInfo> list = dataBaseDao.getAllDbByAppId(appid); for (DataBaseInfo dataBaseInfo : list) { ConfigCkeckResult<List<ConfigDataResponse>> cr = databaseService.getCheckData(user, dataBaseInfo); if (cr.getCode() == ConfigCkeckResult.ERROR) { return ServiceResult.fail(cr.getMsg()); } srlist.add(ConfigCheckBase.checkData(cr.getItem())); } return ServiceResult.success(srlist); } else { return ServiceResult.fail("ApiExtController.checkDblist appid 为空"); } } catch (Exception e) { return ServiceResult.fail("ApiExtController.checkDblist appid : " + appid + " " + StringUtil.getMessage(e)); } }
ApiExtController { @RequestMapping(value = "/checkDblist") public ServiceResult checkDblist(@RequestParam("appid") String appid, @CurrentUser LoginUser user) { List<ConfigCkeckResult> srlist = new ArrayList<>(); try { if (null != appid) { List<DataBaseInfo> list = dataBaseDao.getAllDbByAppId(appid); for (DataBaseInfo dataBaseInfo : list) { ConfigCkeckResult<List<ConfigDataResponse>> cr = databaseService.getCheckData(user, dataBaseInfo); if (cr.getCode() == ConfigCkeckResult.ERROR) { return ServiceResult.fail(cr.getMsg()); } srlist.add(ConfigCheckBase.checkData(cr.getItem())); } return ServiceResult.success(srlist); } else { return ServiceResult.fail("ApiExtController.checkDblist appid 为空"); } } catch (Exception e) { return ServiceResult.fail("ApiExtController.checkDblist appid : " + appid + " " + StringUtil.getMessage(e)); } } }
ApiExtController { @RequestMapping(value = "/checkDblist") public ServiceResult checkDblist(@RequestParam("appid") String appid, @CurrentUser LoginUser user) { List<ConfigCkeckResult> srlist = new ArrayList<>(); try { if (null != appid) { List<DataBaseInfo> list = dataBaseDao.getAllDbByAppId(appid); for (DataBaseInfo dataBaseInfo : list) { ConfigCkeckResult<List<ConfigDataResponse>> cr = databaseService.getCheckData(user, dataBaseInfo); if (cr.getCode() == ConfigCkeckResult.ERROR) { return ServiceResult.fail(cr.getMsg()); } srlist.add(ConfigCheckBase.checkData(cr.getItem())); } return ServiceResult.success(srlist); } else { return ServiceResult.fail("ApiExtController.checkDblist appid 为空"); } } catch (Exception e) { return ServiceResult.fail("ApiExtController.checkDblist appid : " + appid + " " + StringUtil.getMessage(e)); } }  }
ApiExtController { @RequestMapping(value = "/checkDblist") public ServiceResult checkDblist(@RequestParam("appid") String appid, @CurrentUser LoginUser user) { List<ConfigCkeckResult> srlist = new ArrayList<>(); try { if (null != appid) { List<DataBaseInfo> list = dataBaseDao.getAllDbByAppId(appid); for (DataBaseInfo dataBaseInfo : list) { ConfigCkeckResult<List<ConfigDataResponse>> cr = databaseService.getCheckData(user, dataBaseInfo); if (cr.getCode() == ConfigCkeckResult.ERROR) { return ServiceResult.fail(cr.getMsg()); } srlist.add(ConfigCheckBase.checkData(cr.getItem())); } return ServiceResult.success(srlist); } else { return ServiceResult.fail("ApiExtController.checkDblist appid 为空"); } } catch (Exception e) { return ServiceResult.fail("ApiExtController.checkDblist appid : " + appid + " " + StringUtil.getMessage(e)); } }  @RequestMapping(value = "/check") ServiceResult check(@RequestParam("appid") String appid); @RequestMapping(value = "/checkDblist") ServiceResult checkDblist(@RequestParam("appid") String appid, @CurrentUser LoginUser user); @RequestMapping(value = "/checkAll") ServiceResult<String> checkAll(@RequestParam("appid") String appid, @CurrentUser LoginUser user, HttpServletRequest request); @RequestMapping(value = "/appidExist") ServiceResult appidExist(@RequestParam(value = "appid", defaultValue = "0") String appid); }
ApiExtController { @RequestMapping(value = "/checkDblist") public ServiceResult checkDblist(@RequestParam("appid") String appid, @CurrentUser LoginUser user) { List<ConfigCkeckResult> srlist = new ArrayList<>(); try { if (null != appid) { List<DataBaseInfo> list = dataBaseDao.getAllDbByAppId(appid); for (DataBaseInfo dataBaseInfo : list) { ConfigCkeckResult<List<ConfigDataResponse>> cr = databaseService.getCheckData(user, dataBaseInfo); if (cr.getCode() == ConfigCkeckResult.ERROR) { return ServiceResult.fail(cr.getMsg()); } srlist.add(ConfigCheckBase.checkData(cr.getItem())); } return ServiceResult.success(srlist); } else { return ServiceResult.fail("ApiExtController.checkDblist appid 为空"); } } catch (Exception e) { return ServiceResult.fail("ApiExtController.checkDblist appid : " + appid + " " + StringUtil.getMessage(e)); } }  @RequestMapping(value = "/check") ServiceResult check(@RequestParam("appid") String appid); @RequestMapping(value = "/checkDblist") ServiceResult checkDblist(@RequestParam("appid") String appid, @CurrentUser LoginUser user); @RequestMapping(value = "/checkAll") ServiceResult<String> checkAll(@RequestParam("appid") String appid, @CurrentUser LoginUser user, HttpServletRequest request); @RequestMapping(value = "/appidExist") ServiceResult appidExist(@RequestParam(value = "appid", defaultValue = "0") String appid);  }