Skip to content

[REFACTOR] 홈 화면 로직 변경#239

Merged
kwonminsooo merged 4 commits into
developfrom
feat/#238-home-edit-api
Jul 19, 2026
Merged

[REFACTOR] 홈 화면 로직 변경#239
kwonminsooo merged 4 commits into
developfrom
feat/#238-home-edit-api

Conversation

@kwonminsooo

Copy link
Copy Markdown
Collaborator

📌 PR 개요

  • 스티커 배치 · 배경색 변경을 각각 저장하던 API를 홈 화면 편집(PUT /home/edit) 하나로 통합하고, 더 이상 쓰이지 않는 기존 코드 정리
image

🛠 변경 사항

  • PUT /home/edit에서 배경색 변경 + 스티커 배치를 한 번에 저장하도록 통합 (HomeController, HomeService.editHome, HomeEditRequest)
  • 기존 개별 API 및 관련 코드 삭제
    • StickerController/StickerService/StickerServiceImpl 및 관련 요청·응답 DTO
    • SettingControllerPATCH /users/me/homecolor, SettingService.updateHomeColor() 및 관련 DTO
    • 더 이상 참조되지 않는 StickerErrorCode, HomeColorErrorCode, UserStickerImageQueryRepository

테스트

  • HomeControllerTest 추가: 배경색+스티커 동시 저장, 신규 유저 설정 자동 생성, 재저장 시 기존 스티커 완전 교체, 잘못된 색상 포맷 400, 존재하지 않는 이미지 참조 에러, 미인증 401

⚠️ 리뷰 시 참고 사항

  • 스티커 저장 방식이 "부분 수정"에서 "요청받은 목록으로 전체 교체"(deleteAllByUserId 후 재생성)로 바뀌었는데, 프론트에서 매번 스티커 전체 목록을 보내는 흐름으로 맞춰졌는지 확인 필요
  • 삭제된 스티커/배경색 개별 API를 프론트엔드 등 다른 클라이언트에서 아직 호출하고 있지 않은지 확인 필요

✅ 체크리스트

  • [] 로컬에서 정상 실행됨
  • [] 로그 / 네이밍 정리
  • [] main / develop 직접 커밋 아님

@kwonminsooo kwonminsooo linked an issue Jul 11, 2026 that may be closed by this pull request
4 tasks
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: f32b9773-79e1-4825-bec8-8d415be9f622

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#238-home-edit-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kwonminsooo kwonminsooo changed the title refactor: 홈 화면 로직 변경 [REFACTOR] 홈 화면 로직 변경 Jul 11, 2026

@Lob
@Column(name = "content", nullable = false)
@Column(name = "content", columnDefinition = "MEDIUMTEXT", nullable = false, length = 16777215)

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.

저는 암 생각 없이 LONGTEXT로 변경했는데 MEDIUMTEXT로 설정한 이유가 있으신지 궁금합니다!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

앗 이부분은 저도 그냥 오류떠서 ai로 해결한거여서 별 이유없습니다 ㅎㅎ..

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.

그럼 해당 부분 충돌난 것 같으니 제가 올린 LONGTEXT로 통일해도 괜찮을까요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

넵!

@ownue ownue left a comment

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.

API 명세도 수정 부탁드립니다!

Comment thread src/main/java/com/deare/backend/api/home/dto/request/HomeEditRequest.java Outdated
Comment thread src/main/java/com/deare/backend/api/home/service/HomeService.java Outdated
Comment on lines +87 to +89
.map(dto -> {
Image image = imageRepository.findById(dto.getImageId())
.orElseThrow(() -> new GeneralException(ImageErrorCode.IMAGE_40001));

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.

스티커마다 imageRepository.findById()를 실행하는데, 이게 스티커 개수만큼 조회를 하게 되는 거라! 이미지 ID를 모아서 findAllById 등으로 미리 리스트를 받는 건 어떨지....

그리고 이미지 조회 중 하나라도 실패하면 예외가 발생하게 되는데 이것도 의도하신 건지 여쭙습니다!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

imageId를 모아서 findAllById()로 한 번에 조회하도록 수정했습니다. 그리고 이미지 조회 실패부분은 우선은 하나라도 실패하면은 전체 예외 발생하는것으로 의도했는데 이미지 하나마다 검사하여서 해당 이미지만 오류나게 하는게 더 좋을까요..?

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.

음... UX를 고려하면 오류가 발생한 이미지만 제외하고 다시 그리는 게 좋긴 한데 전체 예외 발생도 로직상 문제는 없을 것 같아요! 2차 QA 후 관련 이야기 들어오면 수정하는 걸로 할까요?! 백엔드끼리 논의해도 좋을 것 같습니다!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

넵넵!

Comment thread src/main/java/com/deare/backend/api/home/service/HomeService.java
Comment thread src/main/java/com/deare/backend/api/home/controller/HomeController.java Outdated
@kwonminsooo
kwonminsooo requested a review from ownue July 16, 2026 07:34
ownue
ownue previously approved these changes Jul 16, 2026

@ownue ownue left a comment

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.

수고하셨습니다! Term 엔티티 충돌 해결하고 머지 부탁드립니다~!

@kwonminsooo
kwonminsooo merged commit 7615eaf into develop Jul 19, 2026
2 checks passed
@ownue
ownue deleted the feat/#238-home-edit-api branch July 20, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 홈 화면 편집 통합 API 구현

2 participants