mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-03 20:38:52 +08:00
Clean up code
This commit is contained in:
parent
c078e022e2
commit
8fae1a824d
@ -57,28 +57,6 @@ public class LoginControl extends BaseServerController {
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
// /**
|
||||
// * 登录页面
|
||||
// *
|
||||
// * @return login
|
||||
// */
|
||||
// @RequestMapping(value = "login.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @NotLogin
|
||||
// public String login() {
|
||||
// if (userService.userListEmpty()) {
|
||||
// // 调整到初始化也
|
||||
// return BaseJpomInterceptor.getRedirect(getRequest(), "/install.html");
|
||||
// }
|
||||
// // 是否显示验证码
|
||||
// setAttribute("showCode", showCode());
|
||||
// return "login";
|
||||
// }
|
||||
|
||||
// private boolean showCode() {
|
||||
// String showCode = getSessionAttribute(SHOW_CODE);
|
||||
// return StrUtil.isNotEmpty(showCode);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*
|
||||
@ -197,17 +175,6 @@ public class LoginControl extends BaseServerController {
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 退出登录
|
||||
// *
|
||||
// * @return page
|
||||
// */
|
||||
// @RequestMapping(value = "logout", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// public String logoutPage() {
|
||||
// getSession().invalidate();
|
||||
// return BaseJpomInterceptor.getRedirect(getRequest(), "/old.html");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*
|
||||
|
@ -48,23 +48,11 @@ public class OutGivingController extends BaseServerController {
|
||||
@Resource
|
||||
private BuildService buildService;
|
||||
|
||||
// @RequestMapping(value = "list.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @Feature(method = MethodFeature.LIST)
|
||||
// public String list() {
|
||||
// List<OutGivingModel> outGivingModels = outGivingServer.list();
|
||||
// setAttribute("array", outGivingModels);
|
||||
// // 节点数是否大于二
|
||||
// List<NodeModel> list = nodeService.list();
|
||||
// boolean trueNode = list != null && list.size() > 1;
|
||||
// setAttribute("trueNode", trueNode);
|
||||
// return "outgiving/list";
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @author Hotstrip
|
||||
* load dispatch list
|
||||
* 加载分发列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "dispatch-list", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
@ -74,36 +62,11 @@ public class OutGivingController extends BaseServerController {
|
||||
return JsonMessage.getString(200, "success", list);
|
||||
}
|
||||
|
||||
// @RequestMapping(value = "edit.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @Feature(method = MethodFeature.EDIT)
|
||||
// public String edit(String id) {
|
||||
// setAttribute("type", "add");
|
||||
// if (StrUtil.isNotEmpty(id)) {
|
||||
// OutGivingModel outGivingModel = outGivingServer.getItem(id);
|
||||
// if (outGivingModel != null) {
|
||||
// setAttribute("item", outGivingModel);
|
||||
// setAttribute("type", "edit");
|
||||
// }
|
||||
// }
|
||||
// UserModel userModel = getUser();
|
||||
//
|
||||
// List<NodeModel> nodeModels = nodeService.listAndProject();
|
||||
// setAttribute("nodeModels", nodeModels);
|
||||
//
|
||||
// //
|
||||
// String reqId = nodeService.cacheNodeList(nodeModels);
|
||||
// setAttribute("reqId", reqId);
|
||||
//
|
||||
// JSONArray afterOpt = BaseEnum.toJSONArray(AfterOpt.class);
|
||||
// setAttribute("afterOpt", afterOpt);
|
||||
// return "outgiving/edit";
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @author Hotstrip
|
||||
* get reqId for edit feature
|
||||
* 获取编辑时需要的 reqId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "get-reqId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
|
@ -46,39 +46,6 @@ public class OutGivingProjectEditController extends BaseServerController {
|
||||
@Resource
|
||||
private OutGivingServer outGivingServer;
|
||||
|
||||
// @RequestMapping(value = "editProject", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @Feature(method = MethodFeature.EDIT)
|
||||
// public String editProject(String id) {
|
||||
// setAttribute("type", "add");
|
||||
// OutGivingModel outGivingModel;
|
||||
// if (StrUtil.isNotEmpty(id)) {
|
||||
// outGivingModel = outGivingServer.getItem(id);
|
||||
// if (outGivingModel != null) {
|
||||
// setAttribute("item", outGivingModel);
|
||||
// setAttribute("type", "edit");
|
||||
// }
|
||||
// }
|
||||
// // 运行模式
|
||||
// JSONArray runModes = (JSONArray) JSONArray.toJSON(RunMode.values());
|
||||
// runModes.remove(RunMode.File.name());
|
||||
// //
|
||||
// setAttribute("runModes", runModes);
|
||||
// //
|
||||
// JSONArray afterOpt = BaseEnum.toJSONArray(AfterOpt.class);
|
||||
// setAttribute("afterOpt", afterOpt);
|
||||
// // 权限
|
||||
// List<NodeModel> nodeModels = nodeService.list();
|
||||
// setAttribute("nodeModels", nodeModels);
|
||||
// //
|
||||
// String reqId = nodeService.cacheNodeList(nodeModels);
|
||||
// setAttribute("reqId", reqId);
|
||||
//
|
||||
// // 白名单
|
||||
// List<String> jsonArray = serverWhitelistServer.getOutGiving();
|
||||
// setAttribute("whitelistDirectory", jsonArray);
|
||||
// return "outgiving/editProject";
|
||||
// }
|
||||
|
||||
/**
|
||||
* 保存节点分发项目
|
||||
*
|
||||
@ -410,7 +377,7 @@ public class OutGivingProjectEditController extends BaseServerController {
|
||||
// 删除
|
||||
List<OutGivingNodeProject> deleteNodeProject = outGivingModel.getDelete(outGivingNodeProjects);
|
||||
if (deleteNodeProject != null) {
|
||||
JsonMessage jsonMessage;
|
||||
JsonMessage<String> jsonMessage;
|
||||
// 删除实际的项目
|
||||
for (OutGivingNodeProject outGivingNodeProject1 : deleteNodeProject) {
|
||||
NodeModel nodeModel = outGivingNodeProject1.getNodeData(true);
|
||||
|
@ -37,31 +37,6 @@ import java.util.Map;
|
||||
@Feature(cls = ClassFeature.SYSTEM)
|
||||
public class CacheManageController extends BaseServerController {
|
||||
|
||||
// @RequestMapping(value = "cache.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @Feature(method = MethodFeature.CACHE)
|
||||
// public String cache() {
|
||||
// if (tryGetNode() == null) {
|
||||
// //
|
||||
// File file = ConfigBean.getInstance().getTempPath();
|
||||
// String fileSize = FileUtil.readableFileSize(FileUtil.size(file));
|
||||
// setAttribute("cacheFileSize", fileSize);
|
||||
//
|
||||
// int size = LoginControl.LFU_CACHE.size();
|
||||
// setAttribute("ipSize", size);
|
||||
// int oneLineCount = ServiceFileTailWatcher.getOneLineCount();
|
||||
// setAttribute("readFileOnLineCount", oneLineCount);
|
||||
//
|
||||
// File buildDataDir = BuildUtil.getBuildDataDir();
|
||||
// if (buildDataDir.exists()) {
|
||||
// fileSize = FileUtil.readableFileSize(FileUtil.size(buildDataDir));
|
||||
// setAttribute("cacheBuildFileSize", fileSize);
|
||||
// } else {
|
||||
// setAttribute("cacheBuildFileSize", 0);
|
||||
// }
|
||||
// }
|
||||
// return "system/cache";
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @author Hotstrip
|
||||
|
@ -39,11 +39,6 @@ import java.util.concurrent.TimeUnit;
|
||||
@Feature(cls = ClassFeature.SYSTEM)
|
||||
public class LogManageController extends BaseServerController {
|
||||
|
||||
// @RequestMapping(value = "log.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @Feature(method = MethodFeature.LOG)
|
||||
// public String log() {
|
||||
// return "system/log";
|
||||
// }
|
||||
|
||||
@RequestMapping(value = "log_data.json", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
|
@ -48,21 +48,6 @@ public class SystemConfigController extends BaseServerController {
|
||||
this.systemIpConfigService = systemIpConfigService;
|
||||
}
|
||||
|
||||
|
||||
// @RequestMapping(value = "config.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @SystemPermission
|
||||
// public String config(String nodeId) throws IOException {
|
||||
// String content;
|
||||
// if (StrUtil.isNotEmpty(nodeId)) {
|
||||
// JSONObject jsonObject = NodeForward.requestData(getNode(), NodeUrl.SystemGetConfig, getRequest(), JSONObject.class);
|
||||
// content = jsonObject.getString("content");
|
||||
// } else {
|
||||
// content = IoUtil.read(ExtConfigBean.getResource().getInputStream(), CharsetUtil.CHARSET_UTF_8);
|
||||
// }
|
||||
// setAttribute("content", content);
|
||||
// return "system/config";
|
||||
// }
|
||||
|
||||
/**
|
||||
* @param nodeId
|
||||
* @return
|
||||
|
@ -35,22 +35,6 @@ public class SystemMailConfigController extends BaseServerController {
|
||||
@Resource
|
||||
private SystemMailConfigService systemMailConfigService;
|
||||
|
||||
// /**
|
||||
// * 展示监控页面
|
||||
// *
|
||||
// * @return page
|
||||
// */
|
||||
// @RequestMapping(value = "mailConfig.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @SystemPermission
|
||||
// public String mailConfig() {
|
||||
// UserModel userModel = getUser();
|
||||
// if (userModel.isSystemUser()) {
|
||||
// MailAccountModel item = systemMailConfigService.getConfig();
|
||||
// setAttribute("item", item);
|
||||
// }
|
||||
// return "monitor/mailConfig";
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @author Hotstrip
|
||||
|
@ -34,12 +34,6 @@ import java.util.Objects;
|
||||
@RequestMapping(value = "system")
|
||||
public class SystemUpdateController extends BaseServerController {
|
||||
|
||||
// @RequestMapping(value = "update.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @SystemPermission
|
||||
// public String update() {
|
||||
// return "system/update";
|
||||
// }
|
||||
|
||||
@RequestMapping(value = "info", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
@SystemPermission
|
||||
|
@ -42,16 +42,12 @@ public class UserBasicInfoController extends BaseServerController {
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
// @RequestMapping(value = "userInfo.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// public String userInfo() {
|
||||
// return "user/userInfo";
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @author Hotstrip
|
||||
* get user basic info
|
||||
* 获取管理员基本信息接口
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "user-basic-info", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
|
@ -36,29 +36,6 @@ public class UserEditController extends BaseServerController {
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@Resource
|
||||
private RoleService roleService;
|
||||
|
||||
// @RequestMapping(value = "edit", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @Feature(method = MethodFeature.EDIT)
|
||||
// public String edit(String id) {
|
||||
// UserModel item = userService.getItem(id);
|
||||
// if (item != null) {
|
||||
// item.setPassword(null);
|
||||
// setAttribute("userItem", item);
|
||||
// }
|
||||
// List<RoleModel> list = roleService.list();
|
||||
// JSONArray roles = new JSONArray();
|
||||
// list.forEach(userModel -> {
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("title", userModel.getName());
|
||||
// jsonObject.put("value", userModel.getId());
|
||||
// roles.add(jsonObject);
|
||||
// });
|
||||
// setAttribute("roles", roles);
|
||||
// return "user/edit";
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*
|
||||
|
@ -34,22 +34,6 @@ public class UserListController extends BaseServerController {
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@Resource
|
||||
private RoleService roleService;
|
||||
|
||||
// /**
|
||||
// * 展示用户列表
|
||||
// *
|
||||
// * @return page
|
||||
// */
|
||||
// @RequestMapping(value = "list", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
|
||||
// @Feature(method = MethodFeature.LIST)
|
||||
// public String list() {
|
||||
// List<RoleModel> roleModels = roleService.list();
|
||||
// setAttribute("roleEmpty", roleModels == null || roleModels.isEmpty());
|
||||
// return "user/list";
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有用户
|
||||
|
@ -22,6 +22,7 @@
|
||||
{
|
||||
"title": "节点分发",
|
||||
"icon_v3": "apartment",
|
||||
"dynamic": "showOutGiving",
|
||||
"childs": [
|
||||
{
|
||||
"id": "outgiving",
|
||||
|
Loading…
Reference in New Issue
Block a user