feat: implement payment order system (create-order, mock-confirm, get-quota)

This commit is contained in:
2026-04-17 12:45:53 +08:00
parent 454139f70d
commit 562528a1f0
7 changed files with 296 additions and 3 deletions

View File

@@ -327,3 +327,31 @@ impl AppState {
})
}
}
// ===== 支付系统 =====
/// 创建订单请求体
#[derive(Debug, Deserialize)]
pub struct CreateOrderRequest {
pub package_type: String,
}
/// 模拟确认支付请求体
#[derive(Debug, Deserialize)]
pub struct MockConfirmRequest {
pub order_id: String,
}
/// payment_orders 表行结构
#[derive(Debug, Serialize, FromRow)]
pub struct PaymentOrder {
pub id: i32,
pub user_id: i32,
pub order_no: String,
pub package_type: String,
pub amount: i32,
pub status: String,
pub paid_at: Option<chrono::DateTime<chrono::Utc>>,
pub expires_at: Option<chrono::DateTime<chrono::Utc>>,
pub created_at: chrono::DateTime<chrono::Utc>,
}