import request from '@/utils/request'

// 查询学习培训项目信息列表
export function listTrainingItem(query) {
    return request({
        url: '/system/trainingItem/list',
        method: 'get',
        params: query
    })
}
export function listTrainingCategory(query) {
    return request({
        url: '/system/trainingCategory/list',
        method: 'get',
        params: query
    })
}
// 父级项目组
export function selectTrainingParent(query) {
    return request({
        url: '/system/trainingItem/selectTrainingParent',
        method: 'get',
        params: query
    })
}
// 修改上下架
export function updateTrainingShelfFlag(data) {
    return request({
        url: '/system/trainingItem/updateTrainingShelfFlag',
        method: 'post',
        data: data

    })
}

// 查询学习培训项目信息详细
export function getTrainingItem(id) {
    return request({
        url: '/system/trainingItem/' + id,
        method: 'get'
    })
}

// 新增学习培训项目信息
export function addTrainingItem(data) {
    return request({
        url: '/system/trainingItem/add',
        method: 'post',
        data: data
    })
}

// 修改学习培训项目信息
export function updateTrainingItem(data) {
    return request({
        url: '/system/trainingItem/edit',
        method: 'post',
        data: data
    })
}
// 下拉
export function selectSubordinateItem(trainingParentId) {
    return request({
        url: `/system/trainingItem/selectSubordinateItem?trainingParentId=${trainingParentId}`,
        method: 'get',
    })
}

// 删除学习培训项目信息
export function delTrainingItem(id) {
    return request({
        url: '/system/trainingItem/' + id,
        method: 'delete'
    })
}
