diff --git a/src/main/java/com/hana/api/account/dto/MakeTransactionDto.java b/src/main/java/com/hana/api/account/dto/MakeTransactionDto.java index 494b6d2..98a9733 100644 --- a/src/main/java/com/hana/api/account/dto/MakeTransactionDto.java +++ b/src/main/java/com/hana/api/account/dto/MakeTransactionDto.java @@ -7,6 +7,7 @@ import lombok.NoArgsConstructor; @AllArgsConstructor +@NoArgsConstructor @Getter @NoArgsConstructor @Builder diff --git a/src/main/java/com/hana/api/auth/filter/CustomerAuthenticationFilter.java b/src/main/java/com/hana/api/auth/filter/CustomerAuthenticationFilter.java index 7dec386..ed44765 100644 --- a/src/main/java/com/hana/api/auth/filter/CustomerAuthenticationFilter.java +++ b/src/main/java/com/hana/api/auth/filter/CustomerAuthenticationFilter.java @@ -24,7 +24,7 @@ public class CustomerAuthenticationFilter extends OncePerRequestFilter { private final JwtTokenProvider tokenProvider; private final List EXCLUDE_URL = List.of("/**", "/api/v1/auth", "/api/v1/customer/signup", "/favicon", - "/api/v1/send-notification", "/register-token","/api/send-notification", + "/api/v1/send-notification", "/register-token","/api/send-notification", "/api/v1/account/simple", "/api/v1/sms", "/swagger", "/v3", "/api/v1/developer", "/api/ocr","/api/gpt/generate-image","/api/gpt/chat"); @Override diff --git a/src/main/java/com/hana/api/challenge/controller/ChallengeController.java b/src/main/java/com/hana/api/challenge/controller/ChallengeController.java new file mode 100644 index 0000000..9da4cc2 --- /dev/null +++ b/src/main/java/com/hana/api/challenge/controller/ChallengeController.java @@ -0,0 +1,29 @@ +package com.hana.api.challenge.controller; + +import com.hana.api.auth.Auth; +import com.hana.api.challenge.dto.response.PedometerResponse; +import com.hana.api.challenge.service.ChallengeRecordService; +import com.hana.api.challenge.service.WalkChallengeService; +import com.hana.common.config.BaseResponse; +import io.swagger.v3.oas.annotations.Parameter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.UUID; + +@RestController +@RequestMapping("/api/v1/challenge") +@RequiredArgsConstructor +@Slf4j +public class ChallengeController { + + final ChallengeRecordService challengeRecordService; + + @GetMapping("/getChallenge") + public BaseResponse.SuccessResult getChallenge() { + int response = challengeRecordService.getChallenge(); + return BaseResponse.success(response); + } +} diff --git a/src/main/java/com/hana/api/challenge/service/ChallengeRecordService.java b/src/main/java/com/hana/api/challenge/service/ChallengeRecordService.java index e0e6134..0a24de4 100644 --- a/src/main/java/com/hana/api/challenge/service/ChallengeRecordService.java +++ b/src/main/java/com/hana/api/challenge/service/ChallengeRecordService.java @@ -3,12 +3,12 @@ import com.hana.api.card.entity.Card; import com.hana.api.challenge.entity.ChallengeRecord; import com.hana.api.challenge.repository.ChallengRecordRepository; +import com.hana.api.challenge.repository.ChallengeRecordRepository; import com.hana.api.firebase.service.PushNotificationService; import com.hana.api.group.entity.Group; import com.hana.api.group.repository.GroupRepository; import com.hana.api.groupMember.entity.GroupMember; import com.hana.api.groupMember.repository.GroupMemberRepository; -import com.hana.api.user.entity.User; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -23,9 +23,16 @@ public class ChallengeRecordService { final ChallengRecordRepository challengRecordRepository; + final ChallengeRecordRepository challengeRecordRepository; final GroupRepository groupRepository; final GroupMemberRepository groupMemberRepository; final PushNotificationService pushNotificationService; + + public int getChallenge(){ + return challengeRecordRepository.findByChallengeDate(LocalDate.now()).getChallengeType(); + } + + @Transactional public int insertDailyChallengeRecord() { LocalDate today = LocalDate.now();