bot权限&订阅设置修正

This commit is contained in:
wanjia 2023-04-04 09:40:07 +08:00
parent 9a11ade8bd
commit f81b1cc078
2 changed files with 9 additions and 9 deletions

View File

@ -24,11 +24,6 @@ public class MarketController {
IMarketService marketService;
@GetMapping("/tt")
public String tt(){
return "asd";
}
/***
* 通过功能类型查询MarketBot
* @param func

View File

@ -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<Integer> eventList = new ArrayList<>();