Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class Student {
private String department;

@Column(name = "identity")
@Enumerated(EnumType.STRING)
@Enumerated(EnumType.ORDINAL)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A

저도 관련사항 이슈 처리하는데 인지를 못하고 있었네요😵

private UserIdentity userIdentity;

@Column(name = "is_graduated")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public interface StudentRepository extends Repository<Student, Long> {

Student save(Student student);

Optional<Student> findByUserId(Long userId);
Optional<Student> findById(Long userId);

default Student getByUserId(Long userId) {
return findByUserId(userId)
default Student getById(Long userId) {
return findById(userId)
.orElseThrow(() -> UserNotFoundException.withDetail("userId: " + userId));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public class StudentService {
private final UserRepository userRepository;

public StudentResponse getStudent(Long userId) {
Student student = studentRepository.getByUserId(userId);
Student student = studentRepository.getById(userId);
return StudentResponse.from(student);
}

@Transactional
public StudentUpdateResponse updateStudent(Long userId, StudentUpdateRequest request) {
Student student = studentRepository.getByUserId(userId);
Student student = studentRepository.getById(userId);
User user = student.getUser();
checkNicknameDuplication(request.nickname());
checkDepartmentValid(request.major());
Expand Down