2026-05-29 19:54:56 +08:00

25 lines
505 B
GDScript

class_name InventoryApi
extends RefCounted
var _api_client: ApiClient
func _init(api_client: ApiClient = null) -> void:
_api_client = api_client
func set_api_client(api_client: ApiClient) -> void:
_api_client = api_client
func fetch_store_house(token: String) -> Dictionary:
if _api_client == null:
return {
"ok": false,
"offline": true,
"status": 0,
"body": {},
"text": "InventoryApi missing ApiClient."
}
return await _api_client.post_json("store-house", {"token": token})