import http from './index.js';

// 分页查询房源信息
export const pageHouseInfo = (params) => http.get('/house/house-info/page', {params})

// 查询全部房源信息
export const listHouseInfo = (params) => http.get('/house/house-info', {params})

// 查询房源信息(当期登录用户)
export const getHouseInfo = (userId) => http.get('/house/house-info/' + userId)

// 查询会员资料
export const getUserDetail = (userId) => http.get('/house/house-info/detail/' + userId)

// 新增房源信息
export const addHouseInfo = (data) => http.post('/house/house-info', data)

// 编辑房源信息
export const updateHouseInfo = (data) => http.put('/house/house-info', data)

// 删除房源信息
export const removeHouseInfo = (id) => http.delete('/house/house-info/' + id)

// 生成海报
export const getGeneratePoster = (id) => http.get('/house/house-info/generatePoster/' + id)


// 收藏房源
export const likeHouse = (data) => http.post('/house/house-like-log', data)
export const getLikeHouseList = () => http.get('/house/house-like-log')
export const getViewsHouseList = () => http.get('/house/house-views-log')

export default {
	pageHouseInfo,
	listHouseInfo,
	getHouseInfo,
	getUserDetail,
	updateHouseInfo,
	removeHouseInfo,
	addHouseInfo,
	likeHouse,
	getLikeHouseList,
	getViewsHouseList,
	getGeneratePoster
}
