fix(platform): 持久化并完善斗鱼兑换结果图片
This commit is contained in:
@@ -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}`),
|
||||
|
||||
Reference in New Issue
Block a user