import request from '@/utils/request'

const practiceApi = {
    get: 'practice/get',
    add: 'practice/add',
    del: 'practice/del',
    list: 'practice/list',
    collectionList: 'practice/collection/pageList', // 我的收藏列表
    recordList: 'practice/record/pageList', // 答题记录
    wrongList: 'practice/wrong/pageList', // 错题集
    startAnswer: 'practice/startAnswer', // 开始答题
    executeSubmit: 'practice/executeSubmit', // 练习交卷
}

export function practiceExecuteSubmit(data) {
    return request({
        url: practiceApi.executeSubmit,
        method: 'post',
        data: data
    })
}

export function practiceStartAnswer(params) {
    return request({
        url: practiceApi.startAnswer,
        method: 'post',
        params: params
    })
}

export function practiceCollectionPageList(params) {
    return request({
        url: practiceApi.collectionList,
        method: 'get',
        params: params
    })
}

export function practiceRecordPageList(params) {
    return request({
        url: practiceApi.recordList,
        method: 'get',
        params: params
    })
}

export function practiceWrongPageList(params) {
    return request({
        url: practiceApi.wrongList,
        method: 'get',
        params: params
    })
}

export function practiceAdd(params) {
    return request({
        url: practiceApi.add,
        method: 'post',
        data: params
    })
}
export function practiceGet(params) {
    return request({
        url: practiceApi.getDict,
        method: 'get',
        params: params
    })
}
export function practiceDel (params) {
  return request({
    url: practiceApi.del,
    method: 'delete',
    params: params
  })
}
export function practiceList(params) {
    return request({
        url: practiceApi.list,
        method: 'get',
        params: params
    })
}
