功能封禁

master
xuexinpeng 2021-08-06 18:24:59 +08:00
parent d14ea2b5f6
commit 8e44fa8b9e
1 changed files with 21 additions and 15 deletions

View File

@ -256,7 +256,7 @@ public @ResponseBody String banFunction(HttpServletRequest request) throws Excep
String function = request.getParameter("type");// protocal/good
String action = request.getParameter("operate");// ban/opend
String id = request.getParameter("Id");// id
String splitId[] = id.split(",");
ServerBanPro banDao = banFuctionDao.findUserInfo();
if(banDao == null ){
@ -270,30 +270,36 @@ public @ResponseBody String banFunction(HttpServletRequest request) throws Excep
switch (function){
case "protocal":
if(action.equals("ban")){
if(!banDao.getBanProtoId().contains(Integer.valueOf(id))){
banDao.getBanProtoId().add(Integer.valueOf(id));
banFuctionDao.updateServerBanPro(banDao);
for(String string:splitId) {
if(!banDao.getBanProtoId().contains(Integer.valueOf(string))){
banDao.getBanProtoId().add(Integer.valueOf(string));
banFuctionDao.updateServerBanPro(banDao);
}
}
}else if(action.equals("open")){
if(banDao.getBanProtoId().contains(Integer.valueOf(id))){
banDao.getBanProtoId().remove(Integer.valueOf(id));
banFuctionDao.updateServerBanPro(banDao);
for(String string:splitId){
if(banDao.getBanProtoId().contains(Integer.valueOf(string))){
banDao.getBanProtoId().remove(Integer.valueOf(string));
banFuctionDao.updateServerBanPro(banDao);
}
}
}
break;
case "good":
if(action.equals("ban")){
if(!banDao.getBanGoodList().contains(Integer.valueOf(id))){
banDao.getBanGoodList().add(Integer.valueOf(id));
banFuctionDao.updateServerBanPro(banDao);
for(String string:splitId){
if(!banDao.getBanGoodList().contains(Integer.valueOf(string))){
banDao.getBanGoodList().add(Integer.valueOf(string));
banFuctionDao.updateServerBanPro(banDao);
}
}
}else if(action.equals("open")){
if(banDao.getBanGoodList().contains(Integer.valueOf(id))){
banDao.getBanGoodList().remove(Integer.valueOf(id));
banFuctionDao.updateServerBanPro(banDao);
for(String string:splitId){
if(banDao.getBanGoodList().contains(Integer.valueOf(string))){
banDao.getBanGoodList().remove(Integer.valueOf(string));
banFuctionDao.updateServerBanPro(banDao);
}
}
}
break;
}