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

아이템 수정 & 데이로그 수정 & 아이템 oridinal 수정 재업로드 #710

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

hgo641
Copy link
Collaborator

@hgo641 hgo641 commented Oct 13, 2023

📄 Summary

이전 PR
아이템 수정 로직 좀 더 가독성있게 수정함. (근데 아직도 가독성 좋은 지 잘 모르겠음) 커밋

아이템의 Place, Expense, Image의 수정 로직을 아래의 플로우로 통일 (originalObject : 변경 요청전의 오브젝트)

  • isNotUpdated이면 originalObject사용
  • deleteNotUsedObject : 더 이상 사용하지 않는 originalObject를 DB에서 삭제
  • saveNewlyUpdatedObject : 변경된 오브젝트를 DB에 저장

🙋🏻 More

라온... Item 생성자 리팩토링은... 그... 나중에 따로 PR 파서 합시다... 😂

@github-actions
Copy link

📝 Jacoco Test Coverage

Total Project Coverage 80.29% 🍏
File Coverage [83.51%]
CustomImageRepositoryImpl.java 100% 🍏
Image.java 100% 🍏
Item.java 96.41% 🍏
ItemService.java 93.04% 🍏
CustomItemRepositoryImpl.java 84.62% 🍏
DayLogService.java 79.84%
Expense.java 77.17%
Category.java 50.63%
Place.java 28.21%

Copy link
Collaborator

@LJW25 LJW25 left a comment

Choose a reason for hiding this comment

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

두번 올리느라 홍고생 하셨습니다 홍고 🍊
코드가 매우 깔끔하군요

Aㅏ프루-브 하겠습니다


@Override
public void updateOrdinals(final List<Long> orderedItemIds) {
final String sql = "UPDATE item SET ordinal = :newOrdinal WHERE id = :itemId";
Copy link
Collaborator

Choose a reason for hiding this comment

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

얘는 줄바꿈 안하나요? 짧아서 안해도 되는건가?!

Comment on lines +108 to +115
private Place makeUpdatedPlace(final ItemUpdateRequest itemUpdateRequest, final Item item) {
final Place originalPlace = item.getPlace();
if (isPlaceNotUpdated(itemUpdateRequest, item)) {
return originalPlace;
}
final Place updatedPlace = createPlaceByPlaceRequest(itemUpdateRequest.getPlace());
deleteNotUsedPlace(originalPlace);
return saveNewlyUpdatedPlace(updatedPlace);
Copy link
Collaborator

Choose a reason for hiding this comment

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

좋!은!데!요?

@hgo641 hgo641 merged commit d0a8606 into develop Oct 13, 2023
jjongwa pushed a commit that referenced this pull request Oct 19, 2023
* refactor: 아이템, 데이로그 수정 쿼리 개선

* refactor: 아이템 수정 로직 변경
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.

5 participants