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

[FEAT] 레큐노트 생성 API 구현 #37

Merged
merged 8 commits into from
Jan 7, 2024
Merged

Conversation

dong2ast
Copy link
Contributor

@dong2ast dong2ast commented Jan 7, 2024

📌 관련 이슈

closed #10

✨ 어떤 이유로 변경된 내용인지

  • 레큐노트 생성 로직을 구현했습니다.
  • 이를 위해 Book, Member 서비스 단에 기초적인 로직을 구현했습니다.
  • userRepository 네이밍이 아직 변경 안되었기에 같이 수정했습니다.
  • Swagger Example을 추가했습니다. 추후 사용할 때 이런식으로 사용하는구나~ 하고 참고하면 좋을 것 같습니다.

🙏 검토 혹은 리뷰어에게 남기고 싶은 말

@dong2ast dong2ast added 🪄API 서버 API 통신 ✨Feat 새로운 기능 추가 동휘⚡️ 🔥 Pull Request PR 날림 🔨Refactor 코드 리팩토링 (기능 변경 없이 코드만 수정할 때) labels Jan 7, 2024
@dong2ast dong2ast self-assigned this Jan 7, 2024
@dong2ast dong2ast linked an issue Jan 7, 2024 that may be closed by this pull request
3 tasks
Copy link
Contributor

@eeddiinn eeddiinn left a comment

Choose a reason for hiding this comment

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

@ Schema, @ Tag, @ SecurityRequirement, @ Operation 등
Swagger 를 사용하여 API를 문서화할 때 사용되는 주석에 대해
코드를 보면서 참고할 수 있었습니다 !! 감사합니당 😊😊

수고했슈 !!!!!!!!!!!

Comment on lines 11 to 12
@Schema(example = "test")
String content,
Copy link
Contributor

Choose a reason for hiding this comment

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

@NotBlank
@Size(min = 1, max = 1000, message = "레큐노트 내용은 1자 이상 1000자 이하여야합니다.")

[P3] validation 추가하면 좋을 것 같습니당 !!!!
( 근데 1000자까지 쓸 일이 없을 것 같기도 하네욤 ....ㅎ )

Copy link
Member

Choose a reason for hiding this comment

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

[P3]
예진이 말처럼 validation 추가 부탁드립니다!
그리고 color 숫자 범위 값도 나중에 확정되면 validation 해줘야 할것 같아요!

// TODO validation 추가
주석 남겨주시면 감사하겠습니다!

Copy link
Member

@ddongseop ddongseop left a comment

Choose a reason for hiding this comment

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

수고하셨습니당~

import org.springframework.data.jpa.repository.JpaRepository;

public interface BookRepository extends JpaRepository<Book, Long> {

default Book getBookById(Long id) {
Copy link
Member

Choose a reason for hiding this comment

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

[P4]
저는 해당 default 메서드의 네이밍을 findByIdOrThrow로 짓는 편인데요!

  • findBookById
  • findBookByIdOrThrow
  • findById
  • findByIdOrThrow

중에서 어떤 네이밍이 좋다고 생각하시는지 궁금합니다!

그리고 find보단 get으로 쓰는걸 선호하시는 편인가요오~~??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋ P4까지 나왔군여
저는 기본 jpa 메서드를 find로 자주 써서, 헷갈리지 않으려고 get으로 사용했는데 findByIdOrThrow 이 이름도 괜찮습니다~

public interface MemberRepository extends JpaRepository<Member, Long> {

boolean existsBySocialPlatformAndSocialId(SocialPlatform socialPlatform, String socialId);

Optional<Member> findBySocialPlatformAndSocialId(SocialPlatform socialPlatform, String socialId);

default Member getMemberById(Long id) {
Copy link
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 11 to 12
@Schema(example = "test")
String content,
Copy link
Member

Choose a reason for hiding this comment

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

[P3]
예진이 말처럼 validation 추가 부탁드립니다!
그리고 color 숫자 범위 값도 나중에 확정되면 validation 해줘야 할것 같아요!

// TODO validation 추가
주석 남겨주시면 감사하겠습니다!

# Conflicts:
#	src/main/java/org/sopt/lequuServer/domain/book/repository/BookRepository.java
#	src/main/java/org/sopt/lequuServer/domain/book/service/BookService.java
#	src/main/java/org/sopt/lequuServer/domain/member/repository/MemberRepository.java
#	src/main/java/org/sopt/lequuServer/domain/member/service/MemberService.java
#	src/main/java/org/sopt/lequuServer/global/exception/enums/SuccessType.java
@dong2ast dong2ast merged commit 0368717 into develop Jan 7, 2024
1 check passed
@dong2ast dong2ast deleted the feat/#10-lecue_note_api branch January 7, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
동휘⚡️ 🪄API 서버 API 통신 ✨Feat 새로운 기능 추가 🔥 Pull Request PR 날림 🔨Refactor 코드 리팩토링 (기능 변경 없이 코드만 수정할 때)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 레큐노트 생성 API 구현
3 participants