Skip to content

Commit

Permalink
Merge pull request #90 from Do-Farming/feat/minjoo/addPush/#82
Browse files Browse the repository at this point in the history
add get Daily Challenge
  • Loading branch information
Minjoo-kang123 authored Jul 8, 2024
2 parents e7b11b8 + 8a47bec commit 15ec097
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Getter
@NoArgsConstructor
@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class CustomerAuthenticationFilter extends OncePerRequestFilter {
private final JwtTokenProvider tokenProvider;
private final List<String> 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Integer> getChallenge() {
int response = challengeRecordService.getChallenge();
return BaseResponse.success(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit 15ec097

Please sign in to comment.