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

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

/**
 * 获取Danger分页
 * @param data
 * @returns
 */
export function getDangerByPage(data) {
  return request({
    url: '/danger/page',
    method: 'GET',
    params: 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
  })
}
