From a22f339a17912f89f17552f480f25107d932d529 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 28 Dec 2019 14:06:32 +0100 Subject: [PATCH] Return dummy background image & likes count --- src/controllers/UserController.ts | 5 ++++- src/helpers/BackgroundImageHelper.ts | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/helpers/BackgroundImageHelper.ts diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index b0544f5..532fe0c 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -2,6 +2,8 @@ import { RequestHandler } from "../entities/RequestHandler"; import { UserHelper } from "../helpers/UserHelper"; import { User, UserPageStatus } from "../entities/User"; import { AccountImage, AccountImageVisibilityLevel } from "../entities/AccountImage"; +import { BackgroundImageHelper } from "../helpers/BackgroundImageHelper"; +import { LikesHelper, LikesType } from "../helpers/LikesHelper"; /** * User information controller @@ -83,7 +85,8 @@ export class UserController { info["noCommentOnHisPage"] = user.blockComments; info["allowPostFromFriendOnHisPage"] = user.allowPostsFromFriends; info["account_creation_time"] = user.timeCreate; - + info["backgroundImage"] = BackgroundImageHelper.GetURL(user.id); + info["pageLikes"] = await LikesHelper.Count(user.id, LikesType.USER); } return info; diff --git a/src/helpers/BackgroundImageHelper.ts b/src/helpers/BackgroundImageHelper.ts new file mode 100644 index 0000000..8d4614f --- /dev/null +++ b/src/helpers/BackgroundImageHelper.ts @@ -0,0 +1,16 @@ +import { pathUserData } from "../utils/UserDataUtils"; + +/** + * Legacy background image helper + * + * @author Pierre HUBERT + */ + +export class BackgroundImageHelper { + + public static GetURL(userID: number) : string { + // Currently, it is not planned to integrate background image anymore + return pathUserData("imgfond/0.jpg"); + } + +} \ No newline at end of file