feat(douyu): 支持外部协作单撤销并推荐账号

This commit is contained in:
yml
2026-11-20 13:02:40 +08:00
parent 1a49bcd481
commit 55021a683c
8 changed files with 1045 additions and 16 deletions
+47
View File
@@ -221,6 +221,34 @@ export interface DouyuCollabAccountLookup {
}>;
}
export interface DouyuCollabAccountCandidate {
account_id: number;
account_username: string;
account_uid: string;
account_nickname: string;
ck_status: string;
role_status: string;
bind_game_role: string;
role_change_available_at: string | null;
points: number | null;
elite_opened: boolean | null;
match_type: 'empty' | 'rebind' | string;
match_type_label: string;
ready: boolean;
reasons: string[];
}
export interface DouyuCollabAccountRecommendation {
order_id: number;
gift_name: string;
commodity_id: string;
required_points: number | null;
include_rebindable: boolean;
scanned: number;
candidates: DouyuCollabAccountCandidate[];
message: string;
}
export interface DouyuCollabOrderCreate {
order_no: string;
shop?: string;
@@ -383,6 +411,25 @@ export const douyuCollabApi = {
expected_version,
takeover_platform_lease,
}),
unlinkAccount: (id: number, reason: string, expected_version?: number) =>
api.post<DouyuCollabOrder, DouyuCollabOrder>(
`/douyu/external-orders/${id}/account/unlink`,
{ reason, expected_version },
),
recommendAccount: (
id: number,
data: {
include_rebindable?: boolean;
limit?: number;
gift_name?: string;
commodity_id?: string;
required_points?: number | null;
} = {},
) =>
api.post<DouyuCollabAccountRecommendation, DouyuCollabAccountRecommendation>(
`/douyu/external-orders/${id}/account/recommend`,
data,
),
verifyOrder: (id: number) =>
api.post<{ order: DouyuCollabOrder; probe: DouyuCollabAccountLookup }, { order: DouyuCollabOrder; probe: DouyuCollabAccountLookup }>(
`/douyu/external-orders/${id}/verify`,