import request from '@/utils/request'

export function getRunTaskList(params) {
    return request({
        url: '/inspection/taskInstance/list', 
        method: 'get',
        params: params
    })
}

export function getRunTaskDetail(id) {
    return request({
        url: `/inspection/taskInstance/${id}`, 
        method: 'get'
    })
}

export function addRunTask(data) {
    return request({
        url: '/inspection/taskInstance',
        method: 'post',
        data: data
    })
}

export function updateRunTask(data) {
    return request({
        url: '/inspection/taskInstance',
        method: 'put',
        data: data
    })
}

export function deleteRunTask(id) {
    return request({
        url: `/inspection/taskInstance/${id}`,
        method: 'delete'
    })
}

export function startRunTask(id) {
    return request({
        url: `/inspection/taskInstance/start/${id}`,
        method: 'put'
    })
}

export function stopRunTask(id) {
    return request({
        url: `/inspection/taskInstance/stop/${id}`,
        method: 'put'
    })
}

export function pauseRunTask(id) {
    return request({
        url: `/inspection/taskInstance/pause/${id}`,
        method: 'put'
    })
}

export function resumeRunTask(id) {
    return request({
        url: `/inspection/taskInstance/resume/${id}`,
        method: 'put'
    })
}

export function getTaskLogListApi(params) {
    return request({
        url: '/inspection/taskLog/list', 
        method: 'get',
        params: params
    })
}