import httpRequest from "@/utils/httpRequest";
import { HOTEL_ORDER_PATH as prefix } from "../AppPath";

export default class HotelRoomService {
	/** 分页查询房间列表 */
	page(params) {
		return httpRequest({
			url: prefix + "/room/list",
			method: "get",
			params,
		});
	}

	/** 查询房间详情 */
	queryById(id) {
		return httpRequest({
			url: prefix + "/room/queryById",
			method: "get",
			params: { id },
		});
	}

	/** 新增/编辑房间 */
	save(data) {
		return httpRequest({
			url: prefix + "/room/save",
			method: "post",
			data,
		});
	}

	/** 切换房间状态 */
	toggleStatus(id, status) {
		return httpRequest({
			url: prefix + "/room/toggleStatus",
			method: "post",
			params: { id, status },
		});
	}

	/** 补打二维码（内容不变） */
	reprintQr(id) {
		return httpRequest({
			url: prefix + "/room/reprintQr",
			method: "get",
			params: { id },
		});
	}

	/** 重新生成二维码（内容改变） */
	regenerateQr(id) {
		return httpRequest({
			url: prefix + "/room/regenerateQr",
			method: "post",
			params: { id },
		});
	}

	/** 删除房间 */
	delete(id) {
		return httpRequest({
			url: prefix + "/room/delete",
			method: "post",
			params: { id },
		});
	}

	/** 批量删除房间 */
	batchDelete(ids) {
		return httpRequest({
			url: prefix + "/room/batchDelete",
			method: "post",
			params: { ids },
		});
	}
}
