смена ключей багов на численнные.
This commit is contained in:
2025-12-16 02:32:20 +03:00
parent f104335bfe
commit 6da9698285
19 changed files with 81 additions and 47 deletions

View File

@@ -55,18 +55,9 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
return super.getDb();
}
@Override
protected void beforePublishAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
BugReport bugReport = (BugReport) object;
if (bugReport.packed_archive != null) {
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", bugReport.id);
Utils_.bytesToFile(bugReport.packed_archive, bugArchive);
}
}
}
@Override
protected void afterPublishAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
//---
BugReport bugReport = (BugReport) object;
if (bugReport.settings != null) {
for (BugReportSetting setting : bugReport.settings) {
@@ -77,6 +68,14 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
if (bugReport.recipients != null) {
db.saveBugreportRecipients(bugReport);
}
//-->
Utils_.CheckAndCleanDirectory(bugReport.getHome());
//-->
if (bugReport.packed_archive != null) {
File bugArchive = bugReport.getArchiveFile();
Utils_.bytesToFile(bugReport.packed_archive, bugArchive);
bugReport.packed_archive = null;
}
}
}
@Override
@@ -94,7 +93,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
protected void afterDeleteAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
BugReport bugReport = (BugReport) object;
if (!bugReport.project_version.isEmpty()) Utils_.forceDeleteWithCheck(bugReport.getArchiveFile());
Utils_.forceDeleteWithCheck(bugReport.getHome());
} else if (object instanceof UserAccount) {
UserAccount account = (UserAccount) object;
Utils_.forceDeleteWithCheck(account.getServerKeyFile());
@@ -170,7 +169,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
void ReceiveAllArchives() throws Exception {
ZipFolderPass zip = new ZipFolderPass();
File archives = new File(Utils_.getDateName("Bugs"));
if (zip.Do("Bugs", archives.getAbsolutePath())) {
if (zip.Do("BugReports", archives.getAbsolutePath())) {
response.object = Utils_.fileToBytes(archives);
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
}
@@ -179,7 +178,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
response.arg = credentials_db.userAccounts.getPackedActiveRecipients();
}
void ReceiveBugReport() throws Exception {
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "BugReports", request.arg, request.arg + ".zip");
response.object = Utils_.fileToBytes(bugArchive);
}
void UpdateBugReport() throws Exception {