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

/**
 * 分页查询Danger Category
 * @param data
 * @returns
 */
export function getDangerCatByPage(data) {
  return request({
    url: '/danger/cat/page',
    method: 'GET',
    params: data
  })
}

/**
 * 列表查询Danger Category
 * @returns
 */
export function getDangerCatByList() {
  return request({
    url: '/danger/cat',
    method: 'GET'
  })
}

/**
 * 基于Id查询Danger Category
 * @param dangerCatId
 * @returns
 */
export function getDangerCatById(dangerCatId) {
  return request({
    url: `/danger/cat/${dangerCatId}`,
    method: 'GET'
  })
}

/**
 * 添加Danger Category
 * @param data
 * @returns
 */
export function createDangerCat(data) {
  return request({
    url: `/danger/cat/add`,
    method: 'POST',
    data
  })
}

/**
 * 更新Danger Category
 * @param data
 * @returns
 */
export function updateDangerCat(data) {
  return request({
    url: `/danger/cat/update`,
    method: 'PUT',
    data
  })
}

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

