room.py 855 B

12345678910111213141516171819202122232425262728
  1. from api.riil.utils import call_api
  2. class RoomApi:
  3. def get_element_by_room_id(self, room_id, open_client="RIIL"):
  4. """
  5. 获取机房下的元素。
  6. :param room_id: 机房ID
  7. :param open_client: 客户端标识,默认为"RIIL"
  8. :return: 机房元素数据的JSON响应
  9. """
  10. endpoint = f"/room/getElement/{room_id}"
  11. params = {"_openCLIENT": open_client}
  12. return call_api(endpoint, method="POST", params=params)
  13. def get_all_room(self, open_client="RIIL"):
  14. """
  15. 获取所有机房的列表。
  16. :param open_client: 客户端标识,默认为"RIIL"
  17. :return: 机房列表数据的JSON响应
  18. """
  19. endpoint = "/room/getRoom"
  20. params = {"_openCLIENT": open_client}
  21. return call_api(endpoint, method="POST", params=params)