From f81b1cc078d542162a6b3f1285c2f13bd84d4c1b Mon Sep 17 00:00:00 2001 From: wanjia <553039491@qq.com> Date: Tue, 4 Apr 2023 09:40:07 +0800 Subject: [PATCH] =?UTF-8?q?bot=E6=9D=83=E9=99=90&=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../softbot/controller/market/MarketController.java | 5 ----- .../softbot/service/user/impl/UserService.java | 13 +++++++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/gitlink/softbot/controller/market/MarketController.java b/src/main/java/com/gitlink/softbot/controller/market/MarketController.java index fd9673a..b1efa6e 100644 --- a/src/main/java/com/gitlink/softbot/controller/market/MarketController.java +++ b/src/main/java/com/gitlink/softbot/controller/market/MarketController.java @@ -24,11 +24,6 @@ public class MarketController { IMarketService marketService; - @GetMapping("/tt") - public String tt(){ - return "asd"; - } - /*** * 通过功能类型查询MarketBot * @param func 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 97e0021..d20cfef 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 @@ -261,17 +261,22 @@ public class UserService extends AbstractUserBot implements IUserService { String eventPr = limitVO.getEventPr(); //无权限条件下 if (StringUtils.isBlank(eventCode)&&StringUtils.isBlank(eventPr)){ - throw new BotException("事件不能为空!"); + throw new BotException("订阅事件不能为空!"); } //0:只读1:读写2:无权限 Integer jurisDictionCode = limitVO.getJurisDictionCode(); //0:只读1:读写2:无权限 Integer jurisDictionPr = limitVO.getJurisDictionPr(); - if ((jurisDictionCode!=2&&StringUtils.isBlank(limitVO.getEventCode())) - ||(jurisDictionPr!=2&&StringUtils.isBlank(limitVO.getEventPr()))){ - throw new BotException("事件不能为空!"); + if ((jurisDictionCode == 2) && (jurisDictionPr == 2)){ + throw new BotException("仓库访问权限不能为空!"); } + + if (jurisDictionCode == 2 && !StringUtils.isBlank(eventCode) + || jurisDictionPr == 2 && StringUtils.isBlank(eventPr)) { + throw new BotException("权限&订阅设置错误!"); + } + String[] codeEvents = eventCode.split(","); String[] prEvents = eventPr.split(","); List eventList = new ArrayList<>();