import { inject , injectable } from 'inversify' ; import * as apid from '../../../../../api' ; import IRepositoryModel from '../IRepositoryModel' ; import IReservesApiModel from './IReservesApiModel' ; @ injectable ( ) export default class ReservesApiModel implements IReservesApiModel { private repository : IRepositoryModel ; constructor ( @ inject ( 'IRepositoryModel' ) repository ) { this . repository = repository ; } param option return public async add ( option ) { const result = await this . repository . post ( '/reserves' , option ) ; return result . data ; } param reserveId param option return public async edit ( reserveId , option ) { const result = await this . repository . put ( `/reserves/${ reserveId }` , option ) ; return result . data ; } param reserveId param isHalfWidth return public async get ( reserveId , isHalfWidth ) { const result = await this . repository . get ( `/reserves/${ reserveId }` , { params : { isHalfWidth : isHalfWidth , } , } ) ; return result . data ; } param option return public async gets ( option ) { const result = await this . repository . get ( '/reserves' , { params : option , } ) ; return result . data ; } param option return public async getLists ( option ) { const result = await this . repository . get ( '/reserves/lists' , { params : option , } ) ; return result . data ; } return public async getCnts ( ) { const result = await this . repository . get ( '/reserves/cnts' ) ; return result . data ; } param reserveId return public async cancel ( reserveId ) { await this . repository . delete ( `/reserves/${ reserveId }` ) ; } param reserveId return public async removeSkip ( reserveId ) { await this . repository . delete ( `/reserves/${ reserveId }/skip` ) ; } param reserveId return public async removeOverlap ( reserveId ) { await this . repository . delete ( `/reserves/${ reserveId }/overlap` ) ; } return public async updateAll ( ) { await this . repository . post ( '/reserves/update' ) ; } }