diff --git a/Briefing-Api/src/main/java/com/example/briefingapi/briefing/implement/strategy/BriefingV1QueryStrategy.java b/Briefing-Api/src/main/java/com/example/briefingapi/briefing/implement/strategy/BriefingV1QueryStrategy.java index 98bb66c..86a8433 100644 --- a/Briefing-Api/src/main/java/com/example/briefingapi/briefing/implement/strategy/BriefingV1QueryStrategy.java +++ b/Briefing-Api/src/main/java/com/example/briefingapi/briefing/implement/strategy/BriefingV1QueryStrategy.java @@ -31,8 +31,7 @@ public List findBriefings(BriefingRequestParam.BriefingPreviewListPara briefingRepository.findAllByTypeAndCreatedAtBetweenOrderByRanks( params.getType(), startDateTime, endDateTime); if (briefingList.isEmpty()) { - briefingList = null; - briefingRepository.findTop10ByTypeOrderByCreatedAtDesc(BriefingType.SOCIAL); + briefingList = briefingRepository.findTop10ByTypeOrderByCreatedAtDesc(BriefingType.SOCIAL); } return briefingList; } diff --git a/Briefing-Api/src/main/java/com/example/briefingapi/fcm/presentation/FcmApi.java b/Briefing-Api/src/main/java/com/example/briefingapi/fcm/presentation/FcmApi.java index e41aef2..cb1ad5a 100644 --- a/Briefing-Api/src/main/java/com/example/briefingapi/fcm/presentation/FcmApi.java +++ b/Briefing-Api/src/main/java/com/example/briefingapi/fcm/presentation/FcmApi.java @@ -2,32 +2,38 @@ import com.example.briefingapi.fcm.implementation.FcmCommandService; import com.example.briefingapi.fcm.presentation.dto.FcmRequest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +@Tag(name = "06-Push-alarm πŸš€", description = "푸쉬 μ•Œλ¦Ό κ΄€λ ¨ API") @RestController @RequiredArgsConstructor -@RequestMapping("/fcms") +@RequestMapping("/pushs") public class FcmApi { private final FcmCommandService fcmCommandService; + @Operation(summary = "06-02 πŸš€[ν…ŒμŠ€νŠΈ] FCM ꡬ독 ν…ŒμŠ€νŠΈμš© API") @PostMapping("/subscribe") public String testFcmSubscribe(@RequestBody FcmRequest.FcmTokenDTO body){ fcmCommandService.subScribe("dailyPush",body.getToken()); return "response"; } + @Operation(summary = "06-03 πŸš€[ν…ŒμŠ€νŠΈ] FCM ꡬ독 μ·¨μ†Œ ν…ŒμŠ€νŠΈμš© API") @PostMapping("/unsubscribe") public String testFcmUnSubscribe(@RequestBody FcmRequest.FcmTokenDTO body){ fcmCommandService.unSubScribe("dailyPush",body.getToken()); return "response"; } - @PostMapping("/send") + @Operation(summary = "06-01 πŸš€[ν…ŒμŠ€νŠΈ] FCM 전솑 ν…ŒμŠ€νŠΈμš© API") + @PostMapping("/") public String testSendMessage(){ fcmCommandService.sendMessage("dailyPush"); return "response"; diff --git a/Briefing-Api/src/main/java/com/example/briefingapi/member/business/MemberFacade.java b/Briefing-Api/src/main/java/com/example/briefingapi/member/business/MemberFacade.java index a3db659..bd230dd 100644 --- a/Briefing-Api/src/main/java/com/example/briefingapi/member/business/MemberFacade.java +++ b/Briefing-Api/src/main/java/com/example/briefingapi/member/business/MemberFacade.java @@ -39,6 +39,9 @@ public class MemberFacade { @Value("${fcm.topic.daily-push}") private String dailyPushTopic; + @Value(("${fcm.permit-flag}")) + private Integer permitFlag; + private Member loginWithGoogle(String identityToken) { GoogleUserInfo googleUserInfo = googleOauth2Client.verifyToken(identityToken); Member member = @@ -103,7 +106,7 @@ public MemberResponse.QuitDTO quit(final Long memberId) { public void subScribeDailyPush(MemberRequest.ToggleDailyPushAlarmDTO request, Member member){ - if(request.getPermit().equals(1)){ + if(request.getPermit().equals(permitFlag)){ memberCommandService.storeFcmToken(request.getFcmToken(),member); fcmCommandService.subScribe(dailyPushTopic, request.getFcmToken()); } diff --git a/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberApi.java b/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberApi.java index c28dff4..33fa2d7 100644 --- a/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberApi.java +++ b/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberApi.java @@ -37,7 +37,7 @@ public class MemberApi { private final MemberFacade memberFacade; - @Operation(summary = "Member\uD83D\uDC64 ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•œ 토큰 λ°œκΈ‰ API", description = "ν…ŒμŠ€νŠΈ 용") + @Operation(summary = "02-05 Member\uD83D\uDC64 [ν…ŒμŠ€νŠΈ] ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•œ 토큰 λ°œκΈ‰ API", description = "ν…ŒμŠ€νŠΈ 용") @GetMapping("/members/auth/test") public CommonResponse testGenerateToken() { return CommonResponse.onSuccess(memberFacade.getTestToken()); diff --git a/Briefing-Api/src/main/resources/application.yml b/Briefing-Api/src/main/resources/application.yml index d948a1b..bb1eaee 100644 --- a/Briefing-Api/src/main/resources/application.yml +++ b/Briefing-Api/src/main/resources/application.yml @@ -20,6 +20,7 @@ swagger: password : ${SWAGGER_PASS} fcm: key: ${FCM_KEY} + permit-flag : 1 topic: daily-push : dailyPush ---