import request from '@/utils/request'

// 查询电价合同列表
export function listContract(query) {
    return request({
        url: '/iot/contract/list',
        method: 'get',
        params: query
    })
}

// 查询电价合同详细
export function getContract(contractId) {
    return request({
        url: '/iot/contract/' + contractId,
        method: 'get'
    })
}

// 新增电价合同
export function addContract(data) {
    return request({
        url: '/iot/contract',
        method: 'post',
        data: data
    })
}

// 修改电价合同
export function updateContract(data) {
    return request({
        url: '/iot/contract',
        method: 'put',
        data: data
    })
}

// 删除电价合同
export function delContract(contractId) {
    return request({
        url: '/iot/contract/' + contractId,
        method: 'delete'
    })
}

// 导出电价合同
export function exportContract(query) {
    return request({
        url: '/iot/contract/export',
        method: 'get',
        params: query
    })
}
