feat, refac: 최근 메시지 API
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import type { ValidResponse } from "@/util/callSammoAPI";
|
||||
|
||||
export type MsgType = "private" | "public" | "national" | "diplomacy";
|
||||
|
||||
export const minMsgSeq: Record<MsgType, number> = {
|
||||
private: 0x7fffffff,
|
||||
public: 0x7fffffff,
|
||||
national: 0x7fffffff,
|
||||
diplomacy: 0x7fffffff,
|
||||
};
|
||||
|
||||
export type MsgTarget = {
|
||||
id: number;
|
||||
name: string;
|
||||
nation_id: number; //XXX: 왜 이 값은 nationID가 아니고 nation_id인가?
|
||||
nation: string;
|
||||
color: string;
|
||||
icon: string;
|
||||
};
|
||||
|
||||
export type MsgItem = {
|
||||
id: number;
|
||||
msgType: MsgType;
|
||||
src: MsgTarget;
|
||||
dest?: MsgTarget;
|
||||
text: string;
|
||||
option: Record<string, string | number>;
|
||||
time: string;
|
||||
};
|
||||
|
||||
export type MsgPrintItem = MsgItem & {
|
||||
generalName: string;
|
||||
nationID: number;
|
||||
nationType: "local" | "src" | "dest";
|
||||
myGeneralID: number;
|
||||
allowButton: boolean;
|
||||
last5min: string;
|
||||
now: string;
|
||||
invalidType: "msg_invalid" | "msg_valid";
|
||||
deletable: boolean;
|
||||
src: MsgTarget & { colorType: "bright" | "dark" };
|
||||
dest: MsgTarget & { colorType: "bright" | "dark" };
|
||||
defaultIcon: string;
|
||||
};
|
||||
|
||||
export type MsgResponse = {
|
||||
[v in MsgType]: MsgItem[];
|
||||
} & {
|
||||
result: true;
|
||||
keepRecent: boolean;
|
||||
nationID: number;
|
||||
generalName: string;
|
||||
sequence: number;
|
||||
};
|
||||
Reference in New Issue
Block a user