import type { PageResponse } from '#/api/http'

import { get } from '#/api/http'

import { BasicService } from '../basic'

class TextbookService extends BasicService {
  async list(stageId: any, subjectId: any) {
    const data = await get<PageResponse<any>>(`/subjectTextBookVersion/list`, {
      size: -1,
      resource: 0,
      subjectId,
      stageId,
    })
    return data.rows
  }

  async listChapters(textBookId: any) {
    return await get('/subjectChapter/tree', { textBookId })
  }

  protected findPageUrl(): string {
    return '/mjtextbook/list'
  }

  protected removeUrl(): string {
    return ''
  }

  protected saveOrUpdateUrl(): string {
    return ''
  }
}

export const textbookService = new TextbookService()
