From 0ca900191da0c9dfd620c998ea63f146f0420cd4 Mon Sep 17 00:00:00 2001 From: Merijn Hendriks Date: Tue, 28 Dec 2021 15:28:43 +0100 Subject: [PATCH] Rename response to model --- src/server/Haru.Eft.Models.ts | 22 +++++++++++----------- src/server/Haru.Eft.Services.ts | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/server/Haru.Eft.Models.ts b/src/server/Haru.Eft.Models.ts index 0371006..75639d9 100644 --- a/src/server/Haru.Eft.Models.ts +++ b/src/server/Haru.Eft.Models.ts @@ -12,7 +12,7 @@ export class ResponseBody } } -export class LogoutResponse +export class LogoutModel { public status: string; @@ -22,7 +22,7 @@ export class LogoutResponse } } -export class KeepAliveResponse +export class KeepAliveModel { public msg: string; public utc_time: number; @@ -37,7 +37,7 @@ export class KeepAliveResponse } } -export class ServerInfo +export class ServerModel { public ip: string; public port: number; @@ -49,7 +49,7 @@ export class ServerInfo } } -export class PingNotification +export class PingNotificationModel { public type: string; public eventId: string; @@ -62,7 +62,7 @@ export class PingNotification } // todo: implement this -export class CheckVersionResponse +export class CheckVersionModel { public isValid: boolean; public latestVersion: string; @@ -74,7 +74,7 @@ export class CheckVersionResponse } } -export class MiniInfo +export class MiniInfoModel { public Nickname: string; public Side: string; @@ -90,21 +90,21 @@ export class MiniInfo } } -export class MiniProfile +export class MiniProfileModel { public _id: string; - public Info: MiniInfo; + public Info: MiniInfoModel; - public constructor(id: string, info: MiniInfo) + public constructor(id: string, info: MiniInfoModel) { this._id = id; this.Info = info; } } -export class FriendList +export class FriendListModel { - public Friends: MiniProfile[]; + public Friends: MiniProfileModel[]; public Ignore: string[]; public InIgnoreList: string[]; diff --git a/src/server/Haru.Eft.Services.ts b/src/server/Haru.Eft.Services.ts index 9f0a0bf..430baee 100644 --- a/src/server/Haru.Eft.Services.ts +++ b/src/server/Haru.Eft.Services.ts @@ -1,7 +1,7 @@ import { IncomingMessage, ServerResponse } from "http"; import { Service } from "../common/Haru.Http"; import { Json } from "../common/Haru.Utils"; -import { CheckVersionResponse, FriendList, KeepAliveResponse, LogoutResponse, ResponseBody, ServerInfo } from "./Haru.Eft.Models"; +import { CheckVersionModel, FriendListModel, KeepAliveModel, LogoutModel, ResponseBody, ServerModel } from "./Haru.Eft.Models"; export class FileResponseHelper { @@ -42,29 +42,29 @@ export class CachedResponseHelper private static getFriendList(): string { - const data = new FriendList(); - const body = new ResponseBody(data); + const data = new FriendListModel(); + const body = new ResponseBody(data); return Json.serialize(body); } private static getGameCheckVersion(): string { - const data = new CheckVersionResponse(); - const body = new ResponseBody(data); + const data = new CheckVersionModel(); + const body = new ResponseBody(data); return Json.serialize(body); } private static getGameLogout(): string { - const data = new LogoutResponse(); - const body = new ResponseBody(data); + const data = new LogoutModel(); + const body = new ResponseBody(data); return Json.serialize(body); } private static getKeepAlive(): string { - const data = new KeepAliveResponse(); - const body = new ResponseBody(data); + const data = new KeepAliveModel(); + const body = new ResponseBody(data); return Json.serialize(body); } @@ -75,8 +75,8 @@ export class CachedResponseHelper private static getServerList(): string { - const data = [ new ServerInfo() ]; - const body = new ResponseBody(data); + const data = [ new ServerModel() ]; + const body = new ResponseBody(data); return Json.serialize(body); } }