import request from '@/config/axios'

export interface LockCabinetSlotVO {
  slotId?: number
  cabinetId?: number
  slotCode: string
  slotName: string
  enableFlag?: string
  remark?: string
  createBy?: string
  createTime?: Date
  updateBy?: string
  updateTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  slotCode?: string
  slotName?: string
  cabinetId?: number
  enableFlag?: string
}

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

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

// 新增锁控机柜-仓位
export const insertIsLockCabinetSlots = async (data: LockCabinetSlotVO) => {
  return await request.post({ url: '/iscs/lock-cabinet-slots/insertLockCabinetSlots', data })
}

// 修改锁控机柜-仓位信息
export const updateIsLockCabinetSlots = async (data: LockCabinetSlotVO) => {
  return await request.put({ url: '/iscs/lock-cabinet-slots/updateLockCabinetSlots', data })
}

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