126 lines
2.6 KiB
TypeScript
126 lines
2.6 KiB
TypeScript
import request from '@/utils/request';
|
||
import { AxiosPromise } from 'axios';
|
||
import { HouseRentalVO, HouseRentalForm, HouseRentalQuery, HouseRentalSigningVO } from '@/api/system/houseRental/type';
|
||
|
||
/**
|
||
* 查询房屋租赁管理列表
|
||
* @param query
|
||
* @returns {*}
|
||
*/
|
||
|
||
export const listHouseRental = (query?: HouseRentalQuery): AxiosPromise<HouseRentalVO[]> => {
|
||
return request({
|
||
url: '/houseRental/list',
|
||
method: 'get',
|
||
params: query
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 查询房屋租赁管理详细
|
||
* @param id
|
||
*/
|
||
export const getHouseRental = (id: string | number): AxiosPromise<HouseRentalVO> => {
|
||
return request({
|
||
url: '/houseRental/' + id,
|
||
method: 'get'
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 新增房屋租赁管理
|
||
* @param data
|
||
*/
|
||
export const addHouseRental = (data: HouseRentalForm) => {
|
||
return request({
|
||
url: '/houseRental',
|
||
method: 'post',
|
||
data: data
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 修改房屋租赁管理
|
||
* @param data
|
||
*/
|
||
export const updateHouseRental = (data: HouseRentalForm) => {
|
||
return request({
|
||
url: '/houseRental',
|
||
method: 'put',
|
||
data: data
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 删除房屋租赁管理
|
||
* @param id
|
||
*/
|
||
export const delHouseRental = (id: string | number | Array<string | number>) => {
|
||
return request({
|
||
url: '/houseRental/' + id,
|
||
method: 'delete'
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 上传房屋图片
|
||
* @param id
|
||
*/
|
||
interface uploadHouseImagetype {
|
||
'success': {
|
||
'url': 'string';
|
||
'fileName': 'string';
|
||
'ossId': 'string';
|
||
}[];
|
||
'error': string[];
|
||
}
|
||
export const uploadHouseImage = (formData: FormData): AxiosPromise<uploadHouseImagetype> => {
|
||
return request({
|
||
url: '/houseRental/uploadImages',
|
||
method: 'POST',
|
||
data: formData
|
||
});
|
||
};
|
||
export const getHouseOwnUser = (houseId: string): AxiosPromise<uploadHouseImagetype> => {
|
||
return request({
|
||
url: `/houseRental/ownerName/${houseId}`,
|
||
method: 'GET'
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 房屋租赁管理 改变状态 0:下架 1:上架
|
||
* @param houseId
|
||
* */
|
||
export const changeHouseRedientStatus = (houseId: string): AxiosPromise<uploadHouseImagetype> => {
|
||
return request({
|
||
url: `/houseRental/changeStatus/${houseId}`,
|
||
method: 'PUT'
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 房屋租赁管理 签约
|
||
* @param data
|
||
*/
|
||
export const HouseRedientSign = (data: HouseRentalSigningVO): AxiosPromise<uploadHouseImagetype> => {
|
||
return request({
|
||
url: `/houseRental/sign`,
|
||
method: 'POST',
|
||
data: data
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 房屋租赁管理 签约上传
|
||
* @param url
|
||
* @param data
|
||
*/
|
||
export const HouseRedientSignUpload = (url: string, data: FormData) => {
|
||
return request({
|
||
url: url,
|
||
method: 'POST',
|
||
data: data
|
||
});
|
||
};
|