Skip to content

Let's use AI to Earn!

feat: 获取任务素材

牛文政ce341f66c0c9
diff --git a/src/api/task.ts b/src/api/task.ts
index 5492963c..97d0d47b 100644
--- a/src/api/task.ts
+++ b/src/api/task.ts
@@ -6,7 +6,7 @@
* @Description: 任务
*/
import http, { hotHttp } from './request';
-import { ApplyTask, MineTaskListParams, UserTask } from './types/task';
+import { ApplyTask, MineTaskListParams, TaskMaterial, UserTask } from './types/task';
import { Task, TaskDataInfo } from 'commont/types/task';
import { Pagination } from './types';
import { UserWalletRecord } from './types/finance';
@@ -117,4 +117,12 @@ export const taskApi = {
isToken: true,
});
},
+
+ /**
+ * 获取任务的最优素材
+ * @returns
+ */
+ getFristTaskMaterial(taskId: string) {
+ return http.get<TaskMaterial>(`/tasks/material/frist/${taskId}`);
+ },
};
diff --git a/src/api/types/task.ts b/src/api/types/task.ts
index e5180723..725b219f 100644
--- a/src/api/types/task.ts
+++ b/src/api/types/task.ts
@@ -62,3 +62,22 @@ export interface ApplyTask {
uid: string;
accountType: AccountType;
}
+
+export interface TaskArticleImg {
+ content: string;
+ imageUrl: string;
+}
+
+export interface TaskMaterial {
+ id: string;
+ taskId: string;
+ type: TaskType;
+ title?: string; // 标题
+ coverUrl?: string; // 封面图
+ temp?: string; // 模板字符
+ desc?: string;
+ imageList: TaskArticleImg[];
+ usedCount: number;
+ createTime: string;
+ updateTime: string;
+}