import request from '@/utils/request'

export function getDocumentByCode(query) {
  return request({
    url: '/weapp/document/info',
    method: 'get',
    params: query
  })
}


// 查询系统文档列表
export function listDocument(query) {
  return request({
    url: '/mapi/system/document/list',
    method: 'get',
    params: query
  })
}

// 查询系统文档详细
export function getDocument(id) {
  return request({
    url: '/mapi/system/document/' + id,
    method: 'get'
  })
}

// 新增系统文档
export function addDocument(data) {
  return request({
    url: '/mapi/system/document',
    method: 'post',
    data: data
  })
}

// 修改系统文档
export function updateDocument(data) {
  return request({
    url: '/mapi/system/document',
    method: 'put',
    data: data
  })
}

// 删除系统文档
export function delDocument(id) {
  return request({
    url: '/mapi/system/document/' + id,
    method: 'delete'
  })
}


// 修改系统文档状态
export function updateDocumentStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/system/document/updateStatus',
    method: 'post',
    data: data
  })
}
