Search in sources :

Example 6 with User

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);
}
Also used : User(com.baidu.disconf.web.service.user.bo.User)

Example 7 with 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);
}
Also used : User(com.baidu.disconf.web.service.user.bo.User) ArrayList(java.util.ArrayList)

Example 8 with User

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);
}
Also used : User(com.baidu.disconf.web.service.user.bo.User) ArrayList(java.util.ArrayList)

Aggregations

User (com.baidu.disconf.web.service.user.bo.User)8 Visitor (com.baidu.disconf.web.service.user.dto.Visitor)2 ArrayList (java.util.ArrayList)2 Transactional (org.springframework.transaction.annotation.Transactional)2 VisitorVo (com.baidu.disconf.web.service.user.vo.VisitorVo)1 NoAuth (com.baidu.dsp.common.annotation.NoAuth)1 FieldException (com.baidu.dsp.common.exception.FieldException)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1