|
- package com.educoder.bridge.controller;
-
- import io.swagger.annotations.Api;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.servlet.ModelAndView;
-
- /**
- * @author guange
- *
- * @date 2017/08/02
- */
-
- @Api(value = "提供webssh连接", hidden = true)
- @RestController
- public class MainController extends BaseController {
- private final static Logger logger = LoggerFactory.getLogger(MainController.class);
-
- @RequestMapping(value={"/", "ssh"}, method= RequestMethod.GET)
- public ModelAndView index(@RequestParam("host")String host,
- @RequestParam("port")int port,
- @RequestParam("username")String username,
- @RequestParam("password")String password,
- @RequestParam("rows")int rows) {
- logger.debug("/ssh: 接收到连接请求, host: {}, port: {}", host, port);
- ModelAndView mv = new ModelAndView();
- mv.setViewName("index");
- mv.addObject("host", host);
- mv.addObject("port", port);
- mv.addObject("username", username);
- mv.addObject("password", password);
- mv.addObject("rows", rows);
- mv.addObject("digest", System.currentTimeMillis());
- return mv;
- }
-
- }
|