|
@@ -28,6 +28,7 @@ public class FileUpdateInfoController {
|
|
|
@Autowired
|
|
|
private FileUpdateInfoService fileUpdateInfoService;
|
|
|
|
|
|
+ //增加服务信息
|
|
|
@PostMapping("/add")
|
|
|
public ApiResult<String> addFileToDatabase(@RequestBody FileUpdateInfo fileUpdateInfo) {
|
|
|
try {
|
|
@@ -38,6 +39,7 @@ public class FileUpdateInfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //检查服务版本
|
|
|
@PostMapping("/checkById")
|
|
|
public ApiResult<String> checkFileUpdate(@RequestParam Long id) {
|
|
|
try {
|
|
@@ -48,6 +50,7 @@ public class FileUpdateInfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //下载更新服务
|
|
|
@PostMapping("/reloadById")
|
|
|
public ApiResult<String> performFileUpdate(@RequestParam Long id) {
|
|
|
try {
|
|
@@ -58,6 +61,7 @@ public class FileUpdateInfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //查询服务信息
|
|
|
@GetMapping("/query")
|
|
|
public ApiResult<CommonPage<FileUpdateInfo>> queryFiles(
|
|
|
@RequestParam(required = false) String fileName,
|
|
@@ -83,8 +87,8 @@ public class FileUpdateInfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //删除服务信息
|
|
|
@DeleteMapping("/deleteById")
|
|
|
- @ApiOperation(value = "删除文件信息", notes = "根据文件 ID 删除指定文件信息")
|
|
|
public ApiResult<String> deleteFileById(@RequestParam Long id) {
|
|
|
try {
|
|
|
fileUpdateInfoService.deleteFileById(id);
|
|
@@ -94,8 +98,8 @@ public class FileUpdateInfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //控制服务运行状态(启动start、停止stop、重启restart)
|
|
|
@PostMapping("/controlById")
|
|
|
- @ApiOperation(value = "控制服务", notes = "根据文件 ID 和操作类型控制服务(启动、停止、重启)")
|
|
|
public ApiResult<String> controlServiceById(@RequestParam Long id, @RequestParam String action) {
|
|
|
try {
|
|
|
FileUpdateInfo fileUpdateInfo = fileUpdateInfoService.getFileById(id);
|