import request from '@/utils/request'

export function addTask(data) {
    return request({
        url: '/aima/task', 
        method: 'post',
        data: data
    })
}

export function getTaskList(params) {
    return request({
        url: '/aima/task/list', 
        method: 'get',
        params: params
    })
}

export function updateTask(data) {
    return request({
        url: '/aima/task', 
        method: 'put',
        data: data
    })
}

export function deleteTask(ids) {
    return request({
        url: `/aima/task/${ids}`, 
        method: 'delete'
    })
}

export function getTestCaseByTaskId(taskId) {
    return request({
        url: `/aima/task/testCases/${taskId}`,
        method: 'get',
    })
}

export function bindTastCase(taskId, ids) {
    return request({
        url: `/aima/task/bindTestCases/${taskId}`,
        method: 'post',
        data: ids
    })
}