feat(subscription): 支持恢复已撤销订阅

This commit is contained in:
deqiying
2026-07-01 22:19:21 +08:00
parent 7dc7cfce1d
commit b26dcc3da2
17 changed files with 382 additions and 19 deletions
+12 -1
View File
@@ -24,7 +24,7 @@ export async function list(
page: number = 1,
pageSize: number = 20,
filters?: {
status?: 'active' | 'expired' | 'revoked'
status?: 'active' | 'expired' | 'revoked' | 'suspended'
user_id?: number
group_id?: number
platform?: string
@@ -121,6 +121,16 @@ export async function revoke(id: number): Promise<{ message: string }> {
return data
}
/**
* Restore revoked subscription
* @param id - Subscription ID
* @returns Restored subscription
*/
export async function restore(id: number): Promise<UserSubscription> {
const { data } = await apiClient.post<UserSubscription>(`/admin/subscriptions/${id}/restore`)
return data
}
/**
* Reset daily, weekly, and/or monthly usage quota for a subscription
* @param id - Subscription ID
@@ -188,6 +198,7 @@ export const subscriptionsAPI = {
bulkAssign,
extend,
revoke,
restore,
resetQuota,
listByGroup,
listByUser