feat: 支持创作入口公告配置

This commit is contained in:
2026-06-03 03:31:45 +08:00
parent 1cb11bc1dd
commit 70ff18ad90
52 changed files with 3045 additions and 504 deletions

View File

@@ -87,6 +87,34 @@ impl SpacetimeClient {
Ok(config)
}
/// 调用 SpacetimeDB procedure 保存创作入口页多 banner 配置并刷新缓存。
pub async fn upsert_creation_entry_event_banners_config(
&self,
input: module_runtime::CreationEntryEventBannersAdminUpsertInput,
) -> Result<CreationEntryConfigRecord, SpacetimeClientError> {
let procedure_input: CreationEntryEventBannersAdminUpsertInput = input.into();
let config = self
.call_after_connect(
"upsert_creation_entry_event_banners_config",
move |connection, sender| {
connection
.procedures()
.upsert_creation_entry_event_banners_config_then(
procedure_input,
move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_creation_entry_config_procedure_result);
send_once(&sender, mapped);
},
);
},
)
.await?;
self.cache_creation_entry_config(config.clone()).await;
Ok(config)
}
pub async fn admin_list_work_visibility(
&self,
admin_user_id: String,