add transcode and sign
This commit is contained in:
1 parent
c26fba65a2
commit
c020564dc2
9 files changed
+157
-17
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import httpClient from '../instance';
|
||||
import { IResourceDetailResponse } from '../resource/types';
|
||||
import { IEpisode, IEpisodeDetailResponse, IEpisodeListResponse } from './types';
|
||||
import { IEpisode, IEpisodeDetailResponse, IEpisodeListResponse, IEpisodeSignResponse } from './types';
|
||||
|
||||
class EpisodeService {
|
||||
key = 'episodes';
|
||||
@@ -15,7 +15,11 @@ class EpisodeService {
|
||||
}
|
||||
|
||||
async resource(id: number): Promise<AxiosResponse<IResourceDetailResponse>> {
|
||||
return await httpClient.get(`/${this.key}/${id}/resource/`);
|
||||
return await httpClient.post(`/${this.key}/${id}/resource/`);
|
||||
}
|
||||
|
||||
async sign(id: number): Promise<AxiosResponse<IEpisodeSignResponse>> {
|
||||
return await httpClient.get(`/${this.key}/${id}/sign/`);
|
||||
}
|
||||
|
||||
async create(data: IEpisode): Promise<AxiosResponse<IEpisodeDetailResponse>> {
|
||||
|
||||
@@ -22,4 +22,8 @@ export interface IEpisodeListResponse {
|
||||
items: IEpisode[];
|
||||
}
|
||||
|
||||
export interface IEpisodeSignResponse {
|
||||
sign: string;
|
||||
}
|
||||
|
||||
export type IEpisodeDetailResponse = IEpisode;
|
||||
@@ -1,10 +1,13 @@
|
||||
export interface IResource {
|
||||
id: string;
|
||||
url?: string;
|
||||
state?: string;
|
||||
taskId?: string;
|
||||
fileId?: string;
|
||||
transcodeTaskState?: string;
|
||||
uploadTaskState?: string;
|
||||
transcodeTaskId?: string;
|
||||
uploadTaskId?: string;
|
||||
watermarks?: string[];
|
||||
episode?: number;
|
||||
sign?: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user