This commit is contained in:
chenxudong 2025-03-17 11:57:15 +08:00
parent d2b391a2ea
commit 6697cbdfcb
1 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ public class BackupHandler {
Map<String, Object> map = new HashMap<>();
map.put("file", new File(filePath));
map.put("id", id);
String url = StrFormatter.format("http://{}:{}/data/file/upload", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort());
String url = StrFormatter.format("http://{}:{}/data/file/backup/upload", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort());
String res = HttpUtil.post(url, map);
ElectromagneticResult<?> resObj = JSONUtil.toBean(res, ElectromagneticResult.class);
String data = JSONUtil.toJsonStr(resObj.getData());
@ -33,7 +33,7 @@ public class BackupHandler {
public BackupFileResLog backupSql(String filePath) {
Map<String, Object> map = new HashMap<>();
map.put("file", new File(filePath));
String url = StrFormatter.format("http://{}:{}/data/file/backupSql", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort());
String url = StrFormatter.format("http://{}:{}/data/file/backup/backupSql", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort());
String res = HttpUtil.post(url, map);
ElectromagneticResult<?> resObj = JSONUtil.toBean(res, ElectromagneticResult.class);
String data = JSONUtil.toJsonStr(resObj.getData());
@ -43,7 +43,7 @@ public class BackupHandler {
public BackupFileResLog deleteFile(String id) {
Map<String, Object> map = new HashMap<>();
map.put("id", id);
String url = StrFormatter.format("http://{}:{}/data/file/remove", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort());
String url = StrFormatter.format("http://{}:{}/data/file/backup/remove", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort());
String res = HttpUtil.get(url, map);
ElectromagneticResult<?> resObj = JSONUtil.toBean(res, ElectromagneticResult.class);
String data = JSONUtil.toJsonStr(resObj.getData());
@ -51,7 +51,7 @@ public class BackupHandler {
}
public byte[] downloadFile(String id) {
String url = StrFormatter.format("http://{}:{}/data/file/download?id={}", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort(), id);
String url = StrFormatter.format("http://{}:{}/data/file/backup/download?id={}", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort(), id);
return HttpUtil.downloadBytes(url);
}
}