import { defHttp } from '/@/utils/http/axios';
import { PageParams, RentListGetResultModel, DeleteParams } from './model';

enum Api {
  selectHouseByType = '/zfb-api/zfb/house/selectHouseByType',
  deleteHouse = '/zfb-api/zfb/house/deleteHouse',
}

/**
 * @description: Get sample list value
 */

export const rentListApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.selectHouseByType,
    params: {
      type: 1,
      ...params,
    },
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const sellListApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.selectHouseByType,
    params: {
      type: 2,
      ...params,
    },
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const decorationListApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.selectHouseByType,
    params: {
      type: 0,
      ...params,
    },
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const commonDeleteApi = (params: DeleteParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.deleteHouse,
    params: {
      type: 0,
      ...params,
    },
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
