-
Notifications
You must be signed in to change notification settings - Fork 2
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 #76 from Jhsysng/feat/user
Feat/user
- Loading branch information
Showing
9 changed files
with
84 additions
and
25 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/main/java/goorm/reinput/global/controller/GlobalControllerAdvice.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,10 @@ | ||
package goorm.reinput.global.controller; | ||
|
||
import org.springframework.web.bind.annotation.ControllerAdvice; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; | ||
|
||
@ControllerAdvice | ||
public class GlobalControllerAdvice extends ResponseEntityExceptionHandler { | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/goorm/reinput/global/domain/dto/ErrorResponseDto.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,16 @@ | ||
package goorm.reinput.global.domain.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
@Builder | ||
@NoArgsConstructor | ||
@Getter | ||
public class ErrorResponseDto { | ||
|
||
private String code; | ||
private String message; | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/goorm/reinput/user/exception/CustomUserException.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,9 @@ | ||
package goorm.reinput.user.exception; | ||
|
||
public class CustomUserException extends RuntimeException { | ||
private final UserErrorCode errorCode; | ||
|
||
public CustomUserException(UserErrorCode errorCode) { | ||
this.errorCode = errorCode; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/goorm/reinput/user/exception/UserErrorCode.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,16 @@ | ||
package goorm.reinput.user.exception; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public enum UserErrorCode { | ||
USER_NOT_FOUND("UserEx001", "์ฌ์ฉ์๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.", HttpStatus.NOT_FOUND), | ||
USER_PASSWORD_NOT_MATCH("UserEx002", "๋น๋ฐ๋ฒํธ๊ฐ ์ผ์นํ์ง ์์ต๋๋ค.", HttpStatus.BAD_REQUEST); | ||
|
||
private final String code; | ||
private final String message; | ||
private final HttpStatus httpStatus; | ||
} |
3 changes: 2 additions & 1 deletion
3
src/main/java/goorm/reinput/user/repository/UserRepository.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
11 changes: 11 additions & 0 deletions
11
src/main/java/goorm/reinput/user/repository/support/UserRepositoryCustom.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,11 @@ | ||
package goorm.reinput.user.repository.support; | ||
|
||
import goorm.reinput.user.domain.User; | ||
|
||
import java.util.Optional; | ||
|
||
public interface UserRepositoryCustom { | ||
Optional<User> findByUserEmail(String userEmail); | ||
void deactivateUserByUserId(Long userId); | ||
void deleteByUserId(Long userId); | ||
} |
21 changes: 8 additions & 13 deletions
21
...user/repository/CustomUserRepository.java โ ...ory/support/UserRepositoryCustomImpl.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
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