-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Likelion-Inner-Join/fix/signupFix
Fix: 동아리 카테고리 long으로 변경
- Loading branch information
Showing
8 changed files
with
47 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/com/likelion/innerjoin/user/exception/SignUpEmailException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.likelion.innerjoin.user.exception; | ||
|
||
public class SignUpEmailException extends RuntimeException { | ||
public SignUpEmailException(String message) { | ||
super(message); | ||
} | ||
} |
22 changes: 13 additions & 9 deletions
22
src/main/java/com/likelion/innerjoin/user/exception/SignUpExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
package com.likelion.innerjoin.user.exception; | ||
|
||
import com.likelion.innerjoin.common.response.CommonResponse; | ||
import com.likelion.innerjoin.common.exception.ErrorCode; | ||
import com.likelion.innerjoin.common.response.CommonResponse; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@RestControllerAdvice | ||
public class SignUpExceptionHandler { | ||
|
||
/** | ||
* SignUpIDException 처리 | ||
* | ||
* @param ex SignUpIDException | ||
* @return ResponseEntity<CommonResponse<Object>> | ||
*/ | ||
@ExceptionHandler(SignUpIDException.class) | ||
public ResponseEntity<CommonResponse<Object>> handleSignUpIDException(SignUpIDException ex) { | ||
CommonResponse<Object> response = new CommonResponse<>(ErrorCode.DUPLICATE_LOGIN_ID, ex.getMessage()); | ||
return ResponseEntity.badRequest().body(response); | ||
return ResponseEntity | ||
.status(HttpStatus.BAD_REQUEST) | ||
.body(new CommonResponse<>(ErrorCode.DUPLICATE_LOGIN_ID, null)); // ErrorCode의 메시지를 설정 | ||
} | ||
|
||
@ExceptionHandler(EmailValidationException.class) | ||
public ResponseEntity<CommonResponse<Object>> handleSignUpEmailException(SignUpEmailException ex) { | ||
return ResponseEntity | ||
.status(HttpStatus.BAD_REQUEST) | ||
.body(new CommonResponse<>(ErrorCode.EMAIL_FORMAT_INVALID, null)); // ErrorCode의 메시지를 설정 | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters