补齐创作生成订阅消息通知
订阅消息任务名称改为玩法模板名。 拼图、敲木鱼、抓大鹅、跳一跳、方洞、视觉小说在草稿生成成功或失败终态发送通知。 订阅消息泥点字段按本次生成结算后的实际扣除展示,失败退款后显示0。 更新微信订阅消息运维和支付方案文档口径。
This commit is contained in:
@@ -323,27 +323,56 @@ pub(super) async fn compile_match3d_draft_for_session(
|
||||
)
|
||||
.await;
|
||||
|
||||
if let Err(response) = result.as_ref()
|
||||
&& response.status().is_server_error()
|
||||
{
|
||||
let failure_message = match3d_response_failure_message(response);
|
||||
persist_failed_match3d_draft_generation(
|
||||
state,
|
||||
request_context,
|
||||
authenticated,
|
||||
compile_session_id,
|
||||
compile_owner_user_id,
|
||||
compile_profile_id,
|
||||
compile_initial_game_name,
|
||||
compile_requested_summary,
|
||||
compile_initial_tags,
|
||||
compile_requested_cover_image_src,
|
||||
failure_message,
|
||||
)
|
||||
.await;
|
||||
match result {
|
||||
Ok((session, generated_item_assets)) => {
|
||||
send_generation_result_subscribe_message_after_completion(
|
||||
state,
|
||||
GenerationResultSubscribeMessage {
|
||||
owner_user_id: compile_owner_user_id.clone(),
|
||||
task_name: Some("抓大鹅".to_string()),
|
||||
work_name: session.draft.as_ref().map(|draft| draft.game_name.clone()),
|
||||
status: GenerationResultSubscribeMessageStatus::Succeeded,
|
||||
consumed_points: points_cost,
|
||||
completed_at_micros: current_utc_micros(),
|
||||
page: Some("/pages/web-view/index".to_string()),
|
||||
},
|
||||
)
|
||||
.await;
|
||||
Ok((session, generated_item_assets))
|
||||
}
|
||||
Err(response) if response.status().is_server_error() => {
|
||||
let failure_message = match3d_response_failure_message(&response);
|
||||
persist_failed_match3d_draft_generation(
|
||||
state,
|
||||
request_context,
|
||||
authenticated,
|
||||
compile_session_id,
|
||||
compile_owner_user_id.clone(),
|
||||
compile_profile_id,
|
||||
compile_initial_game_name.clone(),
|
||||
compile_requested_summary,
|
||||
compile_initial_tags,
|
||||
compile_requested_cover_image_src,
|
||||
failure_message,
|
||||
)
|
||||
.await;
|
||||
send_generation_result_subscribe_message_after_completion(
|
||||
state,
|
||||
GenerationResultSubscribeMessage {
|
||||
owner_user_id: compile_owner_user_id,
|
||||
task_name: Some("抓大鹅".to_string()),
|
||||
work_name: Some(compile_initial_game_name),
|
||||
status: GenerationResultSubscribeMessageStatus::Failed,
|
||||
consumed_points: 0,
|
||||
completed_at_micros: current_utc_micros(),
|
||||
page: Some("/pages/web-view/index".to_string()),
|
||||
},
|
||||
)
|
||||
.await;
|
||||
Err(response)
|
||||
}
|
||||
Err(response) => Err(response),
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
|
||||
Reference in New Issue
Block a user