Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

hyeyeonnnnn
Copy link
Member

@hyeyeonnnnn hyeyeonnnnn commented Oct 27, 2023

📌심화 과제

  1. DTO를 Java Record로 리펙토링하여 불변 객체화
  2. Member update, delete 추가 구현

멤버 생성
image

전체 멤버 조회
image

memberId로 특정 멤버 조회
image
image

image
(존재하지 않는 멤버 조회시 에러 메시지 출력)

멤버 수정
image
image

(generation 33 -> 34 수정)

멤버 삭제
image

📌키워드 과제
https://www.notion.so/2-d097ff07b7f6409d897c24f60039a72d

@Hong0329
Copy link

P5. 고생많으셨습니다~~!!👍

Copy link

@tkdwns414 tkdwns414 left a comment

Choose a reason for hiding this comment

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

P5. 고생하셨습니다!

Copy link

@jumining jumining left a comment

Choose a reason for hiding this comment

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

P5. 심화과제도 하시느라 수고하셨습니다!!

Comment on lines +10 to +12
){

}

Choose a reason for hiding this comment

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

P4. 여기 줄바꿈 후 공백이 이상한 것 같은데 예쁘게 다시 수정하면 좋을 거 같아요 :)

Comment on lines +5 to +6


Choose a reason for hiding this comment

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

P4. 여기 빈 줄도 줄인다면 더 예쁜 코드 완성완성

Comment on lines +37 to +79



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);
}

}


Choose a reason for hiding this comment

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

P4. 여기도 빈 줄과 줄바꿈 후 띄어쓰기 이상한 곳 수정하면 더 좋을 거 같아융

Comment on lines +27 to +30
public void updateSopt(SOPT sopt){
this.sopt = sopt;
}
}

Choose a reason for hiding this comment

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

P5. 제 코드에서 이 코드 빼먹어가지구 오류 났었는데 이거였군요 덕분에 발견했습니당

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants