feat: Global/GetMap, Global/GetCachedMap 추가

-  지도를 가져오는 코드
- GetCahcedMap에서는 600초 단위 캐싱
  - history 필드에 최근 10건 표시
This commit is contained in:
2022-04-21 01:24:07 +09:00
parent e856cde36d
commit 6d4fff970f
4 changed files with 144 additions and 3 deletions
+4 -2
View File
@@ -13,7 +13,7 @@ import type { SetBlockWarResponse, GeneralListResponse as NationGeneralListRespo
import type { UploadImageResponse } from "./defs/API/Misc";
import type { JoinArgs } from "./defs/API/General";
import type { GetConstResponse, GetCurrentHistoryResponse, GetHistoryResponse } from "./defs/API/Global";
import type { GeneralListResponse } from "./defs";
import type { CachedMapResult, GeneralListResponse, MapResult } from "./defs";
const apiRealPath = {
Betting: {
@@ -57,7 +57,9 @@ const apiRealPath = {
NumVar('year',
NumVar('month', GET as APICallT<undefined, GetHistoryResponse>
))),
GetCurrentHistory: GET as APICallT<undefined, GetCurrentHistoryResponse>
GetCurrentHistory: GET as APICallT<undefined, GetCurrentHistoryResponse>,
GetMap: GET as APICallT<undefined, MapResult>,
GetCachedMap: GET as APICallT<undefined, CachedMapResult>,
},
InheritAction: {
BuyHiddenBuff: PUT as APICallT<{
+2 -1
View File
@@ -244,12 +244,13 @@ export type MapResult = {
shownByGeneralList: number[],
myCity?: number,
myNation?: number,
}
export type CachedMapResult = MapResult & {
theme?: string,
history?: string[],
}
export type SimpleNationObj = {
capital: number,
cities: string[],