import request from '@/config/axios'

export interface MapPointVO {
  id?: number
  mapId: number
  mapType: string
  entityId: number
  entityName?: string
  mapName?: string
  x: number
  y: number
  createTime?: Date
}

export interface PageParam {
  current: number
  size: number
  mapId?: number
}

// 查询地图点位数据列表
export const getIsMapPointPage = async (params: PageParam) => {
  return await request.get({ url: '/iscs/map-point/getMapPointPage', params })
}

// 查询地图点位数据详细
export const selectIsMapPointById = async (id: number) => {
  return await request.get({ url: '/iscs/map-point/selectMapPointById', params: { id } })
}

// 新增地图点位数据配置
export const insertIsMapPoint = async (data: MapPointVO) => {
  return await request.post({ url: '/iscs/map-point/insertMapPoint', data })
}

// 修改地图点位数据配置
export const updateIsMapPoint = async (data: MapPointVO) => {
  return await request.put({ url: '/iscs/map-point/updateMapPoint', data })
}

// 删除地图点位数据配置
export const deleteIsMapPointByIds = async (ids: number) => {
  return await request.delete({
    url: '/iscs/map-point/deleteMapPointList?ids='+ids,
  })
}

// 地图点位数据变更（绑定 位移 解绑）
export const updateMapPointList = async (data: MapPointVO[]) => {
  return await request.post({ url: '/iscs/map-point/updateMapPointList', data })
}
