From b71839a219595cee9e6116d28d9dd36d69ab0517 Mon Sep 17 00:00:00 2001 From: kimminsu Date: Mon, 25 Nov 2024 11:37:06 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=9C=A0=EC=A0=80=20?= =?UTF-8?q?=EB=9E=9C=EB=8D=A4=20=EB=8B=89=EB=84=A4=EC=9E=84=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/user/user.service.ts | 32 ++++------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/packages/backend/src/user/user.service.ts b/packages/backend/src/user/user.service.ts index 8d2a5d23..dbef92dd 100644 --- a/packages/backend/src/user/user.service.ts +++ b/packages/backend/src/user/user.service.ts @@ -6,6 +6,7 @@ import { import { DataSource, EntityManager } from 'typeorm'; import { OauthType } from './domain/ouathType'; import { User } from './domain/user.entity'; +import { status, subject } from '@/user/constants/randomNickname'; type RegisterRequest = Required< Pick @@ -76,33 +77,10 @@ export class UserService { return user.isLight; } - private generateRandomNickname(): string { - const adjectives = [ - '강력한', - '지혜로운', - '소중한', - '빛나는', - '고요한', - '용감한', - '행운의', - '신비로운', - ]; - const animals = [ - '호랑이', - '독수리', - '용', - '사슴', - '백호', - '하늘새', - '백두산 호랑이', - '붉은 여우', - ]; - - const randomAdjective = - adjectives[Math.floor(Math.random() * adjectives.length)]; - const randomAnimal = animals[Math.floor(Math.random() * animals.length)]; - - return `${randomAdjective} ${randomAnimal}`; + private generateRandomNickname() { + const statusName = status[Math.floor(Math.random() * status.length)]; + const subjectName = subject[Math.floor(Math.random() * subject.length)]; + return `${statusName}${subjectName}`; } private async getMaxOauthId(oauthType: OauthType, manager: EntityManager) {