diff --git a/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java b/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java index ff9d5e3..b8e1e6a 100644 --- a/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java +++ b/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java @@ -1196,6 +1196,21 @@ public class UserService extends AbstractUserBot implements IUserService { List installBots = installMapper.selectList(Wrappers.lambdaQuery() .eq(InstallBot::getInstallerId,userId)); + + + Map botAndAllRepoOwnerMap = new HashMap<>(); + for(InstallBot installBot : installBots) { + StringJoiner s = new StringJoiner(","); + if(botAndAllRepoOwnerMap.containsKey(installBot.getBotId())){ + s = botAndAllRepoOwnerMap.get(installBot.getBotId()); + } + if (installBot.getRepoOwner() == null || (s.length() > 0 && s.toString().contains(installBot.getRepoOwner()))){ + continue; + } + botAndAllRepoOwnerMap.put(installBot.getBotId(), s.add(installBot.getRepoOwner())); + } + + List installBotInfos = new ArrayList<>(); installBots.forEach(installBot -> { Integer botId = installBot.getBotId(); @@ -1208,6 +1223,7 @@ public class UserService extends AbstractUserBot implements IUserService { installBotInfo.setLimitVO(limitVO); BeanUtils.copyProperties(bot,installBotInfo); BeanUtils.copyProperties(installBot,installBotInfo); + installBotInfo.setRepoOwners(String.valueOf(botAndAllRepoOwnerMap.get(installBotInfo.getBotId()))); installBotInfos.add(installBotInfo); }); diff --git a/src/main/java/com/gitlink/softbot/vo/InstallBotInfo.java b/src/main/java/com/gitlink/softbot/vo/InstallBotInfo.java index 272f15b..a1f46d1 100644 --- a/src/main/java/com/gitlink/softbot/vo/InstallBotInfo.java +++ b/src/main/java/com/gitlink/softbot/vo/InstallBotInfo.java @@ -32,5 +32,5 @@ public class InstallBotInfo { LimitVO limitVO; - String repoOwner; + String repoOwners; }