import request from '@/config/axios'

// 黑名单查询参数
export interface BlacklistQuery {
  current: number
  size: number
  userId?: string
  userName?: string
}

// 黑名单表单对象
export interface BlacklistVO {
  recordId?: number
  userId: string
  userName: string
  createTime?: Date
}

// 查询黑名单列表
export const listBlacklist = async (params: BlacklistQuery) => {
  return await request.get({ url: '/iscs/blacklist/getBlacklistPage', params })
}
// 查询黑名单详情
export const getBlacklistInfo = async (id: number) => {
  return await request.get({ url: '/iscs/blacklist/selectBlacklistById', params: { id: id } })
}

// 新增黑名单
export const addBlacklist = async (data: BlacklistVO) => {
  return await request.post({ url: '/iscs/blacklist/insertBlacklist', data })
}

// 修改黑名单
export const updateBlacklist = async (data: BlacklistVO) => {
  return await request.put({ url: '/iscs/blacklist/updateBlacklist', data })
}

// 删除黑名单
export const delBlacklist = async (ids: number) => {
  return await request.delete({
    url: '/iscs/blacklist/deleteBlacklistList?ids='+ids,

  })
}

// 查询白名单列表
export const listWhitelist = async (params: BlacklistQuery) => {
  return await request.get({ url: '/iscs/blacklist/getWhiteUserPage', params })
}
