统一角色动作正式数据结构
为项目资源、账号素材和精选快照新增正式图片序列帧与毫秒时长字段。 统一 Rust DTO、SpacetimeDB 表、迁移默认值、typed client mapper 与生成绑定。 数组顺序作为唯一帧序,不持久化 frameIndex、frameCount、fps 或通用媒体时长。
This commit is contained in:
@@ -243,6 +243,8 @@ pub struct AdminEditorAssetPayload {
|
||||
pub task_generator: String,
|
||||
pub task_cost_mud_points: u64,
|
||||
pub children: Vec<AdminEditorAssetPayload>,
|
||||
pub image_sequence_frames: Option<Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
@@ -300,6 +302,8 @@ pub struct AdminEditorShowcaseAssetPayload {
|
||||
pub rejected_at: Option<String>,
|
||||
pub updated_at: String,
|
||||
pub showcase_category: Option<String>,
|
||||
pub image_sequence_frames: Option<Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
@@ -1116,6 +1120,11 @@ mod tests {
|
||||
rejected_at: None,
|
||||
updated_at: "2026-07-04T10:00:00.000Z".to_string(),
|
||||
showcase_category: None,
|
||||
image_sequence_frames: Some(json!([
|
||||
{ "imageSrc": "/generated/action/frame-01.png", "width": 192, "height": 256 },
|
||||
{ "imageSrc": "/generated/action/frame-02.png", "width": 192, "height": 256 }
|
||||
])),
|
||||
image_sequence_duration_ms: Some(5_000),
|
||||
};
|
||||
|
||||
let value = serde_json::to_value(payload).expect("payload should serialize");
|
||||
@@ -1126,8 +1135,15 @@ mod tests {
|
||||
value["thumbnailSrc"],
|
||||
json!("/generated-character-drafts/editor/spec-thumb.png")
|
||||
);
|
||||
assert_eq!(
|
||||
value["imageSequenceFrames"].as_array().map(Vec::len),
|
||||
Some(2)
|
||||
);
|
||||
assert_eq!(value["imageSequenceDurationMs"], json!(5_000));
|
||||
assert!(value.get("author_display_name").is_none());
|
||||
assert!(value.get("author_public_user_code").is_none());
|
||||
assert!(value.get("thumbnail_src").is_none());
|
||||
assert!(value.get("image_sequence_frames").is_none());
|
||||
assert!(value.get("image_sequence_duration_ms").is_none());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +341,6 @@ pub struct EditorCharacterAnimationGenerateRequest {
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct EditorCharacterAnimationFramePayload {
|
||||
pub frame_index: u32,
|
||||
pub image_src: String,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
@@ -365,6 +364,10 @@ pub struct EditorCharacterAnimationGenerateResponse {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub project: Option<Value>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub resource: Option<Value>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub asset: Option<Value>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub queue_state: Option<ExternalGenerationJobStatusRecord>,
|
||||
}
|
||||
|
||||
@@ -1142,7 +1145,6 @@ mod tests {
|
||||
prompt: "生成游戏角色动画".to_string(),
|
||||
preview_video_path: "/generated-character-drafts/editor/layer/preview.mp4".to_string(),
|
||||
frames: vec![EditorCharacterAnimationFramePayload {
|
||||
frame_index: 1,
|
||||
image_src: "/generated-animations/editor/layer/frame01.png".to_string(),
|
||||
width: 768,
|
||||
height: 1024,
|
||||
@@ -1154,10 +1156,27 @@ mod tests {
|
||||
fps: 8,
|
||||
price_mud_points: 40,
|
||||
project: None,
|
||||
resource: Some(json!({
|
||||
"resourceId": "editor-resource-action-1",
|
||||
"assetKind": "character-animation",
|
||||
})),
|
||||
asset: Some(json!({
|
||||
"assetId": "editor-asset-action-1",
|
||||
"assetKind": "character-animation",
|
||||
"frameCount": 2,
|
||||
})),
|
||||
queue_state: None,
|
||||
})
|
||||
.expect("response should serialize");
|
||||
|
||||
assert_eq!(payload["asset"]["assetId"], json!("editor-asset-action-1"));
|
||||
assert_eq!(
|
||||
payload["resource"]["resourceId"],
|
||||
json!("editor-resource-action-1")
|
||||
);
|
||||
assert_eq!(payload["asset"]["assetKind"], json!("character-animation"));
|
||||
assert_eq!(payload["asset"]["frameCount"], json!(2));
|
||||
|
||||
assert_eq!(
|
||||
payload["previewVideoPath"],
|
||||
json!("/generated-character-drafts/editor/layer/preview.mp4")
|
||||
@@ -1166,6 +1185,7 @@ mod tests {
|
||||
payload["frames"][0]["imageSrc"],
|
||||
json!("/generated-animations/editor/layer/frame01.png")
|
||||
);
|
||||
assert!(payload["frames"][0].get("frameIndex").is_none());
|
||||
assert_eq!(payload["fps"], json!(8));
|
||||
}
|
||||
|
||||
@@ -1439,6 +1459,7 @@ mod tests {
|
||||
);
|
||||
assert_eq!(response_payload["assetObjectId"], json!("assetobj_audio_1"));
|
||||
assert_eq!(response_payload["audioKind"], json!("sound-effect"));
|
||||
assert!(response_payload.get("durationSeconds").is_none());
|
||||
assert_eq!(
|
||||
response_payload["asset"]["assetKind"],
|
||||
json!("sound-effect")
|
||||
|
||||
@@ -73,6 +73,8 @@ pub struct EditorProjectResourceRecord {
|
||||
pub public_showcase_enabled: bool,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -114,6 +116,8 @@ pub struct EditorAssetRecord {
|
||||
pub showcase_like_count: Option<u64>,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -141,6 +145,8 @@ pub struct AdminEditorAssetRecord {
|
||||
pub generation_cost_mud_points: u64,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -186,6 +192,8 @@ pub struct EditorShowcaseAssetRecord {
|
||||
pub rejected_at: Option<String>,
|
||||
pub updated_at: String,
|
||||
pub showcase_category: Option<String>,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -293,6 +301,8 @@ pub struct EditorProjectResourceCreateRecordInput {
|
||||
pub asset_kind: Option<String>,
|
||||
pub generation_inputs_json: Option<String>,
|
||||
pub updated_at_micros: i64,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -369,6 +379,8 @@ pub struct EditorAssetCreateRecordInput {
|
||||
pub generation_cost_mud_points: u64,
|
||||
pub group_task_id: Option<String>,
|
||||
pub group_task_expected_asset_count: Option<u32>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -608,6 +620,8 @@ impl From<EditorProjectResourceCreateRecordInput>
|
||||
asset_kind: input.asset_kind,
|
||||
generation_inputs_json: input.generation_inputs_json,
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
image_sequence_frames_json: input.image_sequence_frames_json,
|
||||
image_sequence_duration_ms: input.image_sequence_duration_ms,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -717,6 +731,8 @@ impl From<EditorAssetCreateRecordInput> for crate::module_bindings::EditorAssetC
|
||||
generation_cost_mud_points: input.generation_cost_mud_points,
|
||||
group_task_id: input.group_task_id,
|
||||
group_task_expected_asset_count: input.group_task_expected_asset_count,
|
||||
image_sequence_frames_json: input.image_sequence_frames_json,
|
||||
image_sequence_duration_ms: input.image_sequence_duration_ms,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1244,10 +1260,14 @@ fn map_editor_project_snapshot(
|
||||
fn map_editor_project_resource_snapshot(
|
||||
snapshot: EditorProjectResourceSnapshot,
|
||||
) -> Result<EditorProjectResourceRecord, SpacetimeClientError> {
|
||||
let generation_inputs = parse_optional_generation_inputs_json(
|
||||
let generation_inputs = parse_optional_json(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"图片画布资源生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"图片画布资源序列帧 JSON",
|
||||
)?;
|
||||
Ok(EditorProjectResourceRecord {
|
||||
resource_id: snapshot.resource_id,
|
||||
project_id: snapshot.project_id,
|
||||
@@ -1269,6 +1289,8 @@ fn map_editor_project_resource_snapshot(
|
||||
public_showcase_enabled: snapshot.public_showcase_enabled,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1306,10 +1328,14 @@ fn map_editor_asset_folder_snapshot(
|
||||
fn map_editor_asset_snapshot(
|
||||
snapshot: EditorAssetSnapshot,
|
||||
) -> Result<EditorAssetRecord, SpacetimeClientError> {
|
||||
let generation_inputs = parse_optional_generation_inputs_json(
|
||||
let generation_inputs = parse_optional_json(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"图片画布素材生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"图片画布素材序列帧 JSON",
|
||||
)?;
|
||||
Ok(EditorAssetRecord {
|
||||
asset_id: snapshot.asset_id,
|
||||
folder_id: snapshot.folder_id,
|
||||
@@ -1337,16 +1363,22 @@ fn map_editor_asset_snapshot(
|
||||
showcase_like_count: snapshot.showcase_like_count,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
fn map_admin_editor_asset_snapshot(
|
||||
snapshot: AdminEditorAssetSnapshot,
|
||||
) -> Result<AdminEditorAssetRecord, SpacetimeClientError> {
|
||||
let generation_inputs = parse_optional_generation_inputs_json(
|
||||
let generation_inputs = parse_optional_json(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"后台图片画布素材生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"后台图片画布素材序列帧 JSON",
|
||||
)?;
|
||||
Ok(AdminEditorAssetRecord {
|
||||
asset_id: snapshot.asset_id,
|
||||
owner_user_id: snapshot.owner_user_id,
|
||||
@@ -1371,16 +1403,22 @@ fn map_admin_editor_asset_snapshot(
|
||||
generation_cost_mud_points: snapshot.generation_cost_mud_points,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
fn map_editor_showcase_asset_snapshot(
|
||||
snapshot: EditorShowcaseAssetSnapshot,
|
||||
) -> Result<EditorShowcaseAssetRecord, SpacetimeClientError> {
|
||||
let generation_inputs = parse_optional_generation_inputs_json(
|
||||
let generation_inputs = parse_optional_json(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"陶泥儿精选素材生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"陶泥儿精选素材序列帧 JSON",
|
||||
)?;
|
||||
Ok(EditorShowcaseAssetRecord {
|
||||
showcase_id: snapshot.showcase_id,
|
||||
asset_id: snapshot.asset_id,
|
||||
@@ -1419,6 +1457,8 @@ fn map_editor_showcase_asset_snapshot(
|
||||
rejected_at: snapshot.rejected_at_micros.map(format_timestamp_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
showcase_category: snapshot.showcase_category,
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1468,7 +1508,7 @@ fn map_editor_generation_pricing_config_snapshot(
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_optional_generation_inputs_json(
|
||||
fn parse_optional_json(
|
||||
raw_json: Option<&str>,
|
||||
label: &str,
|
||||
) -> Result<Option<serde_json::Value>, SpacetimeClientError> {
|
||||
|
||||
@@ -73,6 +73,8 @@ pub struct EditorProjectResourceRecord {
|
||||
pub public_showcase_enabled: bool,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -114,6 +116,8 @@ pub struct EditorAssetRecord {
|
||||
pub showcase_like_count: Option<u64>,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -141,6 +145,8 @@ pub struct AdminEditorAssetRecord {
|
||||
pub generation_cost_mud_points: u64,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -186,6 +192,8 @@ pub struct EditorShowcaseAssetRecord {
|
||||
pub rejected_at: Option<String>,
|
||||
pub updated_at: String,
|
||||
pub showcase_category: Option<String>,
|
||||
pub image_sequence_frames: Option<serde_json::Value>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -293,6 +301,8 @@ pub struct EditorProjectResourceCreateRecordInput {
|
||||
pub asset_kind: Option<String>,
|
||||
pub generation_inputs_json: Option<String>,
|
||||
pub updated_at_micros: i64,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -369,6 +379,8 @@ pub struct EditorAssetCreateRecordInput {
|
||||
pub generation_cost_mud_points: u64,
|
||||
pub group_task_id: Option<String>,
|
||||
pub group_task_expected_asset_count: Option<u32>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -608,6 +620,8 @@ impl From<EditorProjectResourceCreateRecordInput>
|
||||
asset_kind: input.asset_kind,
|
||||
generation_inputs_json: input.generation_inputs_json,
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
image_sequence_frames_json: input.image_sequence_frames_json,
|
||||
image_sequence_duration_ms: input.image_sequence_duration_ms,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -717,6 +731,8 @@ impl From<EditorAssetCreateRecordInput> for crate::module_bindings::EditorAssetC
|
||||
generation_cost_mud_points: input.generation_cost_mud_points,
|
||||
group_task_id: input.group_task_id,
|
||||
group_task_expected_asset_count: input.group_task_expected_asset_count,
|
||||
image_sequence_frames_json: input.image_sequence_frames_json,
|
||||
image_sequence_duration_ms: input.image_sequence_duration_ms,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1248,6 +1264,10 @@ fn map_editor_project_resource_snapshot(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"图片画布资源生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_generation_inputs_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"图片画布资源序列帧 JSON",
|
||||
)?;
|
||||
Ok(EditorProjectResourceRecord {
|
||||
resource_id: snapshot.resource_id,
|
||||
project_id: snapshot.project_id,
|
||||
@@ -1269,6 +1289,8 @@ fn map_editor_project_resource_snapshot(
|
||||
public_showcase_enabled: snapshot.public_showcase_enabled,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1310,6 +1332,10 @@ fn map_editor_asset_snapshot(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"图片画布素材生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_generation_inputs_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"图片画布素材序列帧 JSON",
|
||||
)?;
|
||||
Ok(EditorAssetRecord {
|
||||
asset_id: snapshot.asset_id,
|
||||
folder_id: snapshot.folder_id,
|
||||
@@ -1337,6 +1363,8 @@ fn map_editor_asset_snapshot(
|
||||
showcase_like_count: snapshot.showcase_like_count,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1347,6 +1375,10 @@ fn map_admin_editor_asset_snapshot(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"后台图片画布素材生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_generation_inputs_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"后台图片画布素材序列帧 JSON",
|
||||
)?;
|
||||
Ok(AdminEditorAssetRecord {
|
||||
asset_id: snapshot.asset_id,
|
||||
owner_user_id: snapshot.owner_user_id,
|
||||
@@ -1371,6 +1403,8 @@ fn map_admin_editor_asset_snapshot(
|
||||
generation_cost_mud_points: snapshot.generation_cost_mud_points,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1381,6 +1415,10 @@ fn map_editor_showcase_asset_snapshot(
|
||||
snapshot.generation_inputs_json.as_deref(),
|
||||
"陶泥儿精选素材生成输入 JSON",
|
||||
)?;
|
||||
let image_sequence_frames = parse_optional_generation_inputs_json(
|
||||
snapshot.image_sequence_frames_json.as_deref(),
|
||||
"陶泥儿精选素材序列帧 JSON",
|
||||
)?;
|
||||
Ok(EditorShowcaseAssetRecord {
|
||||
showcase_id: snapshot.showcase_id,
|
||||
asset_id: snapshot.asset_id,
|
||||
@@ -1419,6 +1457,8 @@ fn map_editor_showcase_asset_snapshot(
|
||||
rejected_at: snapshot.rejected_at_micros.map(format_timestamp_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
showcase_category: snapshot.showcase_category,
|
||||
image_sequence_frames,
|
||||
image_sequence_duration_ms: snapshot.image_sequence_duration_ms,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ pub struct AdminEditorAssetSnapshot {
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
pub group_task_id: Option<String>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for AdminEditorAssetSnapshot {
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ pub struct EditorAssetCreateInput {
|
||||
pub generation_cost_mud_points: u64,
|
||||
pub group_task_id: Option<String>,
|
||||
pub group_task_expected_asset_count: Option<u32>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorAssetCreateInput {
|
||||
|
||||
@@ -34,6 +34,8 @@ pub struct EditorAssetSnapshot {
|
||||
pub showcase_display_enabled: Option<bool>,
|
||||
pub showcase_like_count: Option<u64>,
|
||||
pub group_task_id: Option<String>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorAssetSnapshot {
|
||||
|
||||
@@ -31,6 +31,8 @@ pub struct EditorAsset {
|
||||
pub generation_cost_mud_points: u64,
|
||||
pub group_task_id: Option<String>,
|
||||
pub group_task_expected_asset_count: Option<u32>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorAsset {
|
||||
@@ -65,6 +67,8 @@ pub struct EditorAssetCols {
|
||||
pub generation_cost_mud_points: __sdk::__query_builder::Col<EditorAsset, u64>,
|
||||
pub group_task_id: __sdk::__query_builder::Col<EditorAsset, Option<String>>,
|
||||
pub group_task_expected_asset_count: __sdk::__query_builder::Col<EditorAsset, Option<u32>>,
|
||||
pub image_sequence_frames_json: __sdk::__query_builder::Col<EditorAsset, Option<String>>,
|
||||
pub image_sequence_duration_ms: __sdk::__query_builder::Col<EditorAsset, Option<u64>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for EditorAsset {
|
||||
@@ -104,6 +108,14 @@ impl __sdk::__query_builder::HasCols for EditorAsset {
|
||||
table_name,
|
||||
"group_task_expected_asset_count",
|
||||
),
|
||||
image_sequence_frames_json: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"image_sequence_frames_json",
|
||||
),
|
||||
image_sequence_duration_ms: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"image_sequence_duration_ms",
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -25,6 +25,8 @@ pub struct EditorProjectResourceCreateInput {
|
||||
pub asset_kind: Option<String>,
|
||||
pub generation_inputs_json: Option<String>,
|
||||
pub updated_at_micros: i64,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectResourceCreateInput {
|
||||
|
||||
+2
@@ -27,6 +27,8 @@ pub struct EditorProjectResourceSnapshot {
|
||||
pub public_showcase_enabled: bool,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectResourceSnapshot {
|
||||
|
||||
@@ -27,6 +27,8 @@ pub struct EditorProjectResource {
|
||||
pub asset_kind: Option<String>,
|
||||
pub generation_inputs_json: Option<String>,
|
||||
pub public_showcase_enabled: bool,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectResource {
|
||||
@@ -57,6 +59,9 @@ pub struct EditorProjectResourceCols {
|
||||
pub asset_kind: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub generation_inputs_json: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub public_showcase_enabled: __sdk::__query_builder::Col<EditorProjectResource, bool>,
|
||||
pub image_sequence_frames_json:
|
||||
__sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub image_sequence_duration_ms: __sdk::__query_builder::Col<EditorProjectResource, Option<u64>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for EditorProjectResource {
|
||||
@@ -89,6 +94,14 @@ impl __sdk::__query_builder::HasCols for EditorProjectResource {
|
||||
table_name,
|
||||
"public_showcase_enabled",
|
||||
),
|
||||
image_sequence_frames_json: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"image_sequence_frames_json",
|
||||
),
|
||||
image_sequence_duration_ms: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"image_sequence_duration_ms",
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -42,6 +42,8 @@ pub struct EditorShowcaseAssetSnapshot {
|
||||
pub rejected_at_micros: Option<i64>,
|
||||
pub updated_at_micros: i64,
|
||||
pub showcase_category: Option<String>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorShowcaseAssetSnapshot {
|
||||
|
||||
@@ -42,6 +42,8 @@ pub struct EditorShowcaseAsset {
|
||||
pub rejected_at: Option<__sdk::Timestamp>,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
pub showcase_category: Option<String>,
|
||||
pub image_sequence_frames_json: Option<String>,
|
||||
pub image_sequence_duration_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorShowcaseAsset {
|
||||
@@ -88,6 +90,9 @@ pub struct EditorShowcaseAssetCols {
|
||||
pub rejected_at: __sdk::__query_builder::Col<EditorShowcaseAsset, Option<__sdk::Timestamp>>,
|
||||
pub updated_at: __sdk::__query_builder::Col<EditorShowcaseAsset, __sdk::Timestamp>,
|
||||
pub showcase_category: __sdk::__query_builder::Col<EditorShowcaseAsset, Option<String>>,
|
||||
pub image_sequence_frames_json:
|
||||
__sdk::__query_builder::Col<EditorShowcaseAsset, Option<String>>,
|
||||
pub image_sequence_duration_ms: __sdk::__query_builder::Col<EditorShowcaseAsset, Option<u64>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for EditorShowcaseAsset {
|
||||
@@ -144,6 +149,14 @@ impl __sdk::__query_builder::HasCols for EditorShowcaseAsset {
|
||||
rejected_at: __sdk::__query_builder::Col::new(table_name, "rejected_at"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
showcase_category: __sdk::__query_builder::Col::new(table_name, "showcase_category"),
|
||||
image_sequence_frames_json: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"image_sequence_frames_json",
|
||||
),
|
||||
image_sequence_duration_ms: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"image_sequence_duration_ms",
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1366,6 +1366,12 @@ fn normalize_migration_row(table_name: &str, value: &serde_json::Value) -> serde
|
||||
object
|
||||
.entry("showcase_category".to_string())
|
||||
.or_insert(serde_json::Value::Null);
|
||||
// 中文注释:角色动作正式序列字段晚于精选快照表加入,旧记录按无正式序列兼容。
|
||||
for field in ["image_sequence_frames_json", "image_sequence_duration_ms"] {
|
||||
object
|
||||
.entry(field.to_string())
|
||||
.or_insert(serde_json::Value::Null);
|
||||
}
|
||||
}
|
||||
}
|
||||
if table_name == "editor_canvas" {
|
||||
@@ -1552,6 +1558,11 @@ fn normalize_migration_row(table_name: &str, value: &serde_json::Value) -> serde
|
||||
object
|
||||
.entry("public_showcase_enabled".to_string())
|
||||
.or_insert_with(|| serde_json::Value::Bool(true));
|
||||
for field in ["image_sequence_frames_json", "image_sequence_duration_ms"] {
|
||||
object
|
||||
.entry(field.to_string())
|
||||
.or_insert(serde_json::Value::Null);
|
||||
}
|
||||
}
|
||||
}
|
||||
if table_name == "editor_asset" {
|
||||
@@ -1570,6 +1581,11 @@ fn normalize_migration_row(table_name: &str, value: &serde_json::Value) -> serde
|
||||
object
|
||||
.entry("group_task_expected_asset_count".to_string())
|
||||
.or_insert(serde_json::Value::Null);
|
||||
for field in ["image_sequence_frames_json", "image_sequence_duration_ms"] {
|
||||
object
|
||||
.entry(field.to_string())
|
||||
.or_insert(serde_json::Value::Null);
|
||||
}
|
||||
}
|
||||
}
|
||||
next_value
|
||||
|
||||
Reference in New Issue
Block a user