import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { FunctionInfoVO, FunctionInfoForm, FunctionInfoQuery } from './model';

/**
 * 查询职能部门信息;列表
 * @param params
 * @returns
 */
export function functionInfoList(params?: FunctionInfoQuery) {
  return defHttp.get<FunctionInfoVO[]>({ url: '/function/functionInfo/list', params });
}

/**
 * 导出职能部门信息;列表
 * @param params
 * @returns
 */
export function functionInfoExport(params?: FunctionInfoQuery) {
  return commonExport('/function/functionInfo/export', params ?? {});
}

/**
 * 查询职能部门信息;详细
 * @param id id
 * @returns
 */
export function functionInfoInfo(id: ID) {
  return defHttp.get<FunctionInfoVO>({ url: '/function/functionInfo/' + id });
}

/**
 * 新增职能部门信息;
 * @param data
 * @returns
 */
export function functionInfoAdd(data: FunctionInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/function/functionInfo', data });
}

/**
 * 更新职能部门信息;
 * @param data
 * @returns
 */
export function functionInfoUpdate(data: FunctionInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/function/functionInfo', data });
}

/**
 * 删除职能部门信息;
 * @param id id
 * @returns
 */
export function functionInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/function/functionInfo/' + id });
}
