12345678910111213141516171819202122232425262728 |
- from api.riil.utils import call_api
- class RoomApi:
- def get_element_by_room_id(self, room_id, open_client="RIIL"):
- """
- 获取机房下的元素。
- :param room_id: 机房ID
- :param open_client: 客户端标识,默认为"RIIL"
- :return: 机房元素数据的JSON响应
- """
- endpoint = f"/room/getElement/{room_id}"
- params = {"_openCLIENT": open_client}
- return call_api(endpoint, method="POST", params=params)
- def get_all_room(self, open_client="RIIL"):
- """
- 获取所有机房的列表。
- :param open_client: 客户端标识,默认为"RIIL"
- :return: 机房列表数据的JSON响应
- """
- endpoint = "/room/getRoom"
- params = {"_openCLIENT": open_client}
- return call_api(endpoint, method="POST", params=params)
|