From bc14acc2c2986698d85e86de576f1e0b8cb761c8 Mon Sep 17 00:00:00 2001 From: CYY1007 Date: Sun, 18 Feb 2024 11:16:56 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Feat=20:=20=ED=91=B8=EC=89=AC?= =?UTF-8?q?=EC=95=8C=EB=9E=8C=20=ED=97=88=EC=9A=A9=20V2=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/presentation/MemberV2Api.java | 29 +++++++++++++++++++ .../handler/JwtAuthenticationEntryPoint.java | 4 +-- .../src/main/resources/application.yml | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberV2Api.java b/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberV2Api.java index 9714ecd..dc824c0 100644 --- a/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberV2Api.java +++ b/Briefing-Api/src/main/java/com/example/briefingapi/member/presentation/MemberV2Api.java @@ -47,6 +47,35 @@ public CommonResponse loginV2( return CommonResponse.onSuccess(memberFacade.login(socialType, request)); } + @Operation(summary = "02-04 Member\uD83D\uDC64 푸쉬 알람 허용/거부 설정 V2 ", description = "푸쉬 알람 허용/거부 설정입니다.") + @PostMapping("/members/alarms") + @ApiResponses({ + @ApiResponse(responseCode = "1000", description = "OK, 성공"), + @ApiResponse( + responseCode = "AUTH003", + description = "access 토큰을 주세요!", + content = @Content(schema = @Schema(implementation = CommonResponse.class))), + @ApiResponse( + responseCode = "AUTH004", + description = "acess 토큰 만료", + content = @Content(schema = @Schema(implementation = CommonResponse.class))), + @ApiResponse( + responseCode = "AUTH006", + description = "acess 토큰 모양이 이상함", + content = @Content(schema = @Schema(implementation = CommonResponse.class))), + @ApiResponse( + responseCode = "MEMBER_001", + description = "사용자가 존재하지 않습니다.", + content = @Content(schema = @Schema(implementation = CommonResponse.class))), + }) + public CommonResponse subscribeDailyPush( + @Valid @RequestBody MemberRequest.ToggleDailyPushAlarmDTO request, + @Parameter(hidden = true) @AuthMember Member member + ){ + memberFacade.subScribeDailyPush(request,member); + return CommonResponse.onSuccess(); + } + @Operation( summary = "02-01 Member\uD83D\uDC64 accessToken 재발급 받기 V2", description = "accessToken 만료 시 refreshToken으로 재발급을 받는 API 입니다.") diff --git a/Briefing-Api/src/main/java/com/example/briefingapi/security/handler/JwtAuthenticationEntryPoint.java b/Briefing-Api/src/main/java/com/example/briefingapi/security/handler/JwtAuthenticationEntryPoint.java index 53fffb5..f69d3cc 100644 --- a/Briefing-Api/src/main/java/com/example/briefingapi/security/handler/JwtAuthenticationEntryPoint.java +++ b/Briefing-Api/src/main/java/com/example/briefingapi/security/handler/JwtAuthenticationEntryPoint.java @@ -31,8 +31,8 @@ public void commence( ApiErrorResult apiErrorResult = ApiErrorResult.builder() .isSuccess(false) - .code(ErrorCode._UNAUTHORIZED.getCode()) - .message(ErrorCode._UNAUTHORIZED.getMessage()) + .code(ErrorCode.UNAUTHORIZED_EXCEPTION.getCode()) + .message(ErrorCode.UNAUTHORIZED_EXCEPTION.getMessage()) .result(null) .build(); try { diff --git a/Briefing-Api/src/main/resources/application.yml b/Briefing-Api/src/main/resources/application.yml index bd7503c..8dd35fb 100644 --- a/Briefing-Api/src/main/resources/application.yml +++ b/Briefing-Api/src/main/resources/application.yml @@ -66,7 +66,7 @@ jwt: # dev server secret: ${JWT_SECRET} authorities-key: authoritiesKey - access-token-validity-in-seconds: 30000 + access-token-validity-in-seconds: 1200000 refresh-token-validity-in-seconds: 1210000000 # 14 d openai: