提交代码实现v1.0

This commit is contained in:
wh
2026-04-27 10:27:57 +08:00
parent 849e78658d
commit 5662c1fda9
67 changed files with 2343 additions and 5 deletions

View File

@@ -0,0 +1,38 @@
package com.labelsys.backend.util;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public final class ObjectStoragePathBuilder {
private static final DateTimeFormatter YEAR_MONTH = DateTimeFormatter.ofPattern("yyyyMM");
private ObjectStoragePathBuilder() {
}
public static String sourceObjectKey(Long companyId, String resourceType, Long resourceId, String extension) {
String category = resourceType.toLowerCase();
return "source/%d/%s/%s/%d/original.%s".formatted(
companyId,
category,
YEAR_MONTH.format(LocalDateTime.now()),
resourceId,
extension.toLowerCase());
}
public static String resultQaObjectKey(Long companyId, Long taskId, Long resultId) {
return "result/%d/%s/%d/%d/qa.json".formatted(
companyId,
YEAR_MONTH.format(LocalDateTime.now()),
taskId,
resultId);
}
public static String resultDiffObjectKey(Long companyId, Long taskId, Long resultId) {
return "result/%d/%s/%d/%d/diff.json".formatted(
companyId,
YEAR_MONTH.format(LocalDateTime.now()),
taskId,
resultId);
}
}