You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.0 KiB
TypeScript

8 months ago
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 根据video id删除视频,后端自用 DELETE /vodFile/deleteAliyunVideo/${param0} */
export async function deleteAliyunVideoUsingDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.deleteAliyunVideoUsingDELETEParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.AjaxResult>(`/vodFile/deleteAliyunVideo/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 根据video id获取播放凭证,后端自用 DELETE /vodFile/getVideoAuthByVideoId/${param0} */
export async function getVideoAuthByVideoIdUsingDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.getVideoAuthByVideoIdUsingDELETEParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.AjaxResultGetVideoPlayAuthResponse_>(
`/vodFile/getVideoAuthByVideoId/${param0}`,
{
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
},
);
}
/** 上传视频到vod,测试用 POST /vodFile/upload */
export async function uploadVideoUsingPost(
body: {},
file?: File,
options?: { [key: string]: any },
) {
const formData = new FormData();
if (file) {
formData.append('file', file);
}
Object.keys(body).forEach((ele) => {
const item = (body as any)[ele];
if (item !== undefined && item !== null) {
if (typeof item === 'object' && !(item instanceof File)) {
if (item instanceof Array) {
item.forEach((f) => formData.append(ele, f || ''));
} else {
formData.append(ele, JSON.stringify(item));
}
} else {
formData.append(ele, item);
}
}
});
return request<API.AjaxResultString_>('/vodFile/upload', {
method: 'POST',
data: formData,
requestType: 'form',
...(options || {}),
});
}