import request from '@/config/axios'

export interface LockCabinetVO {
  cabinetId?: number
  cabinetCode: string
  cabinetName: string
  enableFlag?: string
  remark?: string
  createBy?: string
  createTime?: Date
  updateBy?: string
  updateTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  cabinetCode?: string
  cabinetName?: string
  enableFlag?: string
}

// 查询锁控机柜-列表
export const getIsLockCabinetPage = async (params: PageParam) => {
  return await request.get({ url: '/iscs/lock-cabinet/getLockCabinetPage', params })
}

// 获取锁控机柜详细信息
export const selectIsLockCabinetById = async (id: number) => {
  return await request.get({
    url: '/iscs/lock-cabinet/selectLockCabinetById',
    params: { id }
  })
}

// 新增锁控机柜
export const insertIsLockCabinet = async (data: LockCabinetVO) => {
  return await request.post({ url: '/iscs/lock-cabinet/insertLockCabinet', data })
}

// 修改锁控机柜信息
export const updateIsLockCabinet = async (data: LockCabinetVO) => {
  return await request.put({ url: '/iscs/lock-cabinet/updateLockCabinet', data })
}

// 删除锁控机柜信息
export const deleteIsLockCabinetByCabinetIds = async (ids: number) => {
  return await request.delete({
    url: '/iscs/lock-cabinet/deleteLockCabinetList?ids='+ids,

  })
}
