|
|
@ -561,4 +561,21 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
|
|
|
return userMapper.getallzyo(id); |
|
|
|
return userMapper.getallzyo(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//这个是获取一个虚拟用户的对象
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public SysUser getuser() { |
|
|
|
|
|
|
|
//虚拟角色id
|
|
|
|
|
|
|
|
String roleid="1630020854744330241"; |
|
|
|
|
|
|
|
//根据角色id查询用户id
|
|
|
|
|
|
|
|
List<String> uids = new ArrayList<>(); |
|
|
|
|
|
|
|
//获取用户id的合集
|
|
|
|
|
|
|
|
uids = userMapper.getuserids(roleid); |
|
|
|
|
|
|
|
Random random = new Random(); |
|
|
|
|
|
|
|
int n = random.nextInt(uids.size()); |
|
|
|
|
|
|
|
String needid = uids.get(n); |
|
|
|
|
|
|
|
SysUser sysUser = new SysUser(); |
|
|
|
|
|
|
|
sysUser = userMapper.getneeduser(needid); |
|
|
|
|
|
|
|
return sysUser; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|