import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { BuildingInfoVO, BuildingInfoForm, BuildingInfoQuery } from './model';

/**
 * 查询楼宇基础信息;列表
 * @param params
 * @returns
 */
export function buildingInfoList(params?: BuildingInfoQuery) {
  return defHttp.get<BuildingInfoVO[]>({ url: '/building/buildingInfo/list', params });
}

/**
 * 导出楼宇基础信息;列表
 * @param params
 * @returns
 */
export function buildingInfoExport(params?: BuildingInfoQuery) {
  return commonExport('/building/buildingInfo/export', params ?? {});
}

/**
 * 查询楼宇基础信息;详细
 * @param id id
 * @returns
 */
export function buildingInfoInfo(id: ID) {
  return defHttp.get<BuildingInfoVO>({ url: '/building/buildingInfo/' + id });
}

/**
 * 新增楼宇基础信息;
 * @param data
 * @returns
 */
export function buildingInfoAdd(data: BuildingInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/building/buildingInfo', data });
}

/**
 * 更新楼宇基础信息;
 * @param data
 * @returns
 */
export function buildingInfoUpdate(data: BuildingInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/building/buildingInfo', data });
}

/**
 * 删除楼宇基础信息;
 * @param id id
 * @returns
 */
export function buildingInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/building/buildingInfo/' + id });
}
