62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
import {post} from "@/service/request.ts";
|
|
import {getById as getArticle} from "./article"
|
|
|
|
export function getList() {
|
|
return post<DataList<VideoInfo>>('/video/list')
|
|
}
|
|
export function search(params:VideoSearchParams) {
|
|
return post<DataList<VideoInfo>>('/video/search',params)
|
|
}
|
|
export function deleteHistories(ids: Id[]) {
|
|
return post('/video/history/remove', {ids})
|
|
}
|
|
|
|
/**
|
|
* 视频列表的文章编辑(需要重新生成视频)
|
|
* @param title
|
|
* @param content_group
|
|
* @param article_id
|
|
*/
|
|
export function regenerate(params:{title: string, metahuman_text: string, content_group: BlockContent[][], id?: Id}) {
|
|
return post<{ content: string }>({
|
|
url: '/video/regenerate',
|
|
data: {
|
|
...params,
|
|
article_id:params.id
|
|
}
|
|
})
|
|
}
|
|
// 重新生成视频
|
|
export async function regenerateById(article_id: Id) {
|
|
const article = await getArticle(article_id);
|
|
return await regenerate({
|
|
title:article.title,
|
|
metahuman_text:article.metahuman_text,
|
|
content_group:article.content_group,
|
|
id:article_id
|
|
})
|
|
}
|
|
|
|
export function getById(id: Id) {
|
|
return post<VideoInfo>({url: '/video/detail/' + id})
|
|
}
|
|
|
|
export function deleteFromList(ids: Id[]) {
|
|
return post('/video/remove', {ids})
|
|
}
|
|
|
|
|
|
export function modifyOrder(ids: Id[]) {
|
|
return post('/video/modifyorder', {ids})
|
|
}
|
|
|
|
export function push2room(video_ids: Id[]) {
|
|
return post('/video/push2room', {video_ids})
|
|
}
|
|
|
|
export enum VideoStatus {
|
|
// 生成中
|
|
Generating = 1,
|
|
// 已生成
|
|
Generated = 2,
|
|
} |