generated from root/miduo_server
非同一跨服服务器无法合服
parent
7cbf3d5152
commit
4eedcdabd6
|
@ -1,52 +0,0 @@
|
||||||
package com.jmfy.controller;
|
|
||||||
|
|
||||||
import com.jmfy.dao.ServerInfoDao;
|
|
||||||
import com.jmfy.model.ServerAreaInfo;
|
|
||||||
import com.jmfy.model.ServerAreaInfoManager;
|
|
||||||
import com.jmfy.model.ServerInfo;
|
|
||||||
import com.jmfy.utils.JsonUtil;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.ModelMap;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpSession;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
public class HeFuNewController {
|
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(HeFuNewController.class);
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ServerInfoDao serverInfoDao;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量开启白名单
|
|
||||||
* @param request
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/closeServer", method = {RequestMethod.POST, RequestMethod.GET})
|
|
||||||
public @ResponseBody String closeServer(HttpServletRequest request) throws Exception {
|
|
||||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
|
||||||
String[] serverIds = parameterMap.get("serverIds").split("#");
|
|
||||||
List<String> strings = Arrays.asList(serverIds);
|
|
||||||
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
|
|
||||||
for (ServerInfo serverInfo : allServerInfo) {
|
|
||||||
if (strings.contains(serverInfo.getServer_id())) {
|
|
||||||
serverInfo.setStatus("1");
|
|
||||||
serverInfo.setIsWhite("1");
|
|
||||||
// serverInfoDao.updateServerInfo(serverInfo.getServer_id(), 1, 1, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "服务器:" + parameterMap.get("serverIds").replace("#",",") + " 关服成功";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue