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

[Feature] Goal API 작성 #27 #32

Merged
merged 16 commits into from
Dec 15, 2023
Merged

[Feature] Goal API 작성 #27 #32

merged 16 commits into from
Dec 15, 2023

Conversation

binary-ho
Copy link
Member

@binary-ho binary-ho commented Dec 15, 2023

명세에 맞춰 Goal 관련 비즈니스 로직을 작성하고 API를 구현하겠습니다. -> 명세 #27

1. 구현 사항

  • Goal의 단건 조회, 유저 Goal 전체 조회, 생성, 삭제 메서드와 API 구현
  • year와 month를 표현하는 String을 통해 LocalDate를 생성하는 RaemianLocalDate를 생성했습니다.
    String을 날짜 포멧에 맞는 숫자들로 변경하고, 고정된 Day 값을 관리할 객체가 필요할 것 같아 구현했습니다.
  • Goal Create를 위한 User, Sticker, Tag의 getById 메서드를 구현했습니다.
  • 모든 getById는 override했습니다. getById라는 이름을 사용하고 싶어 확장함수를 구현했었다가, Data JPA에서 deprecated된 해당 메서드에 의해 확장 함수가 가려져 orverride 하였습니다.
  • Goal Create의 Description에 Nullable 속성이 추가되었습니다. 저번 회의에서 목표 설명은 비어있을 수도 있다고 언급했던 내용이 떠올라 클라이언트에서 빈 문자열을 보내줄 수도 있어 Nullable로 만들었습니다.
    물론 DB에 직접 null을 저장하는 것은 좋지 않다고 생각되어, null의 경우 빈 문자열 ""로 값이 설정되도록 했습니다.
  • 테스트는 아직 조회 테스트만 작성 되어 있습니다. 명세가 급하게 필요하다 하여 일단 전체 API를 완성한 다음 테스트를 마저 작성하겠습니다.

return ResponseEntity.ok(response)
}

@GetMapping("/{goal_id}")
Copy link
Member

Choose a reason for hiding this comment

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

pathVariable도 카멜 케이스로 통일해도 좋을 것 같습니다~!

}

@DeleteMapping
fun delete(
Copy link
Member

Choose a reason for hiding this comment

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

delete의 경우 http status noContent로 반환해도 좋을 것 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

반영했습니다 감사합니다 ㅎㅎ

Copy link
Member

@egg528 egg528 left a comment

Choose a reason for hiding this comment

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

진호님 고생하셨습니다~!

@binary-ho binary-ho changed the title Feature/#27 [Feature] Goal API 작성 #27 Dec 15, 2023
@binary-ho binary-ho merged commit b16cffe into develop Dec 15, 2023
1 check passed
@binary-ho binary-ho deleted the feature/#27 branch December 15, 2023 17:58
@binary-ho binary-ho self-assigned this May 7, 2024
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.

2 participants