合并最新 master 到作品管理分支
Project CI / Backend tests (pull_request) Failing after 39s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m44s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m43s
Project CI / Repository checks (pull_request) Failing after 40s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m52s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m12s
Project CI / Native shell tests (pull_request) Successful in 6m41s

This commit is contained in:
2026-10-03 17:34:23 +08:00
105 changed files with 8656 additions and 10 deletions
@@ -23,4 +23,5 @@ pub mod game_creation_app;
pub mod game_distribution;
pub mod hyper3d;
pub mod llm;
pub mod payment;
pub mod runtime;
@@ -0,0 +1,106 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentAppCreateRequest {
pub name: String,
#[serde(default)]
pub callback_url: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentAppResponse {
pub app_id: String,
pub name: String,
pub callback_url: Option<String>,
pub enabled: bool,
pub created_at: String,
pub updated_at: String,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentApiKeyResponse {
pub key_id: String,
pub app_id: String,
pub name: String,
pub key_prefix: String,
pub scopes: Vec<String>,
pub created_at: String,
pub last_used_at: Option<String>,
pub revoked_at: Option<String>,
pub updated_at: String,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentAppCreateResponse {
pub app: PaymentAppResponse,
pub api_key: String,
pub key: PaymentApiKeyResponse,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentAppListResponse {
pub apps: Vec<PaymentAppResponse>,
pub keys: Vec<PaymentApiKeyResponse>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentOrderCreateRequest {
pub merchant_order_id: String,
pub title: String,
#[serde(default)]
pub items: Vec<Value>,
pub amount_cents: u64,
#[serde(default = "default_payment_currency")]
pub currency: String,
#[serde(default = "default_payment_provider")]
pub provider: String,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentOrderResponse {
pub order_id: String,
pub app_id: String,
pub merchant_order_id: String,
pub title: String,
pub items: Vec<Value>,
pub amount_cents: u64,
pub currency: String,
pub provider: String,
pub provider_trade_no: Option<String>,
pub checkout_token: String,
pub status: String,
pub checkout_url: String,
pub provider_qr_code: Option<String>,
pub created_at: String,
pub expires_at: String,
pub paid_at: Option<String>,
pub updated_at: String,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentOrderCreateResponse {
pub order: PaymentOrderResponse,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PaymentOrderListResponse {
pub orders: Vec<PaymentOrderResponse>,
}
pub fn default_payment_currency() -> String {
"CNY".to_string()
}
pub fn default_payment_provider() -> String {
"wechat_native".to_string()
}