import { inject , injectable } from 'inversify' ; import * as apid from '../../../../../api' ; import IRepositoryModel from '../IRepositoryModel' ; import IRecordedApiModel from './IRecordedApiModel' ; @ injectable ( ) export default class RecordedApiModel implements IRecordedApiModel { private repository : IRepositoryModel ; constructor ( @ inject ( 'IRepositoryModel' ) repository ) { this . repository = repository ; } param option return public async gets ( option ) { const result = await this . repository . get ( '/recorded' , { params : option , } ) ; return result . data ; } param recordedId param isHalfWidth return public async get ( recordedId , isHalfWidth ) { const result = await this . repository . get ( `/recorded/${ recordedId . toString ( 10 ) }` , { params : { isHalfWidth : isHalfWidth , } , } ) ; return result . data ; } return public async getSearchOptionList ( ) { const result = await this . repository . get ( '/recorded/options' ) ; return result . data ; } param recordedId return public async delete ( recordedId ) { await this . repository . delete ( `/recorded/${ recordedId }` ) ; } param recordedId return public async stopEncode ( recordedId ) { await this . repository . delete ( `/recorded/${ recordedId }/encode` ) ; } param recordedId return public async protect ( recordedId ) { await this . repository . put ( `/recorded/${ recordedId }/protect` ) ; } param recordedId return public async unprotect ( recordedId ) { await this . repository . put ( `/recorded/${ recordedId }/unprotect` ) ; } param option return public async createNewRecorded ( option ) { const result = await this . repository . post ( 'recorded' , option ) ; return result . data . recordedId ; } return public async cleanup ( ) { await this . repository . post ( '/recorded/cleanup' ) ; } }