@Test public void deleteCheckTest() throws SQLException { Project project = Project.builder().id(1L).name("name").build(); Assert.assertTrue(projectService.deleteCheck(1L).getCode() == ServiceResult.SUCCESS); }
public ServiceResult deleteCheck(Long projectId) throws SQLException { if (deleteCheckDao.isProjectIdInProjectDbsetRelatio(projectId)) { return ServiceResult.fail("请先删除与逻辑库的关联关系！"); } if (deleteCheckDao.isProjectIdInTaskSQL(projectId)) { return ServiceResult.fail("请先删除与之相关查询实体！"); } if (deleteCheckDao.isProjectIdInTaskTable(projectId)) { return ServiceResult.fail("请先删除与之相关表实体！"); } return ServiceResult.success(); }
ProjectService { public ServiceResult deleteCheck(Long projectId) throws SQLException { if (deleteCheckDao.isProjectIdInProjectDbsetRelatio(projectId)) { return ServiceResult.fail("请先删除与逻辑库的关联关系！"); } if (deleteCheckDao.isProjectIdInTaskSQL(projectId)) { return ServiceResult.fail("请先删除与之相关查询实体！"); } if (deleteCheckDao.isProjectIdInTaskTable(projectId)) { return ServiceResult.fail("请先删除与之相关表实体！"); } return ServiceResult.success(); } }
ProjectService { public ServiceResult deleteCheck(Long projectId) throws SQLException { if (deleteCheckDao.isProjectIdInProjectDbsetRelatio(projectId)) { return ServiceResult.fail("请先删除与逻辑库的关联关系！"); } if (deleteCheckDao.isProjectIdInTaskSQL(projectId)) { return ServiceResult.fail("请先删除与之相关查询实体！"); } if (deleteCheckDao.isProjectIdInTaskTable(projectId)) { return ServiceResult.fail("请先删除与之相关表实体！"); } return ServiceResult.success(); }  }
ProjectService { public ServiceResult deleteCheck(Long projectId) throws SQLException { if (deleteCheckDao.isProjectIdInProjectDbsetRelatio(projectId)) { return ServiceResult.fail("请先删除与逻辑库的关联关系！"); } if (deleteCheckDao.isProjectIdInTaskSQL(projectId)) { return ServiceResult.fail("请先删除与之相关查询实体！"); } if (deleteCheckDao.isProjectIdInTaskTable(projectId)) { return ServiceResult.fail("请先删除与之相关表实体！"); } return ServiceResult.success(); }  ValidatorChain validatePermision(LoginUser user, Project project, Errors errors); ServiceResult<String> insertProject(Project project); ServiceResult<String> updateProject(Project project); ServiceResult deleteCheck(Long projectId); ServiceResult<String> deleteProject(Project project); ListResult<ProjectView> findProjectPageList(Paging<ProjectModel> paging); boolean isExistByAppId(String appid); boolean isNotExistByAppId(Project project); boolean isNotExistByName(Project project); ServiceResult generateProjectXml(LoginUser user, Long projectId, String codeGenFilePath); ServiceResult<String> addDataCenter(LoginUser user, Project project); ServiceResult<String> updateDataCenter(LoginUser user, Project oldProject, ProjectView oldProjectView, Project newProject); ServiceResult<String> deleteDataCenter(LoginUser user, Project projec); ServiceResult<String> syncProject(LoginUser user, Project project); ConfigCkeckResult<List<ConfigDataResponse>> getCheckData(LoginUser user, Project project); ServiceResult getProjectButton(LoginUser user); }
ProjectService { public ServiceResult deleteCheck(Long projectId) throws SQLException { if (deleteCheckDao.isProjectIdInProjectDbsetRelatio(projectId)) { return ServiceResult.fail("请先删除与逻辑库的关联关系！"); } if (deleteCheckDao.isProjectIdInTaskSQL(projectId)) { return ServiceResult.fail("请先删除与之相关查询实体！"); } if (deleteCheckDao.isProjectIdInTaskTable(projectId)) { return ServiceResult.fail("请先删除与之相关表实体！"); } return ServiceResult.success(); }  ValidatorChain validatePermision(LoginUser user, Project project, Errors errors); ServiceResult<String> insertProject(Project project); ServiceResult<String> updateProject(Project project); ServiceResult deleteCheck(Long projectId); ServiceResult<String> deleteProject(Project project); ListResult<ProjectView> findProjectPageList(Paging<ProjectModel> paging); boolean isExistByAppId(String appid); boolean isNotExistByAppId(Project project); boolean isNotExistByName(Project project); ServiceResult generateProjectXml(LoginUser user, Long projectId, String codeGenFilePath); ServiceResult<String> addDataCenter(LoginUser user, Project project); ServiceResult<String> updateDataCenter(LoginUser user, Project oldProject, ProjectView oldProjectView, Project newProject); ServiceResult<String> deleteDataCenter(LoginUser user, Project projec); ServiceResult<String> syncProject(LoginUser user, Project project); ConfigCkeckResult<List<ConfigDataResponse>> getCheckData(LoginUser user, Project project); ServiceResult getProjectButton(LoginUser user);  }