Search in sources :

Example 1 with SysUserRole

use of org.jeecg.modules.system.entity.SysUserRole in project kms by mahonelau.

the class SysThirdAccountServiceImpl method saveThirdUser.

public String saveThirdUser(SysUser sysUser) {
    // 保存用户
    String userid = UUIDGenerator.generate();
    sysUser.setId(userid);
    sysUserMapper.insert(sysUser);
    // 获取第三方角色
    SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "third_role"));
    // 保存用户角色
    SysUserRole userRole = new SysUserRole();
    userRole.setRoleId(sysRole.getId());
    userRole.setUserId(userid);
    sysUserRoleMapper.insert(userRole);
    return userid;
}
Also used : SysRole(org.jeecg.modules.system.entity.SysRole) LambdaQueryWrapper(com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper) SysUserRole(org.jeecg.modules.system.entity.SysUserRole)

Example 2 with SysUserRole

use of org.jeecg.modules.system.entity.SysUserRole in project jeecg-boot by jeecgboot.

the class SysThirdAccountServiceImpl method saveThirdUser.

public String saveThirdUser(SysUser sysUser) {
    // 保存用户
    String userid = UUIDGenerator.generate();
    sysUser.setId(userid);
    sysUserMapper.insert(sysUser);
    // 获取第三方角色
    SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "third_role"));
    // 保存用户角色
    SysUserRole userRole = new SysUserRole();
    userRole.setRoleId(sysRole.getId());
    userRole.setUserId(userid);
    sysUserRoleMapper.insert(userRole);
    return userid;
}
Also used : SysRole(org.jeecg.modules.system.entity.SysRole) LambdaQueryWrapper(com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper) SysUserRole(org.jeecg.modules.system.entity.SysUserRole)

Example 3 with SysUserRole

use of org.jeecg.modules.system.entity.SysUserRole in project kykms by mahonelau.

the class SysThirdAccountServiceImpl method saveThirdUser.

public String saveThirdUser(SysUser sysUser) {
    // 保存用户
    String userid = UUIDGenerator.generate();
    sysUser.setId(userid);
    sysUserMapper.insert(sysUser);
    // 获取第三方角色
    SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "third_role"));
    // 保存用户角色
    SysUserRole userRole = new SysUserRole();
    userRole.setRoleId(sysRole.getId());
    userRole.setUserId(userid);
    sysUserRoleMapper.insert(userRole);
    return userid;
}
Also used : SysRole(org.jeecg.modules.system.entity.SysRole) LambdaQueryWrapper(com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper) SysUserRole(org.jeecg.modules.system.entity.SysUserRole)

Aggregations

LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)3 SysRole (org.jeecg.modules.system.entity.SysRole)3 SysUserRole (org.jeecg.modules.system.entity.SysUserRole)3