import request from '@/config/axios'

export interface LockVO {
  locksetId?: number
  locksetCode: string
  locksetName: string
  enableFlag?: string
  remark?: string
  createBy?: string
  createTime?: Date
  updateBy?: string
  updateTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  locksetCode?: string
  locksetName?: string
  enableFlag?: string
}

// 查询锁具机构-列表
export const listLocksetAPI = async (params: PageParam) => {
  return await request.get({ url: '/iscs/lockset/getLocksetPage', params })
}

// 获取锁具机构详细信息
export const getLocksetInfoAPI = async (id: number) => {
  return await request.get({
    url: '/iscs/lockset/selectLocksetById',
    params: { id }
  })
}

// 新增锁具机构
export const addLocksetAPI = async (data: LockVO) => {
  return await request.post({ url: '/iscs/lockset/insertLockset', data })
}

// 修改锁具机构信息
export const updateLocksetAPI = async (data: LockVO) => {
  return await request.put({ url: '/iscs/lockset/updateLockset', data })
}

// 删除锁具机构信息
export const delLocksetAPI = async (ids: number) => {
  return await request.delete({
    url: '/iscs/lockset/deleteLocksetList?ids='+ids,

  })
}
