import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { ProjectInfoVO, ProjectInfoForm, ProjectInfoQuery } from './model';

/**
 * 查询项目基础信息;列表
 * @param params
 * @returns
 */
export function projectInfoList(params?: ProjectInfoQuery) {
  return defHttp.get<ProjectInfoVO[]>({ url: '/project/projectInfo/list', params });
}

/**
 * 导出项目基础信息;列表
 * @param params
 * @returns
 */
export function projectInfoExport(params?: ProjectInfoQuery) {
  return commonExport('/project/projectInfo/export', params ?? {});
}

/**
 * 查询项目基础信息;详细
 * @param id id
 * @returns
 */
export function projectInfoInfo(id: ID) {
  return defHttp.get<ProjectInfoVO>({ url: '/project/projectInfo/' + id });
}

/**
 * 新增项目基础信息;
 * @param data
 * @returns
 */
export function projectInfoAdd(data: ProjectInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/project/projectInfo', data });
}

/**
 * 更新项目基础信息;
 * @param data
 * @returns
 */
export function projectInfoUpdate(data: ProjectInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/project/projectInfo', data });
}

/**
 * 删除项目基础信息;
 * @param id id
 * @returns
 */
export function projectInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/project/projectInfo/' + id });
}
