@Override public List<User> getUsersByModel(CoreUserModel userModel) { if (userModel != null && StringUtils.isNotBlank(userModel.getUsername())) { userModel.setUsername("%" + userModel.getUsername() + "%"); } List<User> list = coreUserDao.getUsersByModel(userModel); return list; }
@Override public void deleteUser(Integer userId) throws BusinessException { coreUserDao.deleteById(userId); // User2MenuModel user2MenuModel = new User2MenuModel(); // user2MenuModel.setUserId(userId); // user2MenuDao.deleteByModel(user2MenuModel); }
@Override public CoreUserModel getUserByUsername(String username) throws BusinessException { if (StringUtils.isNotBlank(username)) return coreUserDao.getUserByUsername(username.trim()); return null; }
@Override public CoreUserModel getUserById(Integer userId) throws BusinessException { if (userId != null) return coreUserDao.getModelById(userId); return null; }
@Override public void createUser(CoreUserModel user) throws BusinessException { coreUserDao.insert(user); }
@Override public List<User> getUsers() throws BusinessException { List<User> list = coreUserDao.findAll(); return list; }