import { inject , injectable } from 'inversify' ; import * as apid from '../../../../../api' ; import IRepositoryModel from '../IRepositoryModel' ; import IScheduleApiModel from './IScheduleApiModel' ; @ injectable ( ) export default class ScheduleApiModel implements IScheduleApiModel { private repository : IRepositoryModel ; constructor ( @ inject ( 'IRepositoryModel' ) repository ) { this . repository = repository ; } param programId param isHalfWidth return public async getSchedule ( programId , isHalfWidth ) { const result = await this . repository . get ( `/schedules/detail/${ programId . toString ( 10 ) }` , { params : { isHalfWidth : isHalfWidth , } , } ) ; return result . data ; } param option return public async getSchedules ( option ) { const result = await this . repository . get ( '/schedules' , { params : option , } ) ; return result . data ; } param option return public async getChannelSchedule ( option ) { const result = await this . repository . get ( `/schedules/${ option . channelId }` , { params : { startAt : option . startAt , days : option . days , isHalfWidth : option . isHalfWidth , } , } ) ; return result . data ; } param option return public async getScheduleSearch ( option ) { const result = await this . repository . post ( '/schedules/search' , option ) ; return result . data ; } param option return public async getScheduleOnAir ( option ) { const result = await this . repository . get ( '/schedules/broadcasting' , { params : option , } ) ; return result . data ; } }