Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 854c425

Browse files
author
liuyuyu
committed
🐛 空id list缺少查询检查
1 parent a110742 commit 854c425

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

dictator-web/src/main/java/com/github/liuyuyu/dictator/server/mapper/DictatorConfigGroupMapper.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.liuyuyu.dictator.server.mapper;
22

33
import com.github.liuyuyu.dictator.server.model.entity.DictatorConfigGroup;
4+
import com.google.common.collect.Maps;
45
import lombok.NonNull;
56
import org.apache.ibatis.annotations.Mapper;
67
import tk.mybatis.mapper.weekend.Weekend;
@@ -12,6 +13,9 @@
1213
@Mapper
1314
public interface DictatorConfigGroupMapper extends SimpleMapper<DictatorConfigGroup> {
1415
default Map<Long,String> findConfigNameMapByGroupIdList(@NonNull List<Long> configIdList){
16+
if(configIdList.isEmpty()){
17+
return Maps.newHashMap();
18+
}
1519
Weekend<DictatorConfigGroup> weekend = Weekend.of(DictatorConfigGroup.class);
1620
weekend.weekendCriteria()
1721
.andIn(DictatorConfigGroup::getId,configIdList);

dictator-web/src/main/java/com/github/liuyuyu/dictator/server/mapper/DictatorConfigProfileMapper.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.liuyuyu.dictator.server.mapper;
22

33
import com.github.liuyuyu.dictator.server.model.entity.DictatorConfigProfile;
4+
import com.google.common.collect.Maps;
45
import lombok.NonNull;
56
import org.apache.ibatis.annotations.Mapper;
67
import tk.mybatis.mapper.weekend.Weekend;
@@ -13,6 +14,9 @@
1314
@Mapper
1415
public interface DictatorConfigProfileMapper extends SimpleMapper<DictatorConfigProfile> {
1516
default Map<Long, String> findProfileNameByIdList(@NonNull List<Long> profileIdList) {
17+
if(profileIdList.isEmpty()){
18+
return Maps.newHashMap();
19+
}
1620
Weekend<DictatorConfigProfile> weekend = Weekend.of(DictatorConfigProfile.class);
1721
weekend.weekendCriteria()
1822
.andIn(DictatorConfigProfile::getId,profileIdList);

0 commit comments

Comments
 (0)