bot权限&订阅设置修正
This commit is contained in:
parent
9a11ade8bd
commit
f81b1cc078
|
|
@ -24,11 +24,6 @@ public class MarketController {
|
|||
IMarketService marketService;
|
||||
|
||||
|
||||
@GetMapping("/tt")
|
||||
public String tt(){
|
||||
return "asd";
|
||||
}
|
||||
|
||||
/***
|
||||
* 通过功能类型查询MarketBot
|
||||
* @param func
|
||||
|
|
|
|||
|
|
@ -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<>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue