import request from '@/utils/request'

export function addCategory(data) {
    return request({
        url: '/tts/corpus/category',
        method: 'post',
        data: data
    })
}

export function getCategoryTreeApi() {
    return request({
        url: '/tts/corpus/category/tree',
        method: 'get'
    })
}
    
export function updateCategoryTreeApi(data) {
    return request({
        url: '/tts/corpus/category',
        method: 'put',
        data: data
    })
}

export function deleteCategory(id) {
    return request({
        url: `/tts/corpus/category/${id}`,
        method: 'delete',
    })
}

export function getCorpusListApi(params) {
    return request({
        url: '/tts/corpus/list',
        method: 'get',
        params: params
    })
}

export function getDashboardApi() {
    return request({
        url: '/tts/corpus/dashboard/stats',
        method: 'get'
    })
}