Add backend feedback submission and image preview
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-05-08 21:47:45 +08:00
parent b2ac92e0fc
commit 199b44c18c
38 changed files with 1521 additions and 140 deletions

View File

@@ -161,6 +161,34 @@ impl From<module_runtime::RuntimeProfileRechargeOrderCreateInput>
}
}
impl From<module_runtime::RuntimeProfileFeedbackSubmissionInput>
for RuntimeProfileFeedbackSubmissionInput
{
fn from(input: module_runtime::RuntimeProfileFeedbackSubmissionInput) -> Self {
Self {
user_id: input.user_id,
description: input.description,
contact_phone: input.contact_phone,
evidence_items: input.evidence_items.into_iter().map(Into::into).collect(),
created_at_micros: input.created_at_micros,
}
}
}
impl From<module_runtime::RuntimeProfileFeedbackEvidenceSnapshot>
for RuntimeProfileFeedbackEvidenceSnapshot
{
fn from(input: module_runtime::RuntimeProfileFeedbackEvidenceSnapshot) -> Self {
Self {
evidence_id: input.evidence_id,
file_name: input.file_name,
content_type: input.content_type,
size_bytes: input.size_bytes,
data_url: input.data_url,
}
}
}
impl From<module_runtime::RuntimeProfileRewardCodeRedeemInput>
for RuntimeProfileRewardCodeRedeemInput
{
@@ -846,6 +874,23 @@ pub(crate) fn map_runtime_profile_recharge_order_procedure_result(
))
}
pub(crate) fn map_runtime_profile_feedback_submission_procedure_result(
result: RuntimeProfileFeedbackSubmissionProcedureResult,
) -> Result<RuntimeProfileFeedbackSubmissionRecord, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let snapshot = result
.record
.ok_or_else(|| SpacetimeClientError::missing_snapshot("profile feedback 快照"))?;
build_runtime_profile_feedback_submission_record(
map_runtime_profile_feedback_submission_snapshot(snapshot),
)
.map_err(SpacetimeClientError::validation_failed)
}
pub(crate) fn map_runtime_referral_invite_center_procedure_result(
result: RuntimeReferralInviteCenterProcedureResult,
) -> Result<RuntimeReferralInviteCenterRecord, SpacetimeClientError> {
@@ -1999,6 +2044,21 @@ pub(crate) fn map_runtime_profile_recharge_order_snapshot(
}
}
pub(crate) fn map_runtime_profile_feedback_submission_snapshot(
snapshot: RuntimeProfileFeedbackSubmissionSnapshot,
) -> module_runtime::RuntimeProfileFeedbackSubmissionSnapshot {
module_runtime::RuntimeProfileFeedbackSubmissionSnapshot {
feedback_id: snapshot.feedback_id,
user_id: snapshot.user_id,
description: snapshot.description,
contact_phone: snapshot.contact_phone,
evidence_json: snapshot.evidence_json,
status: map_runtime_profile_feedback_status_back(snapshot.status),
created_at_micros: snapshot.created_at_micros,
updated_at_micros: snapshot.updated_at_micros,
}
}
pub(crate) fn map_runtime_referral_invite_center_snapshot(
snapshot: RuntimeReferralInviteCenterSnapshot,
) -> module_runtime::RuntimeReferralInviteCenterSnapshot {
@@ -4644,6 +4704,16 @@ pub(crate) fn map_runtime_profile_recharge_order_status_back(
}
}
pub(crate) fn map_runtime_profile_feedback_status_back(
value: crate::module_bindings::RuntimeProfileFeedbackStatus,
) -> module_runtime::RuntimeProfileFeedbackStatus {
match value {
crate::module_bindings::RuntimeProfileFeedbackStatus::Open => {
module_runtime::RuntimeProfileFeedbackStatus::Open
}
}
}
pub(crate) fn map_story_session_status(value: StorySessionStatus) -> DomainStorySessionStatus {
match value {
StorySessionStatus::Active => DomainStorySessionStatus::Active,