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

입덕포인트 생성, 존재 유무 구현 #74 #109

Merged
merged 16 commits into from
Nov 19, 2023
Merged

입덕포인트 생성, 존재 유무 구현 #74 #109

merged 16 commits into from
Nov 19, 2023

Conversation

hanyMK
Copy link
Contributor

@hanyMK hanyMK commented Nov 15, 2023

📝 개요

입덕포인트 생성 및 존재 유무 구현

🚀 변경사항

  1. 입덕포인트 생성 및 존재 유무 메소드 추가
  2. 입덕포인트 작성 및 존재 유무 테스트 추가
  3. API문서 추가

🔗 관련 이슈

#74

➕ 기타

@hanyMK hanyMK requested a review from jaycobcoder November 16, 2023 10:51
@hanyMK hanyMK self-assigned this Nov 16, 2023
@hanyMK hanyMK added Docs 문서 작성 및 수정 Feature 새로운 기능 추가 Refactor 코드 리팩토링 Test 테스트 관련 labels Nov 16, 2023
@Transactional
public void save(Long memberId, AttractionPointReq req) {
if(checkAttractionPoint(memberId, req.getAnimeId()).getIsAttractionPoint()){
throw new BadRequestException("AttractionPoint is already exists.");
Copy link
Contributor

Choose a reason for hiding this comment

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

중복 -> 충돌 -> 409 ConflictException 쓰시면 됩니다~

.orElseThrow(() -> new NotFoundException("Anime"));


for(int i = 0; i < req.getAttractionElements().size(); i++){
Copy link
Contributor

Choose a reason for hiding this comment

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

steam으로 쓰실 수 있으면 더 좋습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

감사합니다 수정했습니다!

.anime(anime)
.attractionElement(attractionElement)
.build())
.forEach(attractionPointRepository::save);
Copy link
Contributor

Choose a reason for hiding this comment

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

동일한 엔티티를 여러번 저장하는 경우, 리스트에 담아서 saveAll로 저장하는 걸 추천 드립니다.

https://maivve.tistory.com/342

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 감사합니다 수정했습니다!

@hanyMK hanyMK changed the title 입덕포인트 생성, 존재 유무 구현 입덕포인트 생성, 존재 유무 구현 #74 Nov 19, 2023
@hanyMK hanyMK merged commit 135dfe1 into develop Nov 19, 2023
1 check passed
@hanyMK hanyMK deleted the feature/74 branch November 19, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs 문서 작성 및 수정 Feature 새로운 기능 추가 Refactor 코드 리팩토링 Test 테스트 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants