mirror of https://github.com/hykilpikonna/AquaDX
[+] Maimai api endpoints
parent
ee958f20d2
commit
9478da81a9
|
@ -1,4 +1,5 @@
|
||||||
import {aqua_host} from "./config";
|
import {aqua_host} from "./config";
|
||||||
|
import type {TrendEntry} from "./generalTypes";
|
||||||
|
|
||||||
|
|
||||||
const multTable = [
|
const multTable = [
|
||||||
|
@ -29,3 +30,13 @@ export async function getMaimai(endpoint: string, params: any) {
|
||||||
body: JSON.stringify(params)
|
body: JSON.stringify(params)
|
||||||
}).then(res => res.json())
|
}).then(res => res.json())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getMaimaiApi(endpoint: string, params: any) {
|
||||||
|
let url = new URL(`${aqua_host}/api/game/maimai2new/${endpoint}`)
|
||||||
|
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]))
|
||||||
|
return await fetch(url).then(res => res.json())
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getMaimaiTrend(userId: number): Promise<TrendEntry[]> {
|
||||||
|
return await getMaimaiApi("trend", {userId})
|
||||||
|
}
|
Loading…
Reference in New Issue