step上传
This commit is contained in:
@@ -95,6 +95,9 @@ public final class Contracts {
|
||||
String coverUrl,
|
||||
String urdfMainUrl,
|
||||
String urdfBaseUrl,
|
||||
String stepMainUrl,
|
||||
String stepFileName,
|
||||
Long stepSizeBytes,
|
||||
String modelGlbUrl,
|
||||
String modelPartsBaseUrl,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) List<ResourceFileView> modelPartsFiles,
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.linkerbot.vibemake.bean;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import java.io.IOException;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public final class StepContracts {
|
||||
private StepContracts() {}
|
||||
|
||||
// STEP 参数由专用服务校验,统一返回 STEP_INVALID_FILE。
|
||||
public record StepFile(String relativePath,
|
||||
@JsonDeserialize(using = StepSizeDeserializer.class) Long sizeBytes) {}
|
||||
|
||||
public record StepUploadInput(List<StepFile> files) {}
|
||||
|
||||
public record StepConfirmInput(String batchCode, List<StepFile> files) {}
|
||||
|
||||
public record StepFileSignature(
|
||||
String relativePath, String objectKey, Map<String, String> formFields) {}
|
||||
|
||||
public record StepUploadSignature(
|
||||
String batchCode, String mainRelativePath, String uploadUrl,
|
||||
Instant expiresAt, List<StepFileSignature> files) {}
|
||||
|
||||
/** 拒绝小数和数字字符串,避免 Jackson 默认截断或转换文件大小。 */
|
||||
public static final class StepSizeDeserializer extends JsonDeserializer<Long> {
|
||||
@Override
|
||||
public Long deserialize(JsonParser parser, DeserializationContext context) throws IOException {
|
||||
if (!parser.hasToken(JsonToken.VALUE_NUMBER_INT)) {
|
||||
return (Long) context.handleUnexpectedToken(Long.class, parser);
|
||||
}
|
||||
return parser.getLongValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,9 @@ public class Project extends BaseEntity {
|
||||
private String urdfMainObjectKey = "";
|
||||
private String urdfFiles = "[]";
|
||||
private String urdfPrefix = "";
|
||||
private String stepObjectKey = "";
|
||||
private String stepFileName = "";
|
||||
private Long stepSizeBytes = 0L;
|
||||
private String modelGlbObjectKey = "";
|
||||
private Long modelGlbSizeBytes = 0L;
|
||||
private String modelPartsPrefix = "";
|
||||
|
||||
Reference in New Issue
Block a user