import 'package:isekai_wiki/api/base_api.dart'; import 'package:isekai_wiki/global.dart'; class RestbaseApi { static Uri getUri(String endpoint, {Map? search}) { String url = Global.siteConfig.restfulApiUrl; if (url.endsWith("/")) { url = url.substring(0, url.length - 1); } return Uri.parse(url + endpoint).replace(queryParameters: search); } static Future get(String path, {Map? search}) async { var uri = getUri(path, search: search); return BaseApi.get(uri); } static Future getJson(String path, {Map? search}) async { var uri = getUri(path, search: search); return BaseApi.getJson(uri); } }