You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainController.java 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.educoder.bridge.controller;
  2. import io.swagger.annotations.Api;
  3. import org.slf4j.Logger;
  4. import org.slf4j.LoggerFactory;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import org.springframework.web.bind.annotation.RequestParam;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import org.springframework.web.servlet.ModelAndView;
  10. /**
  11. * @author guange
  12. *
  13. * @date 2017/08/02
  14. */
  15. @Api(value = "提供webssh连接", hidden = true)
  16. @RestController
  17. public class MainController extends BaseController {
  18. private final static Logger logger = LoggerFactory.getLogger(MainController.class);
  19. @RequestMapping(value={"/", "ssh"}, method= RequestMethod.GET)
  20. public ModelAndView index(@RequestParam("host")String host,
  21. @RequestParam("port")int port,
  22. @RequestParam("username")String username,
  23. @RequestParam("password")String password,
  24. @RequestParam("rows")int rows) {
  25. logger.debug("/ssh: 接收到连接请求, host: {}, port: {}", host, port);
  26. ModelAndView mv = new ModelAndView();
  27. mv.setViewName("index");
  28. mv.addObject("host", host);
  29. mv.addObject("port", port);
  30. mv.addObject("username", username);
  31. mv.addObject("password", password);
  32. mv.addObject("rows", rows);
  33. mv.addObject("digest", System.currentTimeMillis());
  34. return mv;
  35. }
  36. }

No Description

Contributors (1)