Skip to content

Commit

Permalink
Merge pull request #228 from Gamegoo-repo/refactor/227
Browse files Browse the repository at this point in the history
[Refactor/227] ์ฐจ๋‹จ ๋„๋ฉ”์ธ ํšŒ์› ํƒˆํ‡ด ๊ด€๋ จ ๋กœ์ง ์ถ”๊ฐ€
  • Loading branch information
Eunjin3395 authored Sep 20, 2024
2 parents 2b28cb0 + 926700d commit b0639a8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 39 deletions.
78 changes: 40 additions & 38 deletions src/main/java/com/gamegoo/apiPayload/code/status/ErrorStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ public enum ErrorStatus implements BaseErrorCode {

// ๋งค์นญ ๊ด€๋ จ ์—๋Ÿฌ
MATCHING_STATUS_BAD_REQUEST(HttpStatus.BAD_REQUEST, "MATCH400",
"status๋Š” SUCCESS, FAIL ๋‘˜ ์ค‘ ํ•˜๋‚˜๋กœ๋งŒ ๋ณ€๊ฒฝ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"status๋Š” SUCCESS, FAIL ๋‘˜ ์ค‘ ํ•˜๋‚˜๋กœ๋งŒ ๋ณ€๊ฒฝ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
MATHCING_TYPE_BAD_REQUEST(HttpStatus.BAD_REQUEST, "MATCH401",
"matchingType์€ BASIC, PRECISE ๋‘˜ ์ค‘ ํ•˜๋‚˜์—ฌ์•ผํ•ฉ๋‹ˆ๋‹ค."),
"matchingType์€ BASIC, PRECISE ๋‘˜ ์ค‘ ํ•˜๋‚˜์—ฌ์•ผํ•ฉ๋‹ˆ๋‹ค."),
MATCHING_NOT_FOUND(HttpStatus.NOT_FOUND, "MATCH402", "ํ•ด๋‹น ์‚ฌ์šฉ์ž์˜ ๋งค์นญ ์ •๋ณด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค."),
MATCHING_FAILED_BY_BLOCK(HttpStatus.BAD_REQUEST, "MATCH403", "์ฐจ๋‹จ๋œ ์‚ฌ์šฉ์ž๋ผ๋ฆฌ์˜ ๋งค์นญ์€ ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
MATCHING_POSITION_NOT_FOUND(HttpStatus.NOT_FOUND, "MATCH404", "ํฌ์ง€์…˜ ์ •๋ณด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค."),

// Riot ๊ด€๋ จ ์—๋Ÿฌ
RIOT_NOT_FOUND(HttpStatus.NOT_FOUND, "RIOT404", "ํ•ด๋‹น Riot ๊ณ„์ •์ด ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."),
RIOT_MATCH_NOT_FOUND(HttpStatus.NOT_FOUND, "RIOTMATCH404",
"ํ•ด๋‹น Riot ๊ณ„์ •์˜ ๋งค์นญ์„ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋„์ค‘ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ์ตœ๊ทผ 100ํŒ ์ด๋‚ด ์ด๋ฒคํŠธ ๋งค์นญ ์ œ์™ธ, ์ผ๋ฐ˜ ๋งค์นญ(์ผ๋ฐ˜๊ฒŒ์ž„,๋žญํฌ๊ฒŒ์ž„,์นผ๋ฐ”๋žŒ)์„ ๋งŽ์ด ํ•œ ๊ณ„์ •์œผ๋กœ ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”."),
"ํ•ด๋‹น Riot ๊ณ„์ •์˜ ๋งค์นญ์„ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋„์ค‘ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ์ตœ๊ทผ 100ํŒ ์ด๋‚ด ์ด๋ฒคํŠธ ๋งค์นญ ์ œ์™ธ, ์ผ๋ฐ˜ ๋งค์นญ(์ผ๋ฐ˜๊ฒŒ์ž„,๋žญํฌ๊ฒŒ์ž„,์นผ๋ฐ”๋žŒ)์„ ๋งŽ์ด ํ•œ ๊ณ„์ •์œผ๋กœ ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”."),
RIOT_PREFER_CHAMPION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "RIOTCHAMPION500",
"์„ ํ˜ธ ์ฑ”ํ”ผ์–ธ์„ ์—ฐ๋™ํ•˜๋Š” ๋„์ค‘ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค"),
"์„ ํ˜ธ ์ฑ”ํ”ผ์–ธ์„ ์—ฐ๋™ํ•˜๋Š” ๋„์ค‘ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค"),
CHAMPION_NOT_FOUND(HttpStatus.NOT_FOUND, "CHAMPION404", "ํ•ด๋‹น ์ฑ”ํ”ผ์–ธ์ด ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."),
RIOT_MEMBER_CONFLICT(HttpStatus.CONFLICT, "RIOT409", "ํ•ด๋‹น ์ด๋ฉ”์ผ ๊ณ„์ •์€ ์ด๋ฏธ ๋‹ค๋ฅธ RIOT ๊ณ„์ •๊ณผ ์—ฐ๋™๋˜์—ˆ์Šต๋‹ˆ๋‹ค."),
RIOT_ACCOUNT_CONFLICT(HttpStatus.CONFLICT, "RIOT409", "ํ•ด๋‹น RIOT ๊ณ„์ •์€ ์ด๋ฏธ ๋‹ค๋ฅธ ์ด๋ฉ”์ผ๊ณผ ์—ฐ๋™๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค."),
RIOT_INSUFFICIENT_MATCHES(HttpStatus.NOT_FOUND, "RIOT404",
"ํ•ด๋‹น RIOT ๊ณ„์ •์€ ์ตœ๊ทผ 100ํŒ ์ด๋‚ด์— ์†”๋กœ๋žญํฌ, ์ž์œ ๋žญํฌ, ์ผ๋ฐ˜๊ฒŒ์ž„, ์นผ๋ฐ”๋žŒ์„ ํ”Œ๋ ˆ์ดํ•œ ์ ์ด ์—†๊ธฐ ๋•Œ๋ฌธ์— ์„ ํ˜ธํ•˜๋Š” ์ฑ”ํ”ผ์–ธ 3๋ช…์„ ์ •ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
"ํ•ด๋‹น RIOT ๊ณ„์ •์€ ์ตœ๊ทผ 100ํŒ ์ด๋‚ด์— ์†”๋กœ๋žญํฌ, ์ž์œ ๋žญํฌ, ์ผ๋ฐ˜๊ฒŒ์ž„, ์นผ๋ฐ”๋žŒ์„ ํ”Œ๋ ˆ์ดํ•œ ์ ์ด ์—†๊ธฐ ๋•Œ๋ฌธ์— ์„ ํ˜ธํ•˜๋Š” ์ฑ”ํ”ผ์–ธ 3๋ช…์„ ์ •ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
RIOT_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "RIOT500", "RIOT API ์—ฐ๋™ ์ค‘ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค."),

