import request from '@/utils/request'

// 查询推送系统消息列表
export function listSysPush(query) {
  return request({
    url: '/cai/sysPush/list',
    method: 'get',
    params: query
  })
}

// 查询推送系统消息详细
export function getSysPush(id) {
  return request({
    url: '/cai/sysPush/' + id,
    method: 'get'
  })
}

// 新增推送系统消息
export function addSysPush(data) {
  return request({
    url: '/cai/sysPush',
    method: 'post',
    data: data
  })
}

// 修改推送系统消息
export function updateSysPush(data) {
  return request({
    url: '/cai/sysPush',
    method: 'put',
    data: data
  })
}

// 删除推送系统消息
export function delSysPush(id) {
  return request({
    url: '/cai/sysPush/' + id,
    method: 'delete'
  })
}

export function runSysPush(id) {
  return request({
    url: '/cai/sysPush/run',
    method: 'post',
    data: {
      id
    }
  })
}

export function closeSysPush(id) {
  return request({
    url: '/cai/sysPush/close',
    method: 'post',
    data: {
      id
    }
  })
}
