/** @param newPassword */ @Override public void modifyPassword(Long userId, String newPassword) { String passwordWithSalt = SignUtils.createPassword(newPassword); User user = userDao.get(userId); user.setPassword(passwordWithSalt); userDao.update(user); }
/** 创建 */ @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false) public Long create(User user) { user = userDao.create(user); return user.getId(); }
/** @param userId */ @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false) public String addOneAppForUser(Long userId, int appId) { User user = getUser(userId); String ownAppIds = user.getOwnApps(); if (ownAppIds.contains(",")) { ownAppIds = ownAppIds + "," + appId; } else { ownAppIds = String.valueOf(appId); } user.setOwnApps(ownAppIds); userDao.update(user); return ownAppIds; }
/** @param userId */ @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false) public String addOneAppForUser(Long userId, Long appId) { User user = getUser(userId); String ownAppIds = user.getOwnApps(); if (!StringUtils.isBlank(ownAppIds)) { ownAppIds = ownAppIds + "," + appId; } else { ownAppIds = String.valueOf(appId); } user.setOwnApps(ownAppIds); Visitor visitor = ThreadContext.getSessionVisitor(); visitor.setAppIds(user.getOwnApps()); userDao.update(user); return ownAppIds; }