From ce7fb3bdb4ef255c527d1f3885036448e88a215c Mon Sep 17 00:00:00 2001 From: JiHwan <62228195+sgh002400@users.noreply.github.com> Date: Mon, 20 May 2024 02:43:42 +0900 Subject: [PATCH] Hotfix/#190 (#190) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FIX] 파트에 기타 저장되는 오류 수정 * [FIX] 기타 삭제 * [FIX] 파트명 수정 * [FIX] 파트 종류 추가&수정 * [FIX] spring enum 변경 --------- Co-authored-by: yeseul106 <20191037@sungshin.ac.kr> Co-authored-by: Ji hwan Shin Co-authored-by: mikekks --- .../crew/main/entity/user/enums/UserPart.java | 9 +++---- server/src/auth/v0/auth-v0.service.ts | 24 +++++++++++-------- server/src/entity/user/enum/user-part.enum.ts | 11 ++++----- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/user/enums/UserPart.java b/main/src/main/java/org/sopt/makers/crew/main/entity/user/enums/UserPart.java index ee292b01..068c951b 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/user/enums/UserPart.java +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/user/enums/UserPart.java @@ -9,7 +9,7 @@ public enum UserPart { // 파트 PM("기획"), DESIGN("디자인"), - IOS("IOS"), + IOS("iOS"), ANDROID("안드로이드"), SERVER("서버"), WEB("웹"), @@ -17,7 +17,7 @@ public enum UserPart { // 파트장 PM_LEADER("기획 파트장"), DESIGN_LEADER("디자인 파트장"), - IOS_LEADER("IOS 파트장"), + IOS_LEADER("iOS 파트장"), ANDROID_LEADER("안드로이드 파트장"), SERVER_LEADER("서버 파트장"), WEB_LEADER("웹 파트장"), @@ -26,8 +26,9 @@ public enum UserPart { CHAIRMAN("회장"), VICE_CHAIRMAN("부회장"), GENERAL_AFFAIRS("총무"), - OPERATION_LEADER("운영팀장"), - MEDIA_LEADER("미디어팀장"); + OPERATION_LEADER("운영 팀장"), + MEDIA_LEADER("미디어 팀장"), + MAKERS_LEADER("메이커스 리드"); private final String value; diff --git a/server/src/auth/v0/auth-v0.service.ts b/server/src/auth/v0/auth-v0.service.ts index 2e7b1eec..6c60ffb1 100644 --- a/server/src/auth/v0/auth-v0.service.ts +++ b/server/src/auth/v0/auth-v0.service.ts @@ -54,16 +54,16 @@ export class AuthV0Service { ); const activities: UserActivity[] = playgroundUserActivities[0].activities.flatMap((activity) => { - return activity.cardinalInfo.split(',').map((info, index) => { - const generation = parseInt(info.split(',')[0]); - const partString = info.split(',')[1]; - const part = UserPart[partString] ? UserPart[partString] : UserPart.ETC; // 파트 정보가 없는 경우 "기타"로 기본값 설정 - return { - generation: generation, - part: part - }; - }); - }); + const [generationString, partString] = activity.cardinalInfo.split(','); + const generation = parseInt(generationString); + const partKey = getKeyByValue(UserPart, partString); + const part = UserPart[partKey]; + + return { + generation: generation, + part: part + }; + }); const phone = playgroundUserProfile.phone ? playgroundUserProfile.phone @@ -91,3 +91,7 @@ export class AuthV0Service { } } } + +function getKeyByValue(object: any, value: string) { + return Object.keys(object).find(key => object[key] === value); +} \ No newline at end of file diff --git a/server/src/entity/user/enum/user-part.enum.ts b/server/src/entity/user/enum/user-part.enum.ts index 2ac7f0f5..f4b391d4 100644 --- a/server/src/entity/user/enum/user-part.enum.ts +++ b/server/src/entity/user/enum/user-part.enum.ts @@ -3,7 +3,7 @@ export enum UserPart { // 파트 PM = '기획', DESIGN = '디자인', - IOS = 'IOS', + IOS = 'iOS', ANDROID = '안드로이드', SERVER = '서버', WEB = '웹', @@ -11,7 +11,7 @@ export enum UserPart { // 파트장 PM_LEADER = '기획 파트장', DESIGN_LEADER = '디자인 파트장', - IOS_LEADER = 'IOS 파트장', + IOS_LEADER = 'iOS 파트장', ANDROID_LEADER = '안드로이드 파트장', SERVER_LEADER = '서버 파트장', WEB_LEADER = '웹 파트장', @@ -20,9 +20,8 @@ export enum UserPart { CHAIRMAN = '회장', VICE_CHAIRMAN = '부회장', GENERAL_AFFAIRS = '총무', - OPERATION_LEADER = '운영팀장', - MEDIA_LEADER = '미디어팀장', + OPERATION_LEADER = '운영 팀장', + MEDIA_LEADER = '미디어 팀장', + MAKERS_LEADER = '메이커스 리드', - // 기타 - ETC = '기타', }