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}`),