JobController.java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. package com.java110.job.controller;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.java110.core.base.controller.BaseController;
  4. import com.java110.job.Api.HcFtpToFileSystemConfigAction;
  5. import org.slf4j.Logger;
  6. import org.slf4j.LoggerFactory;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.stereotype.Controller;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.ResponseBody;
  11. import org.springframework.web.servlet.ModelAndView;
  12. import javax.servlet.http.HttpServletRequest;
  13. import java.util.Date;
  14. /**
  15. * 首页控制类
  16. * 20190813
  17. * 师延俊
  18. */
  19. @Controller
  20. @RequestMapping(path = "/HcFtpToFileSystemConfigList")
  21. public class JobController extends BaseController {
  22. private static final Logger logger = LoggerFactory.getLogger(JobController.class);
  23. @Autowired
  24. HcFtpToFileSystemConfigAction ftpToFileSystemConfigAction;
  25. /**
  26. * 首页处理方法
  27. *
  28. * @return 页面名称
  29. */
  30. @RequestMapping(path = "/")
  31. public ModelAndView flow() {
  32. logger.debug("请求流程 {},{}", new StringBuffer("首页我进来了"), new Date());
  33. return new ModelAndView("HcFtpToFileSystemConfigList");
  34. }
  35. /**
  36. * 页面载入时加载
  37. * @return
  38. */
  39. @RequestMapping(path = "/queryFtpItems")
  40. @ResponseBody
  41. public String queryFtpItems(HttpServletRequest request) {
  42. logger.debug("请求流程 {},{}", new StringBuffer("queryFtpItems 我看到请求了"), new Date());
  43. JSONObject JSON = ftpToFileSystemConfigAction.queryFtpItems(request);
  44. return JSON.toJSONString();
  45. }
  46. /**
  47. * 点击保存按钮时
  48. * @return
  49. */
  50. @RequestMapping(path = "/addFtpItem")
  51. @ResponseBody
  52. public String addFtpItem(HttpServletRequest request) {
  53. logger.debug("请求流程 {},{}", new StringBuffer("addFtpItem 我看到请求了"), new Date());
  54. JSONObject JSON = ftpToFileSystemConfigAction.addFtpItem(request);
  55. return JSON.toJSONString();
  56. }
  57. /**
  58. * 获取任务属性
  59. * @return
  60. */
  61. @RequestMapping(path = "/questTaskTample")
  62. @ResponseBody
  63. public String questTaskTample(HttpServletRequest request) {
  64. logger.debug("请求流程 {},{}", new StringBuffer("questTaskTample 我看到请求了"), new Date());
  65. JSONObject JSON = ftpToFileSystemConfigAction.questTaskTample(request);
  66. return JSON.toJSONString();
  67. }
  68. /**
  69. * 根据TaskId 获取任务属性
  70. * @return
  71. */
  72. @RequestMapping(path = "/queryTaskAttrs")
  73. @ResponseBody
  74. public String queryTaskAttrs(HttpServletRequest request) {
  75. logger.debug("请求流程 {},{}", new StringBuffer("queryTaskAttrs 我看到请求了"), new Date());
  76. JSONObject JSON = ftpToFileSystemConfigAction.queryTaskAttrs(request);
  77. return JSON.toJSONString();
  78. }
  79. /**
  80. * 根据TaskId 启动任务
  81. * @return
  82. */
  83. @RequestMapping(path = "/startJob")
  84. @ResponseBody
  85. public String startJob(HttpServletRequest request) {
  86. logger.debug("请求流程 {},{}", new StringBuffer("startJob 我看到请求了"), new Date());
  87. JSONObject JSON = ftpToFileSystemConfigAction.startJob(request);
  88. return JSON.toJSONString();
  89. }
  90. /**
  91. * 根据TaskId 停止任务
  92. * @return
  93. */
  94. @RequestMapping(path = "/stopJob")
  95. @ResponseBody
  96. public String stopJob(HttpServletRequest request) {
  97. logger.debug("请求流程 {},{}", new StringBuffer("stopJob 我看到请求了"), new Date());
  98. JSONObject JSON = ftpToFileSystemConfigAction.stopJob(request);
  99. return JSON.toJSONString();
  100. }
  101. /**
  102. * 根据TaskId 删除任务
  103. * @return
  104. */
  105. @RequestMapping(path = "/deleteFtpItem")
  106. @ResponseBody
  107. public String deleteFtpItem(HttpServletRequest request) {
  108. logger.debug("请求流程 {},{}", new StringBuffer("deleteFtpItem 我看到请求了"), new Date());
  109. JSONObject JSON = ftpToFileSystemConfigAction.deleteFtpItem(request);
  110. return JSON.toJSONString();
  111. }
  112. /**
  113. * 根据TaskId 删除任务
  114. * @return
  115. */
  116. @RequestMapping(path = "/editFtpItem")
  117. @ResponseBody
  118. public String editFtpItem(HttpServletRequest request) {
  119. logger.debug("请求流程 {},{}", new StringBuffer("editFtpItem 我看到请求了"), new Date());
  120. JSONObject JSON = ftpToFileSystemConfigAction.editFtpItem(request);
  121. return JSON.toJSONString();
  122. }
  123. }