Merge remote-tracking branch 'origin/master' into hermes/wechat
# Conflicts: # .hermes/shared-memory/pitfalls.md # .hermes/todos/【后端架构】api-server能力模块化与图片资产Adapter收口计划-2026-05-14.md
This commit is contained in:
@@ -742,6 +742,42 @@ pub(crate) fn map_asset_history_list_result(
|
||||
.collect())
|
||||
}
|
||||
|
||||
pub type BarkBattleDraftConfigRecord = serde_json::Value;
|
||||
pub type BarkBattleRuntimeConfigRecord = serde_json::Value;
|
||||
pub type BarkBattleRunRecord = serde_json::Value;
|
||||
|
||||
pub(crate) fn map_bark_battle_draft_config_procedure_result(
|
||||
result: BarkBattleProcedureResult,
|
||||
) -> Result<BarkBattleDraftConfigRecord, SpacetimeClientError> {
|
||||
parse_bark_battle_row_json(result, "Bark Battle draft config")
|
||||
}
|
||||
|
||||
pub(crate) fn map_bark_battle_runtime_config_procedure_result(
|
||||
result: BarkBattleProcedureResult,
|
||||
) -> Result<BarkBattleRuntimeConfigRecord, SpacetimeClientError> {
|
||||
parse_bark_battle_row_json(result, "Bark Battle runtime config")
|
||||
}
|
||||
|
||||
pub(crate) fn map_bark_battle_run_procedure_result(
|
||||
result: BarkBattleProcedureResult,
|
||||
) -> Result<BarkBattleRunRecord, SpacetimeClientError> {
|
||||
parse_bark_battle_row_json(result, "Bark Battle run")
|
||||
}
|
||||
|
||||
fn parse_bark_battle_row_json<T: serde::de::DeserializeOwned>(
|
||||
result: BarkBattleProcedureResult,
|
||||
label: &'static str,
|
||||
) -> Result<T, SpacetimeClientError> {
|
||||
if !result.ok {
|
||||
return Err(SpacetimeClientError::procedure_failed(result.error_message));
|
||||
}
|
||||
let row_json = result
|
||||
.row_json
|
||||
.ok_or_else(|| SpacetimeClientError::missing_snapshot(label))?;
|
||||
serde_json::from_str(&row_json)
|
||||
.map_err(|error| SpacetimeClientError::Runtime(format!("{label} JSON 解析失败: {error}")))
|
||||
}
|
||||
|
||||
pub type CreationEntryConfigRecord =
|
||||
shared_contracts::creation_entry_config::CreationEntryConfigResponse;
|
||||
|
||||
@@ -3827,6 +3863,7 @@ pub(crate) fn map_puzzle_runtime_level_snapshot(
|
||||
theme_tags: snapshot.theme_tags,
|
||||
cover_image_src: snapshot.cover_image_src,
|
||||
ui_background_image_src: snapshot.ui_background_image_src,
|
||||
ui_background_image_object_key: snapshot.ui_background_image_object_key,
|
||||
background_music: snapshot.background_music.map(map_puzzle_audio_asset),
|
||||
board: map_puzzle_board_snapshot(snapshot.board),
|
||||
status: snapshot.status.as_str().to_string(),
|
||||
@@ -7520,6 +7557,7 @@ pub struct PuzzleRuntimeLevelRecord {
|
||||
pub theme_tags: Vec<String>,
|
||||
pub cover_image_src: Option<String>,
|
||||
pub ui_background_image_src: Option<String>,
|
||||
pub ui_background_image_object_key: Option<String>,
|
||||
pub background_music: Option<PuzzleAudioAssetRecord>,
|
||||
pub board: PuzzleBoardRecord,
|
||||
pub status: String,
|
||||
|
||||
Reference in New Issue
Block a user