@Test public void setupAdminTest() throws Exception { Assert.assertTrue(setupDataBaseService.setupAdmin(dasGroup, user)); }
public boolean setupAdmin(DasGroup dasGroup, LoginUser user) throws Exception { if (StringUtils.isBlank(dasGroup.getGroup_name())) { return false; } if (StringUtils.isBlank(user.getUserName())) { return false; } Long userResult = loginUserDao.insertUser(user); if (userResult <= 0) { return false; } user = loginUserDao.getUserByNo(user.getUserNo()); dasGroup.setId(consts.SUPER_GROUP_ID); dasGroup.setUpdate_user_no(user.getUserNo()); Long groupResult = groupDao.insertDasGroup(dasGroup); if (groupResult <= 0) { return false; } Long userGroupResult = userGroupDao.insertUserGroup(user.getId(), consts.SUPER_GROUP_ID, RoleTypeEnum.Admin.getType(), OperateUserEnum.Allow.getType()); if (userGroupResult <= 0) { return false; } return true; }
SetupDataBaseService { public boolean setupAdmin(DasGroup dasGroup, LoginUser user) throws Exception { if (StringUtils.isBlank(dasGroup.getGroup_name())) { return false; } if (StringUtils.isBlank(user.getUserName())) { return false; } Long userResult = loginUserDao.insertUser(user); if (userResult <= 0) { return false; } user = loginUserDao.getUserByNo(user.getUserNo()); dasGroup.setId(consts.SUPER_GROUP_ID); dasGroup.setUpdate_user_no(user.getUserNo()); Long groupResult = groupDao.insertDasGroup(dasGroup); if (groupResult <= 0) { return false; } Long userGroupResult = userGroupDao.insertUserGroup(user.getId(), consts.SUPER_GROUP_ID, RoleTypeEnum.Admin.getType(), OperateUserEnum.Allow.getType()); if (userGroupResult <= 0) { return false; } return true; } }
SetupDataBaseService { public boolean setupAdmin(DasGroup dasGroup, LoginUser user) throws Exception { if (StringUtils.isBlank(dasGroup.getGroup_name())) { return false; } if (StringUtils.isBlank(user.getUserName())) { return false; } Long userResult = loginUserDao.insertUser(user); if (userResult <= 0) { return false; } user = loginUserDao.getUserByNo(user.getUserNo()); dasGroup.setId(consts.SUPER_GROUP_ID); dasGroup.setUpdate_user_no(user.getUserNo()); Long groupResult = groupDao.insertDasGroup(dasGroup); if (groupResult <= 0) { return false; } Long userGroupResult = userGroupDao.insertUserGroup(user.getId(), consts.SUPER_GROUP_ID, RoleTypeEnum.Admin.getType(), OperateUserEnum.Allow.getType()); if (userGroupResult <= 0) { return false; } return true; }  }
SetupDataBaseService { public boolean setupAdmin(DasGroup dasGroup, LoginUser user) throws Exception { if (StringUtils.isBlank(dasGroup.getGroup_name())) { return false; } if (StringUtils.isBlank(user.getUserName())) { return false; } Long userResult = loginUserDao.insertUser(user); if (userResult <= 0) { return false; } user = loginUserDao.getUserByNo(user.getUserNo()); dasGroup.setId(consts.SUPER_GROUP_ID); dasGroup.setUpdate_user_no(user.getUserNo()); Long groupResult = groupDao.insertDasGroup(dasGroup); if (groupResult <= 0) { return false; } Long userGroupResult = userGroupDao.insertUserGroup(user.getId(), consts.SUPER_GROUP_ID, RoleTypeEnum.Admin.getType(), OperateUserEnum.Allow.getType()); if (userGroupResult <= 0) { return false; } return true; }  ServiceResult connectionTest(ConnectionRequest connectionRequest); boolean tableConsistent(String catalog); boolean setupAdmin(DasGroup dasGroup, LoginUser user); boolean isDalInitialized(); }
SetupDataBaseService { public boolean setupAdmin(DasGroup dasGroup, LoginUser user) throws Exception { if (StringUtils.isBlank(dasGroup.getGroup_name())) { return false; } if (StringUtils.isBlank(user.getUserName())) { return false; } Long userResult = loginUserDao.insertUser(user); if (userResult <= 0) { return false; } user = loginUserDao.getUserByNo(user.getUserNo()); dasGroup.setId(consts.SUPER_GROUP_ID); dasGroup.setUpdate_user_no(user.getUserNo()); Long groupResult = groupDao.insertDasGroup(dasGroup); if (groupResult <= 0) { return false; } Long userGroupResult = userGroupDao.insertUserGroup(user.getId(), consts.SUPER_GROUP_ID, RoleTypeEnum.Admin.getType(), OperateUserEnum.Allow.getType()); if (userGroupResult <= 0) { return false; } return true; }  ServiceResult connectionTest(ConnectionRequest connectionRequest); boolean tableConsistent(String catalog); boolean setupAdmin(DasGroup dasGroup, LoginUser user); boolean isDalInitialized(); static final Object LOCK; final static String DATASOURCE_MYSQL_DRIVER; final static String jdbcUrlTemplate; }