import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { HouseInfoVO, HouseInfoForm, HouseInfoQuery } from './model';

/**
 * 查询小区基础信息;列表
 * @param params
 * @returns
 */
export function houseInfoList(params?: HouseInfoQuery) {
  return defHttp.get<HouseInfoVO[]>({ url: '/house/houseInfo/list', params });
}

/**
 * 导出小区基础信息;列表
 * @param params
 * @returns
 */
export function houseInfoExport(params?: HouseInfoQuery) {
  return commonExport('/house/houseInfo/export', params ?? {});
}

/**
 * 查询小区基础信息;详细
 * @param id id
 * @returns
 */
export function houseInfoInfo(id: ID) {
  return defHttp.get<HouseInfoVO>({ url: '/house/houseInfo/' + id });
}

/**
 * 新增小区基础信息;
 * @param data
 * @returns
 */
export function houseInfoAdd(data: HouseInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/house/houseInfo', data });
}

/**
 * 更新小区基础信息;
 * @param data
 * @returns
 */
export function houseInfoUpdate(data: HouseInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/house/houseInfo', data });
}

/**
 * 删除小区基础信息;
 * @param id id
 * @returns
 */
export function houseInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/house/houseInfo/' + id });
}
