public void deleteUser(Long id) { if (isSupervisor(id)) { logger.warn("操作员{}尝试删除超级管理员用户", SpringSecurityUtils.getCurrentUserName()); throw new ServiceException("不能删除超级管理员用户"); } userDao.delete(id); }
@Transactional(readOnly = true) public List<User> getAllUser() { return userDao.getAll("id", true); }
@Transactional(readOnly = true) public boolean isLoginNameUnique(String newLoginName, String oldLoginName) { return userDao.isPropertyUnique("username", newLoginName, oldLoginName); }
@Transactional(readOnly = true) public User loadUserByUsername(String loginName) { return userDao.findUniqueBy("username", loginName); }
@Transactional(readOnly = true) public Page<User> searchUser(final Page<User> page, final List<PropertyFilter> filters) { return userDao.findPage(page, filters); }
public void saveUser(User entity) { userDao.save(entity); }
// -- User Manager --// @Transactional(readOnly = true) public User getUser(Long id) { return userDao.get(id); }