import request from '@/utils/request'

// 查询作品分页列表
export function pageWorks(query) {
    return request({
        url: '/vote/works/page',
        method: 'get',
        params: query
    })
}

// 查询作品详细
export function getWorks(worksIs) {
    return request({
        url: '/vote/works/' + worksIs,
        method: 'get'
    })
}

// 新增作品
export function addWorks(data) {
    return request({
        url: '/vote/works',
        method: 'post',
        data: data
    })
}

// 修改作品
export function updateWorks(data) {
    return request({
        url: '/vote/works',
        method: 'put',
        data: data
    })
}

// 逻辑删除作品
export function logicalDelWorks(worksIs) {
    return request({
        url: '/vote/works/abandon/' + worksIs,
        method: 'put'
    })
}

// 删除作品
export function delWorks(worksIs) {
    return request({
        url: '/vote/works/' + worksIs,
        method: 'delete'
    })
}