// ์ฐจ๋‹จ ๊ด€๋ จ ์—๋Ÿฌ
Expand All @@ -75,14 +75,16 @@ public enum ErrorStatus implements BaseErrorCode {
TARGET_MEMBER_NOT_BLOCKED(HttpStatus.BAD_REQUEST, "BLOCK403", "์ฐจ๋‹จ ๋ชฉ๋ก์— ์กด์žฌํ•˜์ง€ ์•Š๋Š” ํšŒ์›์ž…๋‹ˆ๋‹ค."),
BLOCK_MEMBER_BAD_REQUEST(HttpStatus.BAD_REQUEST, "BLOCK404", "์ž˜๋ชป๋œ ์นœ๊ตฌ ์ฐจ๋‹จ ์š”์ฒญ์ž…๋‹ˆ๋‹ค."),
DELETE_BLOCKED_MEMBER_FAILED(HttpStatus.BAD_REQUEST, "BLOCK405", "์ฐจ๋‹จ ๋ชฉ๋ก์—์„œ ์‚ญ์ œ ๋ถˆ๊ฐ€ํ•œ ํšŒ์›์ž…๋‹ˆ๋‹ค."),
UNBLOCK_TARGET_MEMBER_BLIND(HttpStatus.BAD_REQUEST, "BLOCK406",
"์ฐจ๋‹จ ๋Œ€์ƒ ํšŒ์›์ด ํƒˆํ‡ดํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฐจ๋‹จ ํ•ด์ œ๊ฐ€ ๋ถˆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค."),

// ์‹ ๊ณ  ๊ด€๋ จ ์—๋Ÿฌ
REPORT_TARGET_MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, "REPORT401", "์‹ ๊ณ  ๋Œ€์ƒ ํšŒ์›์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
MEMBER_AND_TARGET_MEMBER_SAME(HttpStatus.BAD_REQUEST, "REPORT402", "ํšŒ์›๊ณผ ์‹ ๊ณ  ๋Œ€์ƒ ํšŒ์›์ด ๊ฐ™์Šต๋‹ˆ๋‹ค."),

// ๊ฒŒ์‹œํŒ ๊ธ€ ์ž‘์„ฑ ๊ด€๋ จ ์—๋Ÿฌ
BOARD_GAME_STYLE_BAD_REQUEST(HttpStatus.BAD_REQUEST, "BOARD400",
"๊ฒŒ์ž„ ์Šคํƒ€์ผ ์„ ํƒ ๊ฐœ์ˆ˜(์ตœ๋Œ€ 3๊ฐœ)๋ฅผ ์ดˆ๊ณผํ–ˆ์Šต๋‹ˆ๋‹ค."),
"๊ฒŒ์ž„ ์Šคํƒ€์ผ ์„ ํƒ ๊ฐœ์ˆ˜(์ตœ๋Œ€ 3๊ฐœ)๋ฅผ ์ดˆ๊ณผํ–ˆ์Šต๋‹ˆ๋‹ค."),
GAME_MODE_INVALID(HttpStatus.BAD_REQUEST, "BOARD401", "๊ฒŒ์ž„๋ชจ๋“œ ๊ฐ’์€ 1~4๋งŒ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
MAIN_POSITION_INVALID(HttpStatus.BAD_REQUEST, "BOARD401", "์ฃผํฌ์ง€์…˜ ๊ฐ’์€ 0~5๋งŒ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
SUB_POSITION_INVALID(HttpStatus.BAD_REQUEST, "BOARD401", "๋ถ€ํฌ์ง€์…˜ ๊ฐ’์€ 0~5๋งŒ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
Expand All @@ -98,11 +100,11 @@ public enum ErrorStatus implements BaseErrorCode {
// ๋งค๋„ˆํ‰๊ฐ€ ๊ด€๋ จ ์—๋Ÿฌ
MANNER_TARGET_MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, "MANNER401", "๋งค๋„ˆ ํ‰๊ฐ€ ๋Œ€์ƒ ํšŒ์›์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
BAD_MANNER_TARGET_MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, "MANNER401",
"๋น„๋งค๋„ˆ ํ‰๊ฐ€ ๋Œ€์ƒ ํšŒ์›์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
"๋น„๋งค๋„ˆ ํ‰๊ฐ€ ๋Œ€์ƒ ํšŒ์›์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
MANNER_UNAUTHORIZED(HttpStatus.UNAUTHORIZED, "MANNER401", "๋งค๋„ˆํ‰๊ฐ€ ์ž‘์„ฑ์ž๋งŒ ์ˆ˜์ • ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
MANNER_KEYWORD_TYPE_INVALID(HttpStatus.BAD_REQUEST, "MANNER401", "๋งค๋„ˆ ํ‚ค์›Œ๋“œ ์œ ํ˜•์€ 1~6๋งŒ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
BAD_MANNER_KEYWORD_TYPE_INVALID(HttpStatus.BAD_REQUEST, "MANNER401",
"๋น„๋งค๋„ˆ ํ‚ค์›Œ๋“œ ์œ ํ˜•์€ 7~12๋งŒ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"๋น„๋งค๋„ˆ ํ‚ค์›Œ๋“œ ์œ ํ˜•์€ 7~12๋งŒ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
MANNER_KEYWORD_NOT_FOUND(HttpStatus.NOT_FOUND, "MANNER404", "ํ•ด๋‹น ๋งค๋„ˆ ํ‚ค์›Œ๋“œ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
MANNER_NOT_FOUND(HttpStatus.NOT_FOUND, "MANNER404", "ํ•ด๋‹น ๋งค๋„ˆํ‰๊ฐ€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
BAD_MANNER_NOT_FOUND(HttpStatus.NOT_FOUND, "MANNER404", "ํ•ด๋‹น ๋น„๋งค๋„ˆํ‰๊ฐ€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
Expand All @@ -112,65 +114,65 @@ public enum ErrorStatus implements BaseErrorCode {

// ์ฑ„ํŒ… ๊ด€๋ จ ์—๋Ÿฌ
CHAT_START_FAILED_CHAT_TARGET_NOT_FOUND(HttpStatus.NOT_FOUND, "CHAT401",
"์ฑ„ํŒ… ๋Œ€์ƒ ํšŒ์›์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ๋Œ€์ƒ ํšŒ์›์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
CHATROOM_NOT_EXIST(HttpStatus.NOT_FOUND, "CHAT402", "์ฑ„ํŒ…๋ฐฉ์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
CHATROOM_ACCESS_DENIED(HttpStatus.BAD_REQUEST, "CHAT403", "์ ‘๊ทผํ•  ์ˆ˜ ์—†๋Š” ์ฑ„ํŒ…๋ฐฉ ์ž…๋‹ˆ๋‹ค."),
CHAT_MESSAGE_NOT_FOUND(HttpStatus.NOT_FOUND, "CHAT404", "ํ•ด๋‹น ๋ฉ”์‹œ์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค"),
CHAT_START_FAILED_CHAT_TARGET_IS_BLOCKED(HttpStatus.FORBIDDEN, "CHAT405",
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์„ ์ฐจ๋‹จํ•œ ์ƒํƒœ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์„ ์ฐจ๋‹จํ•œ ์ƒํƒœ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_START_FAILED_BLOCKED_BY_CHAT_TARGET(HttpStatus.FORBIDDEN, "CHAT406",
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ๋‚˜๋ฅผ ์ฐจ๋‹จํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ๋‚˜๋ฅผ ์ฐจ๋‹จํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_START_FAILED_TARGET_USER_DEACTIVATED(HttpStatus.NOT_FOUND, "CHAT407",
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ํƒˆํ‡ดํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ํƒˆํ‡ดํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_START_FAILED_BOARD_NOT_FOUND(HttpStatus.NOT_FOUND, "CHAT408",
"ํ•ด๋‹น ๊ฒŒ์‹œ๊ธ€์ด ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"ํ•ด๋‹น ๊ฒŒ์‹œ๊ธ€์ด ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_START_FAILED_BOARD_CREATOR_IS_SELF(HttpStatus.BAD_REQUEST, "CHAT409",
"ํ•ด๋‹น ๊ฒŒ์‹œ๊ธ€์˜ ์ž‘์„ฑ์ž๊ฐ€ ๋ณธ์ธ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"ํ•ด๋‹น ๊ฒŒ์‹œ๊ธ€์˜ ์ž‘์„ฑ์ž๊ฐ€ ๋ณธ์ธ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_START_FAILED_TARGET_USER_IS_SELF(HttpStatus.BAD_REQUEST, "CHAT410",
"์ฑ„ํŒ… ๋Œ€์ƒ ํšŒ์›์ด ๋ณธ์ธ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ๋Œ€์ƒ ํšŒ์›์ด ๋ณธ์ธ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์‹œ์ž‘์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_READ_FAILED_NOT_ENTERED_CHATROOM(HttpStatus.FORBIDDEN, "CHAT411",
"ํ•ด๋‹น ์ฑ„ํŒ…๋ฐฉ์— ์ž…์žฅ ์ƒํƒœ๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. ์ฑ„ํŒ…๋ฐฉ ์ž…์žฅ ํ›„ ๋ฉ”์‹œ์ง€ ์ฝ์Œ ์ฒ˜๋ฆฌํ•˜์„ธ์š”."),
"ํ•ด๋‹น ์ฑ„ํŒ…๋ฐฉ์— ์ž…์žฅ ์ƒํƒœ๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. ์ฑ„ํŒ…๋ฐฉ ์ž…์žฅ ํ›„ ๋ฉ”์‹œ์ง€ ์ฝ์Œ ์ฒ˜๋ฆฌํ•˜์„ธ์š”."),
CHAT_READ_FAILED_CHAT_MESSAGE_NOT_FOUND(HttpStatus.NOT_FOUND, "CHAT412",
"ํ•ด๋‹น ๋ฉ”์‹œ์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ๋ฉ”์‹œ์ง€ ์ฝ์Œ ์ฒ˜๋ฆฌ ์‹คํŒจ"),
"ํ•ด๋‹น ๋ฉ”์‹œ์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ๋ฉ”์‹œ์ง€ ์ฝ์Œ ์ฒ˜๋ฆฌ ์‹คํŒจ"),
CHAT_ADD_FAILED_TARGET_USER_DEACTIVATED(HttpStatus.BAD_REQUEST, "CHAT413",
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ํƒˆํ‡ดํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์ „์†ก์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ํƒˆํ‡ดํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ์ „์†ก์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_ADD_FAILED_CHAT_TARGET_IS_BLOCKED(HttpStatus.FORBIDDEN, "CHAT408",
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์„ ์ฐจ๋‹จํ•œ ์ƒํƒœ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ๋ฉ”์‹œ์ง€ ์ „์†ก์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์„ ์ฐจ๋‹จํ•œ ์ƒํƒœ์ž…๋‹ˆ๋‹ค. ์ฑ„ํŒ… ๋ฉ”์‹œ์ง€ ์ „์†ก์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
CHAT_ADD_FAILED_BLOCKED_BY_CHAT_TARGET(HttpStatus.FORBIDDEN, "CHAT409",
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ๋‚˜๋ฅผ ์ฐจ๋‹จํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ๋ฉ”์‹œ์ง€ ์ „์†ก์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
"์ฑ„ํŒ… ์ƒ๋Œ€ ํšŒ์›์ด ๋‚˜๋ฅผ ์ฐจ๋‹จํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… ๋ฉ”์‹œ์ง€ ์ „์†ก์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),


// ์นœ๊ตฌ ๊ด€๋ จ ์—๋Ÿฌ
FRIEND_BAD_REQUEST(HttpStatus.BAD_REQUEST, "FRIEND401", "์ž˜๋ชป๋œ ์นœ๊ตฌ ์š”์ฒญ์ž…๋‹ˆ๋‹ค."),
FRIEND_TARGET_IS_BLOCKED(HttpStatus.BAD_REQUEST, "FRIEND402",
"๋‚ด๊ฐ€ ์ฐจ๋‹จํ•œ ํšŒ์›์ž…๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
"๋‚ด๊ฐ€ ์ฐจ๋‹จํ•œ ํšŒ์›์ž…๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
BLOCKED_BY_FRIEND_TARGET(HttpStatus.BAD_REQUEST, "FRIEND403",
"๋‚˜๋ฅผ ์ฐจ๋‹จํ•œ ํšŒ์›์ž…๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
"๋‚˜๋ฅผ ์ฐจ๋‹จํ•œ ํšŒ์›์ž…๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
MY_PENDING_FRIEND_REQUEST_EXIST(HttpStatus.BAD_REQUEST, "FRIEND404",
"ํ•ด๋‹น ํšŒ์›์—๊ฒŒ ๋ณด๋‚ธ ์ˆ˜๋ฝ ๋Œ€๊ธฐ ์ค‘์ธ ์นœ๊ตฌ ์š”์ฒญ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
"ํ•ด๋‹น ํšŒ์›์—๊ฒŒ ๋ณด๋‚ธ ์ˆ˜๋ฝ ๋Œ€๊ธฐ ์ค‘์ธ ์นœ๊ตฌ ์š”์ฒญ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
TARGET_PENDING_FRIEND_REQUEST_EXIST(HttpStatus.BAD_REQUEST, "FRIEND405",
"ํ•ด๋‹น ํšŒ์›์ด ๋‚˜์—๊ฒŒ ๋ณด๋‚ธ ์นœ๊ตฌ ์š”์ฒญ์ด ์ˆ˜๋ฝ ๋Œ€๊ธฐ ์ค‘ ์ž…๋‹ˆ๋‹ค. ํ•ด๋‹น ์š”์ฒญ์„ ์ˆ˜๋ฝ ํ•ด์ฃผ์„ธ์š”."),
"ํ•ด๋‹น ํšŒ์›์ด ๋‚˜์—๊ฒŒ ๋ณด๋‚ธ ์นœ๊ตฌ ์š”์ฒญ์ด ์ˆ˜๋ฝ ๋Œ€๊ธฐ ์ค‘ ์ž…๋‹ˆ๋‹ค. ํ•ด๋‹น ์š”์ฒญ์„ ์ˆ˜๋ฝ ํ•ด์ฃผ์„ธ์š”."),
ALREADY_FRIEND(HttpStatus.BAD_REQUEST, "FRIEND406",
"๋‘ ํšŒ์›์€ ์ด๋ฏธ ์นœ๊ตฌ ๊ด€๊ณ„ ์ž…๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
"๋‘ ํšŒ์›์€ ์ด๋ฏธ ์นœ๊ตฌ ๊ด€๊ณ„ ์ž…๋‹ˆ๋‹ค. ์นœ๊ตฌ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
PENDING_FRIEND_REQUEST_NOT_EXIST(HttpStatus.NOT_FOUND, "FRIEND407",
"์ทจ์†Œ/์ˆ˜๋ฝ/๊ฑฐ์ ˆํ•  ์นœ๊ตฌ ์š”์ฒญ์ด ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."),
"์ทจ์†Œ/์ˆ˜๋ฝ/๊ฑฐ์ ˆํ•  ์นœ๊ตฌ ์š”์ฒญ์ด ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."),
MEMBERS_NOT_FRIEND(HttpStatus.BAD_REQUEST, "FRIEND408", "๋‘ ํšŒ์›์€ ์นœ๊ตฌ ๊ด€๊ณ„๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค."),
ALREADY_STAR_FRIEND(HttpStatus.BAD_REQUEST, "FRIEND409", "์ด๋ฏธ ์ฆ๊ฒจ์ฐพ๊ธฐ ๋˜์–ด ์žˆ๋Š” ์นœ๊ตฌ์ž…๋‹ˆ๋‹ค."),
NOT_STAR_FRIEND(HttpStatus.BAD_REQUEST, "FRIEND410", "์ฆ๊ฒจ์ฐพ๊ธฐ ๋˜์–ด ์žˆ๋Š” ์นœ๊ตฌ๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค."),
FRIEND_SEARCH_QUERY_BAD_REQUEST(HttpStatus.BAD_REQUEST, "FRIEND411",
"์นœ๊ตฌ ๊ฒ€์ƒ‰ ์ฟผ๋ฆฌ๋Š” 100์ž ์ดํ•˜์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค."),
"์นœ๊ตฌ ๊ฒ€์ƒ‰ ์ฟผ๋ฆฌ๋Š” 100์ž ์ดํ•˜์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค."),
FRIEND_USER_DEACTIVATED(HttpStatus.NOT_FOUND, "FRIEND412", "์นœ๊ตฌ ํšŒ์›์ด ํƒˆํ‡ดํ–ˆ์Šต๋‹ˆ๋‹ค."),

// ์•Œ๋ฆผ ๊ด€๋ จ ์—๋Ÿฌ
NOTIFICATION_TYPE_NOT_FOUND(HttpStatus.NOT_FOUND, "NOTI401", "ํ•ด๋‹น ์•Œ๋ฆผ ํƒ€์ž… ๋ฐ์ดํ„ฐ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
NOTIFICATION_METHOD_BAD_REQUEST(HttpStatus.BAD_REQUEST, "NOTI402", "์•Œ๋ฆผ ์ƒ์„ฑ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ์ด ์ž˜๋ชป๋˜์—ˆ์Šต๋‹ˆ๋‹ค."),
INVALID_NOTIFICATION_TYPE(HttpStatus.BAD_REQUEST, "NOTI403",
"์ž˜๋ชป๋œ ์•Œ๋ฆผ ์กฐํšŒ ํƒ€์ž…์ž…๋‹ˆ๋‹ค. general๊ณผ friend ์ค‘ ํ•˜๋‚˜๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”."),
"์ž˜๋ชป๋œ ์•Œ๋ฆผ ์กฐํšŒ ํƒ€์ž…์ž…๋‹ˆ๋‹ค. general๊ณผ friend ์ค‘ ํ•˜๋‚˜๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”."),
NOTIFICATION_NOT_FOUND(HttpStatus.NOT_FOUND, "NOTI404", "ํ•ด๋‹น ์•Œ๋ฆผ ๋‚ด์—ญ์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),

// SOCKET ์„œ๋ฒ„ API ํ˜ธ์ถœ ์—๋Ÿฌ
SOCKET_API_RESPONSE_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "SOCKET501",
"socket์„œ๋ฒ„ api ์š”์ฒญ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.");
"socket์„œ๋ฒ„ api ์š”์ฒญ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.");

private final HttpStatus httpStatus;
private final String code;
Expand All @@ -179,19 +181,19 @@ public enum ErrorStatus implements BaseErrorCode {
@Override
public ErrorReasonDTO getReason() {
return ErrorReasonDTO.builder()
.message(message)
.code(code)
.isSuccess(false)
.build();
.message(message)
.code(code)
.isSuccess(false)
.build();
}

@Override
public ErrorReasonDTO getReasonHttpStatus() {
return ErrorReasonDTO.builder()
.message(message)
.code(code)
.isSuccess(false)
.httpStatus(httpStatus)
.build();
.message(message)
.code(code)
.isSuccess(false)
.httpStatus(httpStatus)
.build();
}
}
3 changes: 2 additions & 1 deletion src/main/java/com/gamegoo/converter/MemberConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public static MemberResponse.blockedMemberDTO toBlockedMemberDTO(Member member)
.memberId(member.getId())
.profileImg(member.getProfileImage())
.email(member.getEmail())
.name(member.getGameName())
.name(member.getBlind() ? "(ํƒˆํ‡ดํ•œ ์‚ฌ์šฉ์ž)" : member.getGameName())
.isBlind(member.getBlind())
.build();

}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/gamegoo/dto/member/MemberResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static class blockedMemberDTO {
Integer profileImg;
String email;
String name;
Boolean isBlind;
}

@Getter
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/gamegoo/service/member/BlockService.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ public void unBlockMember(Long memberId, Long targetMemberId) {
Member member = profileService.findMember(memberId);
Member targetMember = profileService.findMember(targetMemberId);

// ๋Œ€์ƒ ํšŒ์›์ด ํƒˆํ‡ด ์ƒํƒœ๊ฐ€ ์•„๋‹Œ์ง€ ๊ฒ€์ฆ
if (targetMember.getBlind()) {
throw new BlockHandler(ErrorStatus.UNBLOCK_TARGET_MEMBER_BLIND);
}

// targetMember๊ฐ€ ์ฐจ๋‹จ ์‹ค์ œ๋กœ ์ฐจ๋‹จ ๋ชฉ๋ก์— ์กด์žฌํ•˜๋Š”์ง€ ๊ฒ€์ฆ
Block block = blockRepository.findByBlockerMemberAndBlockedMember(member, targetMember)
.orElseThrow(() -> new BlockHandler(ErrorStatus.TARGET_MEMBER_NOT_BLOCKED));
Expand Down

0 comments on commit b0639a8

Please sign in to comment.