use of com.hb0730.boot.admin.project.system.user.model.entity.UserRoleEntity in project boot-admin by hb0730.
the class UserRoleServiceImpl method saveBatch.
private void saveBatch(@Nonnull Long userId, @Nonnull Collection<Long> roleIds) {
Assert.notNull(userId, "用户id为空");
Assert.notEmpty(roleIds, "角色id为空");
List<UserRoleEntity> entities = new ArrayList<>(roleIds.size());
for (Long roleId : roleIds) {
UserRoleEntity entity = new UserRoleEntity();
entity.setUserId(userId);
entity.setRoleId(roleId);
entities.add(entity);
}
saveBatch(entities);
}
Aggregations