import request from '@/utils/request'

// 查询规则分页列表
export function pageRule(query) {
    return request({
        url: '/vote/rule/page',
        method: 'get',
        params: query
    })
}

// 查询规则详细
export function getRule(ruleId) {
    return request({
        url: '/vote/rule/' + ruleId,
        method: 'get'
    })
}

// 新增规则
export function addRule(data) {
    return request({
        url: '/vote/rule',
        method: 'post',
        data: data
    })
}

// 修改规则
export function updateRule(data) {
    return request({
        url: '/vote/rule',
        method: 'put',
        data: data
    })
}

// 逻辑删除规则
export function logicalDelRule(ruleId) {
    return request({
        url: '/vote/rule/abandon/' + ruleId,
        method: 'put'
    })
}

// 删除规则
export function delRule(ruleId) {
    return request({
        url: '/vote/rule/' + ruleId,
        method: 'delete'
    })
}
