@@ -36,7 +36,7 @@ platform-oss = { workspace = true }
|
||||
platform-speech = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
shared-contracts = { workspace = true }
|
||||
shared-contracts = { workspace = true, features = ["oss-contracts"] }
|
||||
shared-kernel = { workspace = true }
|
||||
shared-logging = { workspace = true }
|
||||
spacetime-client = { workspace = true }
|
||||
|
||||
@@ -4,6 +4,11 @@ edition.workspace = true
|
||||
version.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[features]
|
||||
# 默认给 api-server 等原生后端暴露资产上传 DTO;SpacetimeDB WASM 路径通过 workspace 依赖关闭默认 feature。
|
||||
default = ["oss-contracts"]
|
||||
oss-contracts = []
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -94,3 +94,4 @@
|
||||
1. `shared-contracts` 只放协议类型与兼容结构,不承接业务规则、供应商适配或状态写入逻辑。
|
||||
2. 各模块 crate 对外暴露的协议优先复用这里的共享定义,避免重复散落。
|
||||
3. 前端兼容契约一旦进入本 crate,就必须与任务清单和基线文档同步维护。
|
||||
4. `assets` 模块依赖 `platform-oss` 的稳定返回类型,默认通过 `oss-contracts` feature 给 `api-server` 使用;SpacetimeDB WASM 构建链路必须通过 workspace 依赖关闭默认 feature,避免把 `platform-oss` / `reqwest` / `wasm-bindgen` 带进 `spacetime-module`。
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod admin;
|
||||
pub mod ai;
|
||||
pub mod api;
|
||||
#[cfg(feature = "oss-contracts")]
|
||||
pub mod assets;
|
||||
pub mod auth;
|
||||
pub mod big_fish;
|
||||
|
||||
@@ -1069,6 +1069,7 @@ fn select_puzzle_cover_image_tx(
|
||||
level_name: target_level.level_name,
|
||||
picture_description: target_level.picture_description,
|
||||
picture_reference: target_level.picture_reference,
|
||||
background_music: target_level.background_music,
|
||||
candidates: selected_level_draft.candidates,
|
||||
selected_candidate_id: selected_level_draft.selected_candidate_id,
|
||||
cover_image_src: selected_level_draft.cover_image_src,
|
||||
@@ -2321,6 +2322,7 @@ fn build_profile_levels_from_row(
|
||||
level_name: row.level_name.clone(),
|
||||
picture_description: row.summary.clone(),
|
||||
picture_reference: None,
|
||||
background_music: None,
|
||||
candidates: Vec::new(),
|
||||
selected_candidate_id: None,
|
||||
cover_image_src: row.cover_image_src.clone(),
|
||||
@@ -3335,6 +3337,7 @@ mod tests {
|
||||
.map(|level| level.picture_description.clone())
|
||||
.unwrap_or_default(),
|
||||
picture_reference: None,
|
||||
background_music: None,
|
||||
candidates: candidates.clone(),
|
||||
selected_candidate_id: None,
|
||||
cover_image_src: None,
|
||||
|
||||
Reference in New Issue
Block a user