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: