-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Week2: 기본과제+심화과제+키워드과제 #3
base: main
Are you sure you want to change the base?
Conversation
P5. 고생많으셨습니다~~!!👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P5. 고생하셨습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P5. 심화과제도 하시느라 수고하셨습니다!!
){ | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P4. 여기 줄바꿈 후 공백이 이상한 것 같은데 예쁘게 다시 수정하면 좋을 거 같아요 :)
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P4. 여기 빈 줄도 줄인다면 더 예쁜 코드 완성완성
|
||
|
||
|
||
public List<MemberGetResponse> getMembers() { | ||
return memberJpaRepository.findAll() | ||
.stream() | ||
.map(MemberGetResponse::of) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
@Transactional | ||
public String create(MemberCreateRequest request){ | ||
Member member = Member.builder() | ||
.name(request.name()) | ||
.nickname(request.nickname()) | ||
.age(request.age()) | ||
.sopt(request.sopt()) | ||
.build(); | ||
return memberJpaRepository.save(member).getId().toString(); | ||
} | ||
|
||
private MemberGetResponse findById(Long memberId){ | ||
return MemberGetResponse.of(memberJpaRepository.findById(memberId) | ||
.orElseThrow(() -> new EntityNotFoundException("존재하지 않는 회원입니다.")) | ||
);} | ||
|
||
|
||
@Transactional | ||
public void updateSopt(Long memberId, MemberProfileUpdateRequest updateRequest){ | ||
Member member = memberJpaRepository.findByIdOrThrow(memberId); | ||
SOPT updateSopt = new SOPT(updateRequest.generation(), updateRequest.part()); | ||
member.updateSopt(updateSopt); | ||
} | ||
|
||
@Transactional | ||
public void deleteMember(Long memberId){ | ||
Member member = memberJpaRepository.findByIdOrThrow(memberId); | ||
memberJpaRepository.delete(member); | ||
} | ||
|
||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P4. 여기도 빈 줄과 줄바꿈 후 띄어쓰기 이상한 곳 수정하면 더 좋을 거 같아융
public void updateSopt(SOPT sopt){ | ||
this.sopt = sopt; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P5. 제 코드에서 이 코드 빼먹어가지구 오류 났었는데 이거였군요 덕분에 발견했습니당
📌심화 과제
멤버 생성
전체 멤버 조회
memberId로 특정 멤버 조회
(존재하지 않는 멤버 조회시 에러 메시지 출력)
멤버 수정
(generation 33 -> 34 수정)
멤버 삭제
📌키워드 과제
https://www.notion.so/2-d097ff07b7f6409d897c24f60039a72d