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

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

	/** 查询所有启用的房间类型（下拉框用） */
	all() {
		return httpRequest({
			url: prefix + "/roomType/all",
			method: "get",
		});
	}

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

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

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

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