From f0a1d14b711e962fbf090bc9369b6babf5c507be Mon Sep 17 00:00:00 2001 From: Seokyung Lim Date: Wed, 22 Nov 2023 20:16:40 +0900 Subject: [PATCH] =?UTF-8?q?chore=20:=20=ED=8C=8C=EC=9D=BC=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=ED=95=A0=20=EA=B2=BD=EB=A1=9C=20=EC=A7=80=EC=A0=95?= =?UTF-8?q?=ED=95=B4=EC=A3=BC=EB=8A=94=20=ED=95=B8=EB=93=A4=EB=9F=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/constants.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/server/src/constants.ts b/server/src/constants.ts index f1361a5..48bfe21 100644 --- a/server/src/constants.ts +++ b/server/src/constants.ts @@ -1,6 +1,6 @@ export const fileSize: Record = { - MUSIC_FILE_LIMIT_SIZE: 1024 * 1024 * 50, - IMAGE_FILE_LIMIT_SIZE: 1024 * 1024 * 5, + MUSIC_SIZE: 1024 * 1024 * 50, + IMAGE_SIZE: 1024 * 1024 * 5, }; export enum Genres { @@ -14,10 +14,12 @@ export enum Genres { 'etc' = 'etc', } -export const fileExt = ['jpeg', 'jpg', 'png', 'mp3']; +export const keyFlags = ['user', 'music', 'cover']; -export const pathPattern = [ - /^image\/user\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/, - /^image\/cover\/\d+$/, - /^music\/\d+$/, -]; +export const keyHandler: { + [key: string]: (uuid: string) => string; +} = { + user: (uuid) => `image/user/${uuid}/user.png`, + music: (uuid) => `music/${uuid}/music.mp3`, + cover: (uuid) => `image/cover/${uuid}/cover.png`, +};