import type { PoliceCapacityVO, PoliceCapacityForm, PoliceCapacityQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询警种能力列表
* @param params
* @returns 警种能力列表
*/
export function policeCapacityList(params?: PoliceCapacityQuery) {
  return requestClient.get<PageResult<PoliceCapacityVO>>('/biz/policeCapacity/list', { params });
}

/**
 * 导出警种能力列表
 * @param params
 * @returns 警种能力列表
 */
export function policeCapacityExport(params?: PoliceCapacityQuery) {
  return commonExport('/biz/policeCapacity/export', params ?? {});
}

/**
 * 查询警种能力详情
 * @param id id
 * @returns 警种能力详情
 */
export function policeCapacityInfo(id: ID) {
  return requestClient.get<PoliceCapacityVO>(`/biz/policeCapacity/${id}`);
}

/**
 * 新增警种能力
 * @param data
 * @returns void
 */
export function policeCapacityAdd(data: PoliceCapacityForm) {
  return requestClient.postWithMsg<void>('/biz/policeCapacity', data);
}

/**
 * 更新警种能力
 * @param data
 * @returns void
 */
export function policeCapacityUpdate(data: PoliceCapacityForm) {
  return requestClient.putWithMsg<void>('/biz/policeCapacity', data);
}

/**
 * 删除警种能力
 * @param id id
 * @returns void
 */
export function policeCapacityRemove(id: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/biz/policeCapacity/${id}`);
}
