35 lines
969 B
TypeScript
35 lines
969 B
TypeScript
|
|
import { get, post } from './request';
|
||
|
|
|
||
|
|
export interface LikeTask {
|
||
|
|
id: string;
|
||
|
|
name: string;
|
||
|
|
status: 'running' | 'paused';
|
||
|
|
deviceCount: number;
|
||
|
|
targetGroup: string;
|
||
|
|
likeCount: number;
|
||
|
|
lastLikeTime: string;
|
||
|
|
createTime: string;
|
||
|
|
creator: string;
|
||
|
|
likeInterval: number;
|
||
|
|
maxLikesPerDay: number;
|
||
|
|
timeRange: { start: string; end: string };
|
||
|
|
contentTypes: string[];
|
||
|
|
targetTags: string[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function fetchAutoLikeTasks(): Promise<LikeTask[]> {
|
||
|
|
const res = await get('/api/workbench/auto-like/list');
|
||
|
|
return res.data?.list || [];
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function deleteAutoLikeTask(id: string) {
|
||
|
|
return post('/api/workbench/auto-like/delete', { id });
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function toggleAutoLikeTask(id: string, status: string) {
|
||
|
|
return post('/api/workbench/auto-like/toggle', { id, status });
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function copyAutoLikeTask(id: string) {
|
||
|
|
return post('/api/workbench/auto-like/copy', { id });
|
||
|
|
}
|