member: 修正 查询用户列表方法,传入的ID集合为空时,会导致异常的问题

This commit is contained in:
owen 2023-09-10 23:32:40 +08:00
parent 6c193f723f
commit dffdd471d5

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.member.service.user; package cn.iocoder.yudao.module.member.service.user;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -103,6 +105,9 @@ public class MemberUserServiceImpl implements MemberUserService {
@Override @Override
public List<MemberUserDO> getUserList(Collection<Long> ids) { public List<MemberUserDO> getUserList(Collection<Long> ids) {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return memberUserMapper.selectBatchIds(ids); return memberUserMapper.selectBatchIds(ids);
} }