import {request} from '@/utils/request.js'
/**
 * 列表查询
 * @returns
 */
export function getRiskPointByList(data) {
  return request({
    url: '/riskPoint',
    method: 'GET',
    params: data
  })
}

/**
 * 分页查询
 * @returns
 */
export function getRiskPointByPage(data) {
  return request({
    url: '/riskPoint/page',
    method: 'GET',
    params: data
  })
}

/**
 * 基于ID查询
 * @returns
 */
export function getRiskPointById(riskPointId) {
  return request({
    url: `/riskPoint/${riskPointId}`,
    method: 'GET'
  })
}

/**
 * 添加风险单元
 * @param data
 * @returns
 */
export function createRiskPoint(data) {
  return request({
    url: `/riskPoint/add`,
    method: 'POST',
    data
  })
}

/**
 * 修改风险单元
 * @param data
 * @returns
 */
export function updateRiskPoint(data) {
  return request({
    url: `/riskPoint/update`,
    method: 'PUT',
    data
  })
}

/**
 * 删除风险单元
 * @returns
 * @param riskPointId
 */
export function deleteRiskPointById(riskPointId) {
  return request({
    url: `/riskPoint/${riskPointId}`,
    method: 'DELETE'
  })
}

/**
 * 批量操作激活或未激活风险单元
 * @param data
 * @returns
 */
export function batchUpdateRiskPoint(data) {
  return request({
    url: `/riskPoint/batchUpdate`,
    method: 'post',
    data
  })
}

/**
 * 基于等级统计
 * @returns
 */
export function getRiskPointCounterByLevel(data) {
  return request({
    url: '/riskPoint/statis/getCounterByLevel',
    method: 'GET',
    params: data
  })
}
