FileUpdateInfoService.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package com.ruoyi.file.service;
  2. import com.ruoyi.file.domain.FileUpdateInfo;
  3. import com.ruoyi.file.domain.FileWithId;
  4. import com.usky.common.core.bean.CommonPage;
  5. import org.springframework.web.bind.annotation.RequestParam;
  6. public interface FileUpdateInfoService {
  7. /**
  8. * 获取文件的运行状态
  9. * @param fileName 文件名
  10. * @return 状态码(1: 运行中,2: 已停止,0: 未知)
  11. */
  12. int getFileStatus(String fileName);
  13. //添加服务信息
  14. void addFileToDatabase(FileUpdateInfo fileUpdateInfo) throws Exception;
  15. //检查服务更新
  16. boolean checkFileUpdate(Long id) throws Exception;
  17. //执行服务更新
  18. void performFileUpdate(Long id) throws Exception;
  19. // 获取所有服务信息(分页)
  20. CommonPage<FileUpdateInfo> getAllFiles(
  21. @RequestParam(required = false, defaultValue = "1") int current,
  22. @RequestParam(required = false, defaultValue = "10") int size) throws Exception;
  23. // 根据文件名模糊查询服务信息(分页)
  24. CommonPage<FileUpdateInfo> getFilesByFileNameContaining(
  25. @RequestParam(required = false) String fileName,
  26. @RequestParam(required = false, defaultValue = "1") int current,
  27. @RequestParam(required = false, defaultValue = "10") int size) throws Exception;
  28. //根据id查询服务信息
  29. FileUpdateInfo getFileById(Long id) throws Exception;
  30. //删除服务信息
  31. void deleteFileById(Long id) throws Exception;
  32. //控制服务运行状态
  33. void controlApplication(String fileName, String action) throws Exception;
  34. // 扫描 JAR 文件所在的目录并获取文件列表
  35. CommonPage<FileWithId> scanFilesInServiceDir(
  36. @RequestParam(required = false, defaultValue = "1") int current,
  37. @RequestParam(required = false, defaultValue = "10") int size) throws Exception;
  38. }