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

#334 냉장고 추가 및 정보 수정 API 리팩토링 #343

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

psyeon1120
Copy link
Member

@psyeon1120 psyeon1120 commented Jul 30, 2024

📍 이슈 번호


🛠️ 작업 내용

  1. 냉장고 추가 API 리팩토링
  2. 냉장고 정보 수정 API 리팩토링
  3. validation 추가
  4. DTO 클래스의 스웨거 작성 요소를 조금 바꿔봤습니다.
    예시를 추가하고, 변수 이름은 중복되길래 지웠습니다. 클래스 이름은 한국어로 지정했어요.
    @Schema(name = "냉장고 추가 요청 정보")
    public class AddFridgeReq {
    @NotBlank
    @Schema(description = "냉장고 이름", example = "우리집 냉장고")
    private String fridgeName;
    @Schema(description = "냉장고 설명", example = "우리집 냉장고입니다~")
    private String fridgeComment;
    @Schema(description = "냉장고 멤버 ID 리스트", example = "[ 1, 2 ]")
    private List<Long> members;
    }

🎸 기타 사항

  1. 냉장고 정보 수정에서 멤버 수정하는 로직은 도저히 이것보다 더 나은 방법이 생각이 안나는데, 혹시 좋은 방법 있다면 디엠으로 공유 부탁드려요 🙏
  2. 아직 냉장고 API는 많이 남았기 때문에 브랜치는 삭제하지 말아주세용

@psyeon1120 psyeon1120 added the ♻️ refactor 리팩토링 label Jul 30, 2024
@psyeon1120 psyeon1120 self-assigned this Jul 30, 2024
Copy link
Member

@sojungpp sojungpp left a comment

Choose a reason for hiding this comment

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

복잡한 냉장고 처리하느라 고생했습니답
네이밍이랑 함수 세세하게 만들어줘서 바로 잘 이해할 수 있었어용 체고야.

Comment on lines +44 to 50
public void changeRoleToOwner(){
this.role = FridgeRole.OWNER;
}
public void changeFridgeMember(User user){

public void changeRoleToMember(){
this.role = FridgeRole.MEMBER;
}
Copy link
Member

Choose a reason for hiding this comment

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

네이밍 깔쌈하네욥.

Comment on lines +127 to +129
private void updateFridgeUsers(EditFridgeReq editFridgeReq, Fridge fridge) {
List<User> currentMembers = this.fridgeUserRepository.findByFridgeAndRoleAndIsEnable(fridge, FridgeRole.MEMBER, true).stream()
.map(FridgeUser::getUser).collect(Collectors.toList());
Copy link
Member

Choose a reason for hiding this comment

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

😎👍

@psyeon1120 psyeon1120 merged commit d5f666b into develop Jul 30, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ refactor 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants