Skip to content

Commit

Permalink
Merge pull request #221 from Gamegoo-repo/feat/218
Browse files Browse the repository at this point in the history
[Feat/218] ๋งค์นญ ์šฐ์„ ์ˆœ์œ„ ์„ธ๋ถ€ ์ž‘์—… ์ง„ํ–‰
  • Loading branch information
rimi3226 authored Sep 20, 2024
2 parents 69ffa43 + c2c6ff8 commit d331242
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 63 deletions.
78 changes: 39 additions & 39 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 @@ -81,7 +81,7 @@ public enum ErrorStatus implements BaseErrorCode {

// ๊ฒŒ์‹œํŒ ๊ธ€ ์ž‘์„ฑ ๊ด€๋ จ ์—๋Ÿฌ
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 @@ -97,11 +97,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 @@ -111,65 +111,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 @@ -178,19 +178,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();
}
}
6 changes: 3 additions & 3 deletions src/main/java/com/gamegoo/domain/matching/MatchingRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public class MatchingRecord extends BaseDateTimeEntity {
@Column(name = "game_mode", nullable = false)
private Integer gameMode;

@Column(name = "main_position", nullable = false)
@Column(name = "main_position")
private Integer mainPosition;

@Column(name = "sub_position", nullable = false)
@Column(name = "sub_position")
private Integer subPosition;

@Column(name = "want_position", nullable = false)
@Column(name = "want_position")
private Integer wantPosition;

@Column(name = "mike", nullable = false)
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/gamegoo/dto/matching/MatchingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@ public static class InitializingMatchingRequestDTO {

@Min(value = 0, message = "๋ฉ”์ธ ํฌ์ง€์…˜์˜ ๊ฐ’์€ 0์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.")
@Max(value = 5, message = "๋ฉ”์ธ ํฌ์ง€์…˜์˜ ๊ฐ’์€ 5์ดํ•˜์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.")
int mainP;
Integer mainP;

@Min(value = 0, message = "์„œ๋ธŒ ํฌ์ง€์…˜์˜ ๊ฐ’์€ 0์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.")
@Max(value = 5, message = "์„œ๋ธŒ ํฌ์ง€์…˜์˜ ๊ฐ’์€ 5์ดํ•˜์ด์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.")
int subP;
Integer subP;

@Min(value = 0, message = "์›ํ•˜๋Š” ์ƒ๋Œ€ ํฌ์ง€์…˜์˜ ๊ฐ’์€ 0์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.")
@Max(value = 5, message = "์›ํ•˜๋Š” ์ƒ๋Œ€ ํฌ์ง€์…˜์˜ ๊ฐ’์€ 5์ดํ•˜์ด์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.")
int wantP;
Integer wantP;

@NotNull(message = "gameStyleIdList๋Š” ๋น„์›Œ๋‘˜ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค")
List<Long> gameStyleIdList;
}

Expand Down
65 changes: 48 additions & 17 deletions src/main/java/com/gamegoo/service/matching/MatchingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,28 @@ private int calculatePriority(MatchingRecord myMatchingRecord,
return 0;
}

// ๊ฐœ์ธ ๋žญํฌ์˜ ๊ฒฝ์šฐ ํ‹ฐ์–ด ์ฐจ์ด๊ฐ€ 1๊ฐœ ์ด์ƒ ๋‚˜๋ฉด X
// ๊ฐœ์ธ ๋žญํฌ ์˜ˆ์™ธ์กฐ๊ฑด
if (gameMode == 2) {
// ํ‹ฐ์–ด ์ฐจ์ด๊ฐ€ 1๊ฐœ ์ด์ƒ ๋‚˜๋ฉด X
if (Math.abs(myTier.ordinal() - otherTier.ordinal()) > 1) {
return 0;
}

// ๋งˆ์Šคํ„ฐ ์ด์ƒ์€ ๊ฒŒ์ž„ ๋ถˆ๊ฐ€๋Šฅ
if (myTier.ordinal() >= 7 || otherTier.ordinal() >= 7) {
return 0;
}
}

// ์ž์œ ๋žญํฌ ์˜ˆ์™ธ์กฐ๊ฑด
if (gameMode == 3) {
// ๋งˆ์Šคํ„ฐ ์ด์ƒ ํ”Œ๋ ˆ์ด์–ด๋Š” ๊ณจ๋“œ ์ดํ•˜์˜ ํ”Œ๋ ˆ์ด์–ด์™€ ๋งค์นญ X
if (myTier.ordinal() >= 7 && otherTier.ordinal() <= 3) {
return 0;
}
if (otherTier.ordinal() >= 7 && myTier.ordinal() <= 3) {
return 0;
}
}

/**
Expand Down Expand Up @@ -215,22 +232,32 @@ private int calculatePriority(MatchingRecord myMatchingRecord,
}

// ํฌ์ง€์…˜ ๊ฐ€์ค‘์น˜
if (myWantPosition.equals(otherMainPosition) || myWantPosition.equals(0)
|| otherMainPosition.equals(0)) {
priority += 3;
} else if (myWantPosition.equals(otherSubPosition) || otherSubPosition.equals(0)) {
priority += 2;
// ์นผ๋ฐ”๋žŒ : ํฌ์ง€์…˜ ์„ ํƒ ์ œ์™ธํ•˜๊ธฐ -> ํฌ์ง€์…˜ ์ ์ˆ˜ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์ฃผ๊ณ  ์‹œ์ž‘ํ•˜๊ธฐ
if (gameMode == 4) {
priority += 6;
} else {
priority += 1;
}
// ํฌ์ง€์…˜ ๊ฐ’์ด Null์ผ ๊ฒฝ์šฐ ์˜ˆ์™ธ์ฒ˜๋ฆฌ
if (myMainPosition == null || mySubPosition == null || myWantPosition == null) {
throw new MatchingHandler(ErrorStatus.POSITION_NOT_FOUND);
}

if (otherWantPosition.equals(myMainPosition) || otherWantPosition.equals(0)
|| myMainPosition.equals(0)) {
priority += 3;
} else if (otherWantPosition.equals(mySubPosition) || mySubPosition.equals(0)) {
priority += 2;
} else {
priority += 1;
if (myWantPosition.equals(otherMainPosition) || myWantPosition.equals(0)
|| otherMainPosition.equals(0)) {
priority += 3;
} else if (myWantPosition.equals(otherSubPosition) || otherSubPosition.equals(0)) {
priority += 2;
} else {
priority += 1;
}

if (otherWantPosition.equals(myMainPosition) || otherWantPosition.equals(0)
|| myMainPosition.equals(0)) {
priority += 3;
} else if (otherWantPosition.equals(mySubPosition) || mySubPosition.equals(0)) {
priority += 2;
} else {
priority += 1;
}
}
}

Expand Down Expand Up @@ -317,8 +344,12 @@ public void save(MatchingRequest.InitializingMatchingRequestDTO request, Long id
.build();

// ๋งค์นญ ๊ธฐ๋ก์— ๋”ฐ๋ผ member ์ •๋ณด ๋ณ€๊ฒฝํ•˜๊ธฐ
member.updateMemberFromMatching(request.getMainP(), request.getSubP(), request.getMike());
profileService.addMemberGameStyles(request.getGameStyleIdList(), member.getId());
if (request.getMainP() != null && request.getSubP() != null && request.getWantP() != null) {
member.updateMemberFromMatching(request.getMainP(), request.getSubP(), request.getMike());
}
if (request.getGameStyleIdList() != null) {
profileService.addMemberGameStyles(request.getGameStyleIdList(), member.getId());
}

matchingRecordRepository.save(matchingRecord);
memberRepository.save(member);
Expand Down

0 comments on commit d331242

Please sign in to comment.