import request from '@/config/axios'

export interface PadLockVO {
  lockId?: number
  lockCode: string
  lockName: string
  enableFlag?: string
  remark?: string
  createBy?: string
  createTime?: Date
  updateBy?: string
  updateTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  lockCode?: string
  lockName?: string
  enableFlag?: string
}

// 查询挂锁-列表
export const listPadLockAPI = async (params: PageParam) => {
  return await request.get({ url: '/iscs/lock/getLockPage', params })
}

// 获取挂锁详细信息
export const getPadLockInfoAPI = async (id: number) => {
  return await request.get({
    url: '/iscs/lock/selectLockById',
    params: { id }
  })
}

// 新增挂锁
export const addPadLockAPI = async (data: PadLockVO) => {
  return await request.post({ url: '/iscs/lock/insertLock', data })
}

// 修改挂锁信息
export const updatePadLockAPI = async (data: PadLockVO) => {
  return await request.put({ url: '/iscs/lock/updateLock', data })
}

// 删除挂锁信息
export const delPadLockAPI = async (ids: number) => {
  return await request.delete({
    url: '/iscs/lock/deleteLockList?ids='+ids,

  })
}
