You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
62 lines
1.9 KiB
package com.insigma.controller;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.insigma.entry.Vo;
|
|
import com.insigma.service.Computer;
|
|
import com.insigma.service.Database;
|
|
import com.insigma.service.Middleware;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
/**
|
|
* @author Vivim
|
|
*/
|
|
@Slf4j
|
|
@RestController
|
|
@RequestMapping("/swing")
|
|
public class TestController {
|
|
|
|
@Qualifier("windowsTomcatMysql")
|
|
@Autowired
|
|
private Computer computer;
|
|
@Qualifier("windowsTomcatMysql")
|
|
@Autowired
|
|
private Database database;
|
|
@Qualifier("windowsTomcatMysql")
|
|
@Autowired
|
|
private Middleware middleware;
|
|
|
|
@PostMapping("/runShell")
|
|
public JSONObject runShell(@RequestBody Vo vo){
|
|
log.info("查询对象参数为:{}", vo);
|
|
boolean b = computer.runShell(vo.getShell(), false);
|
|
log.info("执行结果:{}", b);
|
|
return new JSONObject();
|
|
}
|
|
|
|
@PostMapping("/runBak")
|
|
public JSONObject runBak(@RequestBody Vo vo){
|
|
log.info("查询对象参数为:{}", vo);
|
|
computer.runShell(vo.getShell(), false);
|
|
return new JSONObject();
|
|
}
|
|
|
|
@PostMapping("/runRestore")
|
|
public JSONObject runRestore(@RequestBody Vo vo){
|
|
log.info("查询对象参数为:{}", vo);
|
|
computer.runShell(vo.getShell(), false);
|
|
return new JSONObject();
|
|
}
|
|
|
|
@PostMapping("/openServer")
|
|
public JSONObject openServer(@RequestBody Vo vo){
|
|
log.info("查询对象参数为:{}", vo);
|
|
computer.openServer();
|
|
return new JSONObject();
|
|
}
|
|
}
|
|
|