This commit is contained in:
2026-04-30 17:49:07 +08:00
parent 805d6f8cae
commit 9d684cb7b3
615 changed files with 15368 additions and 6172 deletions

View File

@@ -1917,7 +1917,7 @@ pub(crate) fn map_custom_world_gallery_entry_snapshot(
play_count: snapshot.play_count,
remix_count: snapshot.remix_count,
like_count: snapshot.like_count,
recent_play_count_7d: snapshot.recent_play_count_7d,
recent_play_count_7d: snapshot.recent_play_count_7_d,
})
}
@@ -2223,6 +2223,7 @@ pub(crate) fn map_puzzle_agent_session_snapshot(
) -> PuzzleAgentSessionRecord {
PuzzleAgentSessionRecord {
session_id: snapshot.session_id,
seed_text: snapshot.seed_text,
current_turn: snapshot.current_turn,
progress_percent: snapshot.progress_percent,
stage: snapshot.stage.as_str().to_string(),
@@ -2268,6 +2269,8 @@ pub(crate) fn map_puzzle_result_draft(
snapshot: DomainPuzzleResultDraft,
) -> PuzzleResultDraftRecord {
PuzzleResultDraftRecord {
work_title: snapshot.work_title,
work_description: snapshot.work_description,
level_name: snapshot.level_name,
summary: snapshot.summary,
theme_tags: snapshot.theme_tags,
@@ -2283,6 +2286,39 @@ pub(crate) fn map_puzzle_result_draft(
cover_image_src: snapshot.cover_image_src,
cover_asset_id: snapshot.cover_asset_id,
generation_status: snapshot.generation_status,
levels: snapshot
.levels
.into_iter()
.map(map_puzzle_draft_level)
.collect(),
form_draft: snapshot.form_draft.map(map_puzzle_form_draft),
}
}
pub(crate) fn map_puzzle_form_draft(
snapshot: module_puzzle::PuzzleFormDraft,
) -> PuzzleFormDraftRecord {
PuzzleFormDraftRecord {
work_title: snapshot.work_title,
work_description: snapshot.work_description,
picture_description: snapshot.picture_description,
}
}
pub(crate) fn map_puzzle_draft_level(snapshot: DomainPuzzleDraftLevel) -> PuzzleDraftLevelRecord {
PuzzleDraftLevelRecord {
level_id: snapshot.level_id,
level_name: snapshot.level_name,
picture_description: snapshot.picture_description,
candidates: snapshot
.candidates
.into_iter()
.map(map_puzzle_generated_image_candidate)
.collect(),
selected_candidate_id: snapshot.selected_candidate_id,
cover_image_src: snapshot.cover_image_src,
cover_asset_id: snapshot.cover_asset_id,
generation_status: snapshot.generation_status,
}
}
@@ -2386,6 +2422,8 @@ pub(crate) fn map_puzzle_work_profile(
owner_user_id: snapshot.owner_user_id,
source_session_id: snapshot.source_session_id,
author_display_name: snapshot.author_display_name,
work_title: snapshot.work_title,
work_description: snapshot.work_description,
level_name: snapshot.level_name,
summary: snapshot.summary,
theme_tags: snapshot.theme_tags,
@@ -2400,6 +2438,11 @@ pub(crate) fn map_puzzle_work_profile(
recent_play_count_7d: snapshot.recent_play_count_7d,
publish_ready: snapshot.publish_ready,
anchor_pack: map_puzzle_anchor_pack(snapshot.anchor_pack),
levels: snapshot
.levels
.into_iter()
.map(map_puzzle_draft_level)
.collect(),
}
}
@@ -4215,6 +4258,14 @@ pub struct CustomWorldProfilePlayReportRecordInput {
pub played_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CustomWorldProfileLikeReportRecordInput {
pub owner_user_id: String,
pub profile_id: String,
pub user_id: String,
pub liked_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CustomWorldPublishWorldRecordInput {
pub session_id: String,
@@ -4314,6 +4365,14 @@ pub struct PuzzleAgentSessionCreateRecordInput {
pub created_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleFormDraftSaveRecordInput {
pub session_id: String,
pub owner_user_id: String,
pub seed_text: String,
pub saved_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleAgentMessageSubmitRecordInput {
pub session_id: String,
@@ -4340,6 +4399,7 @@ pub struct PuzzleAgentMessageFinalizeRecordInput {
pub struct PuzzleGeneratedImagesSaveRecordInput {
pub session_id: String,
pub owner_user_id: String,
pub level_id: Option<String>,
pub candidates_json: String,
pub saved_at_micros: i64,
}
@@ -4348,6 +4408,7 @@ pub struct PuzzleGeneratedImagesSaveRecordInput {
pub struct PuzzleSelectCoverImageRecordInput {
pub session_id: String,
pub owner_user_id: String,
pub level_id: Option<String>,
pub candidate_id: String,
pub selected_at_micros: i64,
}
@@ -4359,9 +4420,12 @@ pub struct PuzzlePublishRecordInput {
pub work_id: String,
pub profile_id: String,
pub author_display_name: String,
pub work_title: Option<String>,
pub work_description: Option<String>,
pub level_name: Option<String>,
pub summary: Option<String>,
pub theme_tags: Option<Vec<String>>,
pub levels_json: Option<String>,
pub published_at_micros: i64,
}
@@ -4369,11 +4433,14 @@ pub struct PuzzlePublishRecordInput {
pub struct PuzzleWorkUpsertRecordInput {
pub profile_id: String,
pub owner_user_id: String,
pub work_title: String,
pub work_description: String,
pub level_name: String,
pub summary: String,
pub theme_tags: Vec<String>,
pub cover_image_src: Option<String>,
pub cover_asset_id: Option<String>,
pub levels_json: Option<String>,
pub updated_at_micros: i64,
}
@@ -4389,11 +4456,19 @@ pub struct PuzzleWorkRemixRecordInput {
pub remixed_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleWorkLikeReportRecordInput {
pub profile_id: String,
pub user_id: String,
pub liked_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleRunStartRecordInput {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub level_id: Option<String>,
pub started_at_micros: i64,
}
@@ -4447,6 +4522,13 @@ pub struct BigFishPlayReportRecordInput {
pub reported_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct BigFishLikeReportRecordInput {
pub session_id: String,
pub user_id: String,
pub liked_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct BigFishWorkRemixRecordInput {
pub source_session_id: String,
@@ -4498,6 +4580,8 @@ pub struct PuzzleGeneratedImageCandidateRecord {
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleResultDraftRecord {
pub work_title: String,
pub work_description: String,
pub level_name: String,
pub summary: String,
pub theme_tags: Vec<String>,
@@ -4509,6 +4593,27 @@ pub struct PuzzleResultDraftRecord {
pub cover_image_src: Option<String>,
pub cover_asset_id: Option<String>,
pub generation_status: String,
pub levels: Vec<PuzzleDraftLevelRecord>,
pub form_draft: Option<PuzzleFormDraftRecord>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleFormDraftRecord {
pub work_title: Option<String>,
pub work_description: Option<String>,
pub picture_description: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleDraftLevelRecord {
pub level_id: String,
pub level_name: String,
pub picture_description: String,
pub candidates: Vec<PuzzleGeneratedImageCandidateRecord>,
pub selected_candidate_id: Option<String>,
pub cover_image_src: Option<String>,
pub cover_asset_id: Option<String>,
pub generation_status: String,
}
#[derive(Clone, Debug, PartialEq, Eq)]
@@ -4553,6 +4658,7 @@ pub struct PuzzleResultPreviewRecord {
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleAgentSessionRecord {
pub session_id: String,
pub seed_text: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
@@ -4573,6 +4679,8 @@ pub struct PuzzleWorkProfileRecord {
pub owner_user_id: String,
pub source_session_id: Option<String>,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub level_name: String,
pub summary: String,
pub theme_tags: Vec<String>,
@@ -4587,6 +4695,7 @@ pub struct PuzzleWorkProfileRecord {
pub recent_play_count_7d: u32,
pub publish_ready: bool,
pub anchor_pack: PuzzleAnchorPackRecord,
pub levels: Vec<PuzzleDraftLevelRecord>,
}
#[derive(Clone, Debug, PartialEq, Eq)]