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

[BE] 좋아요 등록/삭제 API 개발 [ISSUE-30] #40

Merged
merged 7 commits into from
Jan 26, 2023
Merged

Conversation

jun108059
Copy link
Owner

✨ Summary

좋아요 등록, 좋아요 삭제 API 개발을 완료했습니다.

Description Method Endpoint Page
좋아요 등록 POST /api/v1/likes 홈 → 상품상세
좋아요 삭제 DELETE /api/v1/likes 홈 → 상품상세

✍🏻 Describe changes

  • 좋아요 등록/삭제 Request DTO 추가
    • 확장성을 고려해 json으로 받음
  • 공통 유효성 검사 메서드로 추출
  • 좋아요 등록/삭제 컨트롤러, 비즈니스 로직 추가
  • API 호출 시나리오 추가
  • 전역 예외 처리 수정
  • 좋아요 중복 호출 예외 처리(409 conflict)

✅ API 규격 (좋아요 등록)

POST {baseUrl}/api/v1/likes

Request

  • Authorization: Bearer {{TOKEN}}
  • Content-Type: application/json
{
  "productId": 2
}

Response

201 CREATED

{LikesEntityId}

✅ API 규격 (좋아요 삭제)

DELETE {baseUrl}/api/v1/likes

Request

  • Authorization: Bearer {{TOKEN}}
  • Content-Type: application/json
{
  "productId": 2
}

Response

200 OK

delete Ok [likesId = {LikesEntityId}]

📌 Issue number

resolved: #30

- API Response 제거
- Exception 추상화 ErrorCode 세분화

Related to: #6
- Exception 추상화 ErrorCode 세분화

Related to: #6
- 중복 등록 방지 예외 처리(http 409)
- Member, Product 유효성 검사

Related to: #30
- 유효성 검사 메서드 추출
- 삭제한 id 반환

Related to: #30
- 등록 후 삭제 시나리오 작성
- Authorization Token 인증 추가

Related to: #30
@jun108059 jun108059 added the ✨ Feature 새로운 기능 관련 label Jan 26, 2023
@jun108059 jun108059 added this to the Sprint-2 milestone Jan 26, 2023
@jun108059 jun108059 self-assigned this Jan 26, 2023
@jun108059 jun108059 merged commit 599f6ef into main Jan 26, 2023
@jun108059 jun108059 deleted the feature/30 branch January 26, 2023 15:15
@jun108059 jun108059 mentioned this pull request Mar 9, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 새로운 기능 관련
Development

Successfully merging this pull request may close these issues.

[BE] 좋아요 등록/삭제 API
1 participant