From c89cac38f8a756330a69acbea787eb34fab950f1 Mon Sep 17 00:00:00 2001 From: JianMiau Date: Wed, 6 Mar 2024 17:28:02 +0800 Subject: [PATCH] =?UTF-8?q?[add]=20=E6=96=B0=E5=A2=9ELine=E7=99=BB?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account/PtlLogin.ts | 6 +++-- define/interface.ts | 7 +++++ room/MsgGoToGame.ts | 4 ++- serviceProto.ts | 62 +++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 define/interface.ts diff --git a/account/PtlLogin.ts b/account/PtlLogin.ts index 7ef6516..abd16e5 100644 --- a/account/PtlLogin.ts +++ b/account/PtlLogin.ts @@ -1,5 +1,7 @@ +import { ILiffData } from "../define/interface"; + export interface ReqLogin { - name: string + token: string } -export type ResLogin = number \ No newline at end of file +export type ResLogin = ILiffData \ No newline at end of file diff --git a/define/interface.ts b/define/interface.ts new file mode 100644 index 0000000..277b1b4 --- /dev/null +++ b/define/interface.ts @@ -0,0 +1,7 @@ +// Liff資料 +export interface ILiffData { + userId: string; + displayName: string; + statusMessage: string; + pictureUrl: string; +} \ No newline at end of file diff --git a/room/MsgGoToGame.ts b/room/MsgGoToGame.ts index 931bc7f..83b2096 100644 --- a/room/MsgGoToGame.ts +++ b/room/MsgGoToGame.ts @@ -1 +1,3 @@ -export type MsgGoToGame = number \ No newline at end of file +import { ILiffData } from "../define/interface"; + +export type MsgGoToGame = [number, [ILiffData, ILiffData]] \ No newline at end of file diff --git a/serviceProto.ts b/serviceProto.ts index ac33819..3bbebf4 100644 --- a/serviceProto.ts +++ b/serviceProto.ts @@ -51,7 +51,7 @@ export interface ServiceType { } export const serviceProto: ServiceProto = { - "version": 3, + "version": 6, "services": [ { "id": 0, @@ -114,8 +114,8 @@ export const serviceProto: ServiceProto = { "type": "Interface", "properties": [ { - "id": 0, - "name": "name", + "id": 1, + "name": "token", "type": { "type": "String" } @@ -123,7 +123,41 @@ export const serviceProto: ServiceProto = { ] }, "account/PtlLogin/ResLogin": { - "type": "Number" + "type": "Reference", + "target": "define/interface/ILiffData" + }, + "define/interface/ILiffData": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "userId", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "displayName", + "type": { + "type": "String" + } + }, + { + "id": 2, + "name": "statusMessage", + "type": { + "type": "String" + } + }, + { + "id": 3, + "name": "pictureUrl", + "type": { + "type": "String" + } + } + ] }, "MsgChat/MsgChat": { "type": "Interface", @@ -154,7 +188,25 @@ export const serviceProto: ServiceProto = { "type": "Number" }, "room/MsgGoToGame/MsgGoToGame": { - "type": "Number" + "type": "Tuple", + "elementTypes": [ + { + "type": "Number" + }, + { + "type": "Tuple", + "elementTypes": [ + { + "type": "Reference", + "target": "define/interface/ILiffData" + }, + { + "type": "Reference", + "target": "define/interface/ILiffData" + } + ] + } + ] }, "room/PtlChangeState/ReqChangeState": { "type": "Interface",