use of com.baidu.disconf.web.service.user.bo.User in project disconf by knightliao.
the class UserMgrImpl method modifyPassword.
/**
* @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);
}
use of com.baidu.disconf.web.service.user.bo.User in project disconf by knightliao.
the class UserCreateCommon method generateCreateSpecifyUserSQL.
/**
* @param userName
* @param password
*/
public static void generateCreateSpecifyUserSQL(UserDao userDao, String userName, String password, RoleEnum roleEnum, String ownAppIds) {
User user = new User();
user.setName(userName);
user.setPassword(SignUtils.createPassword(password));
// token
user.setToken(SignUtils.createToken(userName));
// set appids
user.setOwnApps(ownAppIds);
// role
user.setRoleId(roleEnum.getValue());
System.out.println("/* " + userName + "\t" + password + "*/");
// userDao.create(user);
List<User> userList = new ArrayList<User>();
userList.add(user);
printUserList(userList);
}
use of com.baidu.disconf.web.service.user.bo.User in project disconf by knightliao.
the class UserCreateCommon method generateCreateTestUserSQL.
/**
* 生成内测用户
*/
public static void generateCreateTestUserSQL(UserDao userDao) {
System.out.println("\n");
int num = 5;
List<User> userList = new ArrayList<User>();
for (Long i = 1L; i < num + 1; ++i) {
User user = new User();
user.setId(i);
user.setName(getUserName(i));
user.setOwnApps("2");
user.setRoleId(RoleEnum.NORMAL.getValue());
int random = RandomUtil.random(0, 10000);
String password = "MhxzKhl" + String.valueOf(random);
user.setPassword(SignUtils.createPassword(password));
// token
user.setToken(SignUtils.createToken(user.getName()));
System.out.println("/* userid" + user.getId() + "\t" + password + "*/");
// userDao.create(user);
userList.add(user);
}
printUserList(userList);
}
Aggregations