import { only_last_id } from '../only-last'
import { get, type PageResponse } from '../request'
import { BasicService } from './basic'

type FindParams = {
  current: any
  size: any
  grasp: any
  userId: any
  startTime: any
  endTime: any
}

class WordTableService extends BasicService<any> {
  async findStage(
    data: FindParams & {
      vocabularyId: any
    },
  ) {
    return await get<PageResponse<any>>('/wordTable/wordTableStage', data, {
      [only_last_id]: 'word-table-list',
    })
  }

  async findBook(
    data: FindParams & {
      textbookId: any
    },
  ) {
    return await get<PageResponse<any>>('/wordTable/wordTableTextbook', data, {
      [only_last_id]: 'word-table-list',
    })
  }

  protected saveOrUpdateUrl(): string {
    throw new Error('Method not implemented.')
  }

  protected removeUrl(): string {
    throw new Error('Method not implemented.')
  }

  protected findPageUrl(): string {
    throw new Error('Method not implemented.')
  }
}

export const wordTableService = new WordTableService()
