docs(architecture): consolidate domain protocols

This commit is contained in:
2026-07-21 10:08:12 +08:00
parent 8d6fe1e550
commit 17e5656f53
11 changed files with 524 additions and 149 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* PaymentRepository
*
* 支付 / 付费墙相关远程调用
* 统一封装默认套餐、Tip 套餐、订单创建和订单状态查询
*/
import type { IPaymentRepository } from "@/data/repositories/interfaces";
import {
+4 -10
View File
@@ -1,7 +1,7 @@
/**
* Payment API
*
* 付费墙 / 充值相关接口
* 套餐目录、订单创建与订单状态接口
*/
import {
CreatePaymentOrderRequest,
@@ -20,9 +20,7 @@ import { httpClient } from "./http_client";
import { ApiEnvelope, unwrap } from "./response_helper";
export class PaymentApi {
/**
* 获取套餐列表
*/
/** 获取 VIP 与 Top-up 套餐列表。 */
async getPlans(): Promise<PaymentPlansResponse> {
const env = await httpClient<ApiEnvelope<unknown>>(ApiPath.paymentPlans);
return PaymentPlansResponseSchema.parse(
@@ -38,9 +36,7 @@ export class PaymentApi {
);
}
/**
* 创建支付订单
*/
/** 创建 VIP、Top-up 或 Tip 订单。 */
async createOrder(
body: CreatePaymentOrderRequest,
): Promise<CreatePaymentOrderResponse> {
@@ -56,9 +52,7 @@ export class PaymentApi {
);
}
/**
* 查询支付订单状态
*/
/** 查询订单最终支付状态。 */
async getOrderStatus(orderId: string): Promise<PaymentOrderStatusResponse> {
const env = await httpClient<ApiEnvelope<unknown>>(
ApiPath.paymentOrderStatus,