import {get, post} from "@/service/request.ts";

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(title: string, metahuman_text: string, content_group: BlockContent[][], article_id?: Id) {
	return post<{ content: string }>({
		url: '/video/regenerate',
		data: {
			title,
			metahuman_text,
			content_group,
			article_id
		}
	})
}

export function getById(id: Id) {
	return post<VideoInfo>({url: '/video/detail/' + id})
}

export function deleteFromList(ids: Id[]) {
	return post('/video/outside', {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,
}