import {request} from '@/libs/request.js'

/**
 * 获取Danger列表
 * @param data
 * @returns
 */
export function getDangerByList(data) {
  return request({
    url: '/danger',
    method: 'GET',
    data
  })
}

/**
 * 获取Danger列表
 * @param data
 * @returns
 */
export function getRecentDangerByList(data) {
  return request({
    url: '/danger/recent',
    method: 'GET',
    data
  })
}

/**
 * 查询待处理Danger列表
 * @param data
 * @returns
 */
export function getDangerWaitingByList(data) {
  return request({
    url: '/danger/waiting',
    method: 'GET',
    data
  })
}

/**
 * 获取Danger分页
 * @param data
 * @returns
 */
export function getDangerByPage(data) {
  return request({
    url: '/danger/page',
    method: 'GET',
    data
  })
}

/**
 * 根据Id获取Danger
 * @param dangerId
 * @returns
 */
export function getDangerById(dangerId) {
  return request({
    url: `/danger/${dangerId}`,
    method: 'GET'
  })
}

/**
 * 删除Danger
 * @param dangerId
 * @returns
 */
export function deleteDangerById(dangerId) {
  return request({
    url: `/danger/${dangerId}`,
    method: 'DELETE'
  })
}

/**
 * 处理Danger
 * @param data
 * @returns
 */
export function handleDanger(data) {
  return request({
    url: `/danger/handle`,
    method: 'POST',
    data
  })
}
