import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/ncjtEntranceGuard/getDevicePageList',
    method: 'get',
    params: query
  })
}

export function fetchGroupIdList(data) {
  return request({
    url: '/ncjtEntranceGuard/getGroupList',
    method: 'post',
    data
  })
}

export function createDevice(data) {
  return request({
    url: '/ncjtEntranceGuard/addDeviceWithGroupId',
    method: 'post',
    data
  })
}

export function updateDevice(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}

export function fetchDevice(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}
