
import baseAxios from '../index'

export default class LiveService {
  static instance: LiveService
  static getInstance() {
    if (!LiveService.instance) {
      LiveService.instance = new LiveService()
    }
    return LiveService.instance
  }

  /**
   * 开启直播
   * @returns 
   */
  startLive() {
    return baseAxios<{data: any}>({
      url: '/staff/enable_live',
      method: 'get'
    })
  }

  updateLive(data: {
    day_type: number,
    time_section: string,
    uuid: string
  }) {
    return baseAxios<{data: any}>({
      url: '/staff/live_broad',
      method: 'put',
      data
    })
  }

  addLive() {
    return baseAxios<{data: any}>({
      url: '/staff/live_broad/add',
      method: 'get'
    })
  }


  liveList() {
    return baseAxios<{data: any}>({
      url: '/staff/live_broad/list',
      method: 'get'
    })
  }

  delLive(uuid: string) {
    return baseAxios<{data: any}>({
      url: '/staff/live_broad/' + uuid,
      method: 'delete'
    })
  }


}
