Skip to content

Commit

Permalink
Merge pull request #143 from Gamegoo-repo/feat/142
Browse files Browse the repository at this point in the history
[Feat/142] SocketService λ©”μ†Œλ“œ κ΅¬ν˜„ 및 μ±„νŒ… 등둝 API 둜직 μΆ”κ°€
  • Loading branch information
Eunjin3395 authored Aug 10, 2024
2 parents b60159a + 9199b73 commit 9dd6965
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 175 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
spring.jwt.secret: ${{ secrets.JWT_SECRET }}
spring.mail.password: ${{ secrets.GMAIL_PWD }}
spring.riot.api.key: ${{ secrets.RIOT_API }}
socket.server.url: https://socket.gamegoo.co.kr

# Spring Boot μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜ Build (4)
- name: Spring Boot Build
Expand Down
81 changes: 0 additions & 81 deletions src/main/generated/com/gamegoo/domain/QMatchingRecord.java

This file was deleted.

47 changes: 25 additions & 22 deletions src/main/java/com/gamegoo/apiPayload/code/status/ErrorStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,23 @@ public enum ErrorStatus implements BaseErrorCode {

// 맀칭 κ΄€λ ¨ μ—λŸ¬
MATCHING_STATUS_BAD_REQUEST(HttpStatus.BAD_REQUEST, "MATCH400",
"statusλŠ” SUCCESS, FAIL λ‘˜ 쀑 ν•˜λ‚˜λ‘œλ§Œ 변경이 κ°€λŠ₯ν•©λ‹ˆλ‹€."),
MATHCING_TYPE_BAD_REQUEST(HttpStatus.BAD_REQUEST, "MATCH400", "matchingType은 BASIC, PRECISE λ‘˜ 쀑 ν•˜λ‚˜λ‘œλ§Œ 변경이 κ°€λŠ₯ν•©λ‹ˆλ‹€"),
"statusλŠ” SUCCESS, FAIL λ‘˜ 쀑 ν•˜λ‚˜λ‘œλ§Œ 변경이 κ°€λŠ₯ν•©λ‹ˆλ‹€."),
MATHCING_TYPE_BAD_REQUEST(HttpStatus.BAD_REQUEST, "MATCH400",
"matchingType은 BASIC, PRECISE λ‘˜ 쀑 ν•˜λ‚˜λ‘œλ§Œ 변경이 κ°€λŠ₯ν•©λ‹ˆλ‹€"),
MATCHING_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 @@ -78,7 +79,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", "μ£Όν¬μ§€μ…˜ 값은 1~5만 κ°€λŠ₯ν•©λ‹ˆλ‹€."),
SUB_POSITION_INVALID(HttpStatus.BAD_REQUEST, "BOARD401", "λΆ€ν¬μ§€μ…˜ 값은 1~5만 κ°€λŠ₯ν•©λ‹ˆλ‹€."),
Expand All @@ -96,7 +97,7 @@ public enum ErrorStatus implements BaseErrorCode {
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", "ν•΄λ‹Ή λ§€λ„ˆν‰κ°€λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€."),
MANNER_CONFLICT(HttpStatus.CONFLICT, "MANNER409", "λ§€λ„ˆ ν‰κ°€λŠ” 졜초 1회만 κ°€λŠ₯ν•©λ‹ˆλ‹€."),
Expand All @@ -108,18 +109,18 @@ public enum ErrorStatus implements BaseErrorCode {
CHATROOM_ACCESS_DENIED(HttpStatus.BAD_REQUEST, "CHAT403", "μ ‘κ·Όν•  수 μ—†λŠ” μ±„νŒ…λ°© μž…λ‹ˆλ‹€."),
CHAT_MESSAGE_NOT_FOUND(HttpStatus.NOT_FOUND, "CHAT404", "ν•΄λ‹Ή λ©”μ‹œμ§€λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€"),
CHAT_TARGET_IS_BLOCKED_CHAT_START_FAILED(HttpStatus.FORBIDDEN, "CHAT405",
"μ±„νŒ… μƒλŒ€ νšŒμ›μ„ μ°¨λ‹¨ν•œ μƒνƒœμž…λ‹ˆλ‹€. μ±„νŒ… μ‹œμž‘μ΄ λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),
"μ±„νŒ… μƒλŒ€ νšŒμ›μ„ μ°¨λ‹¨ν•œ μƒνƒœμž…λ‹ˆλ‹€. μ±„νŒ… μ‹œμž‘μ΄ λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),
BLOCKED_BY_CHAT_TARGET_CHAT_START_FAILED(HttpStatus.FORBIDDEN, "CHAT406",
"μ±„νŒ… μƒλŒ€ νšŒμ›μ΄ λ‚˜λ₯Ό μ°¨λ‹¨ν–ˆμŠ΅λ‹ˆλ‹€. μ±„νŒ… μ‹œμž‘μ΄ λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),
"μ±„νŒ… μƒλŒ€ νšŒμ›μ΄ λ‚˜λ₯Ό μ°¨λ‹¨ν–ˆμŠ΅λ‹ˆλ‹€. μ±„νŒ… μ‹œμž‘μ΄ λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),
CHAT_TARGET_IS_BLOCKED_SEND_CHAT_FAILED(HttpStatus.FORBIDDEN, "CHAT407",
"μ±„νŒ… μƒλŒ€ νšŒμ›μ„ μ°¨λ‹¨ν•œ μƒνƒœμž…λ‹ˆλ‹€. μ±„νŒ… λ©”μ‹œμ§€ 전솑이 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),
"μ±„νŒ… μƒλŒ€ νšŒμ›μ„ μ°¨λ‹¨ν•œ μƒνƒœμž…λ‹ˆλ‹€. μ±„νŒ… λ©”μ‹œμ§€ 전솑이 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),
BLOCKED_BY_CHAT_TARGET_SEND_CHAT_FAILED(HttpStatus.FORBIDDEN, "CHAT408",
"μ±„νŒ… μƒλŒ€ νšŒμ›μ΄ λ‚˜λ₯Ό μ°¨λ‹¨ν–ˆμŠ΅λ‹ˆλ‹€. μ±„νŒ… λ©”μ‹œμ§€ 전솑이 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),
"μ±„νŒ… μƒλŒ€ νšŒμ›μ΄ λ‚˜λ₯Ό μ°¨λ‹¨ν–ˆμŠ΅λ‹ˆλ‹€. μ±„νŒ… λ©”μ‹œμ§€ 전솑이 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€."),

// 친ꡬ κ΄€λ ¨ μ—λŸ¬
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",
Expand All @@ -137,7 +138,9 @@ public enum ErrorStatus implements BaseErrorCode {
NOTIFICATION_TYPE_NOT_FOUND(HttpStatus.NOT_FOUND, "NOTI401", "잘λͺ»λœ μ•Œλ¦Ό νƒ€μž…μž…λ‹ˆλ‹€."),
NOTIFICATION_METHOD_BAD_REQUEST(HttpStatus.BAD_REQUEST, "NOTI402", "μ•Œλ¦Ό 생성 λ©”μ†Œλ“œ 호좜이 잘λͺ»λ˜μ—ˆμŠ΅λ‹ˆλ‹€."),

;
// SOCKET μ„œλ²„ API 호좜 μ—λŸ¬
SOCKET_API_RESPONSE_ERR(HttpStatus.INTERNAL_SERVER_ERROR, "SOCKET501",
"socketμ„œλ²„ api μš”μ²­μ— μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.");

private final HttpStatus httpStatus;
private final String code;
Expand All @@ -146,19 +149,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();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.gamegoo.apiPayload.exception.handler;

import com.gamegoo.apiPayload.code.BaseErrorCode;
import com.gamegoo.apiPayload.exception.GeneralException;

public class SocketHandler extends GeneralException {

public SocketHandler(BaseErrorCode code) {
super(code);
}
}
Loading

0 comments on commit 9dd6965

Please sign in to comment.