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

포인트 기능 수정 #78

Merged
merged 15 commits into from
Nov 4, 2023
Merged

포인트 기능 수정 #78

merged 15 commits into from
Nov 4, 2023

Conversation

13wjdgk
Copy link
Contributor

@13wjdgk 13wjdgk commented Nov 3, 2023

Changes 📝

  • 포인트 적립 기능 추가

Details 🌼

  • 혈당,체중,운동 1일 1회 등록시 포인트 적립
    • 1일 1회 등록시 혈당 300원, 체중 200원, 운동 200원 적립
  • 접속 포인트 500원 수정
  • 상품 금액권 3천원 추가(GS25,다이소)

Check List ☑️

  • 테스트 코드를 통과했다.
  • merge할 브랜치의 위치를 확인했다. (main ❌)
  • Assignee를 지정했다.
  • Label을 지정했다.

@13wjdgk 13wjdgk self-assigned this Nov 3, 2023
@13wjdgk 13wjdgk added refactoring 리팩토링 feature 기능 labels Nov 3, 2023

This comment has been minimized.

@13wjdgk 13wjdgk changed the title Feat/point product 포인트 기능 수정 Nov 3, 2023
* @since 1.3.0
*/
@Query("SELECT count(h) FROM HealthMetric h WHERE h.healthMetricId.oauthId = ?1 AND h.groupCode = ?2 AND h.healthMetricId.createdAt = ?3")
int findByGroupCode(String oauthId, GroupCode groupCode, LocalDate createdAt);
Copy link
Member

Choose a reason for hiding this comment

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

P3) 메서드에 무엇을 조회하는지 명시되어있으면 좋겠어요 그리고 JavaDoc은 "건강지표 조회"인데 쿼리는 count()를 리턴하다보니 혼동이 생깁니다!

* @since 1.3.0
*/
public static EarnPoint findByGroupCode(GroupCode groupCode) {
switch (groupCode) {
Copy link
Member

Choose a reason for hiding this comment

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

P4) java 12 버전부터 switch 문에서 람다를 사용할 수 있게 되었어요 현재 17 버전을 사용하고 있는 만큼 람다로 가독성을 올려보는 건 어떨까 생각합니다!

https://catch-me-java.tistory.com/31

public void addHealthMetricPoint(String oauthId, LocalDate date, GroupCode groupCode) {
User user = userSearchService.findUserByOauthId(oauthId);
int healthMetric = healthMetricSearchService.findByGroupCode(oauthId, groupCode, date);
if (healthMetric == 1) {
Copy link
Member

Choose a reason for hiding this comment

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

P3) 변수명이 수정되었으면 좋겠어요

Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage 89.29% Coverage (96.40% Estimated after merge)
  • Duplications 0.00% Duplicated Code (0.80% Estimated after merge)

Project ID: co-niverse_dangjang-backend_AYj2jZJELehUZAlqDvRk

View in SonarQube

Copy link
Member

@GIVEN53 GIVEN53 left a comment

Choose a reason for hiding this comment

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

LGTM 😊

@13wjdgk 13wjdgk merged commit a7d547c into dev Nov 4, 2023
1 check passed
@GIVEN53 GIVEN53 deleted the feat/pointProduct branch November 6, 2023 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 기능 refactoring 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants