feat(subscription): Refactor subscription handling and update imports for better organization

This commit is contained in:
web@ppanel
2025-03-08 12:34:23 +07:00
parent 3222016799
commit 2215c7f2b9
27 changed files with 1042 additions and 180 deletions
-11
View File
@@ -58,17 +58,6 @@ export async function getStat(options?: { [key: string]: any }) {
});
}
/** Get Subscription GET /v1/common/site/subscribe */
export async function getSubscription(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetSubscriptionResponse }>(
'/v1/common/site/subscribe',
{
method: 'GET',
...(options || {}),
},
);
}
/** Get Tos Content GET /v1/common/site/tos */
export async function getTos(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetTosResponse }>('/v1/common/site/tos', {
+40 -16
View File
@@ -90,17 +90,6 @@ declare namespace API {
enabled: boolean;
};
type CheckoutOrderRequest = {
orderNo: string;
returnUrl?: string;
};
type CheckoutOrderResponse = {
type: string;
checkout_url?: string;
stripe?: StripePayment;
};
type CheckUserParams = {
email: string;
};
@@ -175,7 +164,7 @@ declare namespace API {
};
type GetAvailablePaymentMethodsResponse = {
list: PaymentConfig[];
list: PaymenMethod[];
};
type GetGlobalConfigResponse = {
@@ -196,14 +185,24 @@ declare namespace API {
protocol: string[];
};
type GetSubscriptionResponse = {
list: Subscribe[];
};
type GetTosResponse = {
tos_content: string;
};
type GetUserSubscribeTrafficLogsRequest = {
page: number;
size: number;
user_id: number;
subscribe_id: number;
start_time: number;
end_time: number;
};
type GetUserSubscribeTrafficLogsResponse = {
list: TrafficLog[];
total: number;
};
type GoogleLoginCallbackRequest = {
code: string;
state: string;
@@ -329,6 +328,16 @@ declare namespace API {
updated_at: number;
};
type PaymenMethod = {
id: number;
name: string;
mark: string;
icon: string;
fee_mode: number;
fee_percent: number;
fee_amount: number;
};
type PaymentConfig = {
id: number;
name: string;
@@ -417,6 +426,21 @@ declare namespace API {
list: OrderDetail[];
};
type QuerySubscribeGroupListResponse = {
list: SubscribeGroup[];
total: number;
};
type QuerySubscribeListResponse = {
list: Subscribe[];
total: number;
};
type QueryUserAffiliateListResponse = {
list: UserAffiliate[];
total: number;
};
type RechargeOrderRequest = {
amount: number;
payment: string;