feat: add admin work visibility controls
This commit is contained in:
@@ -14,39 +14,39 @@ const WORK_VISIBLE_DEFAULT: bool = true;
|
||||
)]
|
||||
pub struct CustomWorldProfile {
|
||||
#[primary_key]
|
||||
profile_id: String,
|
||||
pub(crate) profile_id: String,
|
||||
// 当前 profile 承接 library / publish / enter-world 的正式世界工件真相。
|
||||
owner_user_id: String,
|
||||
pub(crate) owner_user_id: String,
|
||||
// 作品公开编号是稳定分享键,第一次发布时分配,后续重复发布沿用。
|
||||
public_work_code: Option<String>,
|
||||
pub(crate) public_work_code: Option<String>,
|
||||
// 作者公开陶泥号在发布时固化到作品真相,供广场读模型与搜索结果直接展示。
|
||||
author_public_user_code: Option<String>,
|
||||
source_agent_session_id: Option<String>,
|
||||
publication_status: CustomWorldPublicationStatus,
|
||||
world_name: String,
|
||||
subtitle: String,
|
||||
summary_text: String,
|
||||
theme_mode: CustomWorldThemeMode,
|
||||
cover_image_src: Option<String>,
|
||||
profile_payload_json: String,
|
||||
playable_npc_count: u32,
|
||||
landmark_count: u32,
|
||||
pub(crate) author_public_user_code: Option<String>,
|
||||
pub(crate) source_agent_session_id: Option<String>,
|
||||
pub(crate) publication_status: CustomWorldPublicationStatus,
|
||||
pub(crate) world_name: String,
|
||||
pub(crate) subtitle: String,
|
||||
pub(crate) summary_text: String,
|
||||
pub(crate) theme_mode: CustomWorldThemeMode,
|
||||
pub(crate) cover_image_src: Option<String>,
|
||||
pub(crate) profile_payload_json: String,
|
||||
pub(crate) playable_npc_count: u32,
|
||||
pub(crate) landmark_count: u32,
|
||||
// 公开消费计数随 profile 真相持久化,发布、编辑和取消发布都不能重置。
|
||||
#[default(0)]
|
||||
play_count: u32,
|
||||
pub(crate) play_count: u32,
|
||||
#[default(0)]
|
||||
remix_count: u32,
|
||||
pub(crate) remix_count: u32,
|
||||
#[default(0)]
|
||||
like_count: u32,
|
||||
author_display_name: String,
|
||||
published_at: Option<Timestamp>,
|
||||
pub(crate) like_count: u32,
|
||||
pub(crate) author_display_name: String,
|
||||
pub(crate) published_at: Option<Timestamp>,
|
||||
// 软删除后保留 profile 真相,供审计与幂等删除使用。
|
||||
deleted_at: Option<Timestamp>,
|
||||
created_at: Timestamp,
|
||||
updated_at: Timestamp,
|
||||
// ??????????????????????????
|
||||
pub(crate) deleted_at: Option<Timestamp>,
|
||||
pub(crate) created_at: Timestamp,
|
||||
pub(crate) updated_at: Timestamp,
|
||||
// 后台可见性开关;默认显示,隐藏后不进入公开列表。
|
||||
#[default(WORK_VISIBLE_DEFAULT)]
|
||||
visible: bool,
|
||||
pub(crate) visible: bool,
|
||||
}
|
||||
|
||||
#[spacetimedb::table(
|
||||
@@ -175,31 +175,31 @@ pub struct CustomWorldDraftCard {
|
||||
)]
|
||||
pub struct CustomWorldGalleryEntry {
|
||||
#[primary_key]
|
||||
profile_id: String,
|
||||
pub(crate) profile_id: String,
|
||||
// 画廊是公开订阅读模型,不再运行时从 profile 即席拼装。
|
||||
owner_user_id: String,
|
||||
public_work_code: String,
|
||||
author_public_user_code: String,
|
||||
author_display_name: String,
|
||||
world_name: String,
|
||||
subtitle: String,
|
||||
summary_text: String,
|
||||
cover_image_src: Option<String>,
|
||||
theme_mode: CustomWorldThemeMode,
|
||||
playable_npc_count: u32,
|
||||
landmark_count: u32,
|
||||
pub(crate) owner_user_id: String,
|
||||
pub(crate) public_work_code: String,
|
||||
pub(crate) author_public_user_code: String,
|
||||
pub(crate) author_display_name: String,
|
||||
pub(crate) world_name: String,
|
||||
pub(crate) subtitle: String,
|
||||
pub(crate) summary_text: String,
|
||||
pub(crate) cover_image_src: Option<String>,
|
||||
pub(crate) theme_mode: CustomWorldThemeMode,
|
||||
pub(crate) playable_npc_count: u32,
|
||||
pub(crate) landmark_count: u32,
|
||||
// 画廊读模型直接同步互动计数,避免前端临时把评分或游玩数改名成点赞。
|
||||
#[default(0)]
|
||||
play_count: u32,
|
||||
pub(crate) play_count: u32,
|
||||
#[default(0)]
|
||||
remix_count: u32,
|
||||
pub(crate) remix_count: u32,
|
||||
#[default(0)]
|
||||
like_count: u32,
|
||||
published_at: Timestamp,
|
||||
updated_at: Timestamp,
|
||||
// ??????????????????????????
|
||||
pub(crate) like_count: u32,
|
||||
pub(crate) published_at: Timestamp,
|
||||
pub(crate) updated_at: Timestamp,
|
||||
// 后台可见性开关;默认显示,隐藏后不进入公开列表。
|
||||
#[default(WORK_VISIBLE_DEFAULT)]
|
||||
visible: bool,
|
||||
pub(crate) visible: bool,
|
||||
}
|
||||
// Agent 会话首版只负责把可持久化创作状态落进 SpacetimeDB,LLM 采集与卡片生成后续再接入。
|
||||
#[spacetimedb::procedure]
|
||||
|
||||
Reference in New Issue
Block a user