import { inject , injectable } from 'inversify' ; import * as apid from '../../../../../api' ; import IRepositoryModel from '../IRepositoryModel' ; import IEncodeApiModel from './IEncodeApiModel' ; @ injectable ( ) export default class EncodeApiModel implements IEncodeApiModel { private repository : IRepositoryModel ; constructor ( @ inject ( 'IRepositoryModel' ) repository ) { this . repository = repository ; } param isHalfWidth return public async gets ( isHalfWidth ) { const result = await this . repository . get ( '/encode' , { params : { isHalfWidth : isHalfWidth , } , } ) ; return result . data ; } param option return public async addEncode ( option ) { const result = await this . repository . post ( '/encode' , option ) ; return result . data . encodeId ; } param encodeId return public async cancel ( encodeId ) { await this . repository . delete ( `/encode/${ encodeId . toString ( 10 ) }` ) ; } }