fix(platform): 持久化并完善斗鱼兑换结果图片

This commit is contained in:
yml
2026-11-21 11:39:04 +08:00
parent 9c90a452c5
commit cd7eb78e01
14 changed files with 870 additions and 50 deletions
+9
View File
@@ -1,6 +1,7 @@
import api from './client';
import type {
DouyuConfig,
DouyuExchangeResultImage,
DouyuGoodsItem,
DouyuRechargeChannel,
DouyuTaskAccountItem,
@@ -55,6 +56,14 @@ export const douyuApi = {
listTasksPaged: (params: PageParams & { batch_id?: string; include_detail?: boolean }) =>
api.get<PaginatedResponse<DouyuTaskItem>, PaginatedResponse<DouyuTaskItem>>('/douyu/tasks', { params }),
getTask: (taskId: number) => api.get<DouyuTaskItem, DouyuTaskItem>(`/douyu/tasks/${taskId}`),
saveExchangeResultImage: (taskId: number, file: File) => {
const form = new FormData();
form.append('file', file);
return api.post<DouyuExchangeResultImage, DouyuExchangeResultImage>(
`/douyu/tasks/${taskId}/exchange-result-image`,
form,
);
},
cleanupOrphans: () =>
api.post<{ message: string; cleaned: number; success: boolean }, { message: string; cleaned: number; success: boolean }>('/douyu/tasks/cleanup-orphans'),
stopBatch: (batchId: string) => api.post<MessageResponse, MessageResponse>(`/douyu/stop/${batchId}`),
+12
View File
@@ -790,6 +790,12 @@ export interface DouyuTaskItem {
finished_at: string | null;
}
export interface DouyuExchangeResultImage {
object_key: string;
url: string;
saved_at: string;
}
export interface DouyuGoodsItem {
id: number;
commodity_id: string;
@@ -2238,6 +2244,12 @@ export interface PlatformFulfillmentTask {
account: PlatformFulfillmentAccount | null;
lease: { id: number; status: string; expiresAt: string | null } | null;
bindTask: PlatformFulfillmentBindTask | null;
exchangeTaskId: number | null;
exchangeResultImage: {
objectKey: string;
url: string;
savedAt: string | null;
} | null;
}
export interface PlatformFulfillmentEvent {