Skip to content

Commit

Permalink
사용자 수정3
Browse files Browse the repository at this point in the history
  • Loading branch information
knh0113 committed Sep 26, 2023
1 parent c5f9f3f commit 011fe80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ public Optional<User> findUserByIdAndEmail(Long userId, String email) {
public Optional<User> findUserByEmail(String email) {
return userRepository.findByEmail(email);
}

public Optional<User> findById(Long userId) {
return userRepository.findById(userId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.http.HttpStatus;
import picasso.server.common.dto.ErrorDetail;

import static org.springframework.http.HttpStatus.BAD_REQUEST;
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.UNAUTHORIZED;
import static org.springframework.http.HttpStatus.*;

@Getter
@AllArgsConstructor
Expand All @@ -29,8 +25,7 @@ public enum GlobalException implements BaseErrorCode {
PICTURE_STATUS_AFTER_APPROVE(INTERNAL_SERVER_ERROR.value(), "이미 관리자가 승인한 게시물 입니다."),
LOGIN_ERROR(NOT_FOUND.value(), "자동로그인 실패"),
STATUS_ERROR(NOT_FOUND.value(), "비활성화되어 있습니다"),
EMAIL_ERROR(NOT_FOUND.value(), "이메일이 없습니다")
PICTURE_STATUS_AFTER_APPROVE(INTERNAL_SERVER_ERROR.value(), "이미 관리자가 승인한 게시물 입니다."),
EMAIL_ERROR(NOT_FOUND.value(), "이메일이 없습니다"),
NOT_LOGIN_EXCEPTION(UNAUTHORIZED.value(), "로그인이 필요합니다."),
NEED_LOGIN_ERROR(UNAUTHORIZED.value(), "로그인이 필요한 기능입니다."),
USER_NOT_FOUND_ERROR(NOT_FOUND.value(), "유저를 찾을 수 없습니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findByEmailAndPassword(String email, String password);

Optional<User> findByIdAndEmail(Long userId, String email);

Optional<User> findById(Long userId);
}

0 comments on commit 011fe80

Please sign in to comment.