File tree Expand file tree Collapse file tree
src/main/java/com/bigpicture/moonrabbit/domain/user/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import com .bigpicture .moonrabbit .domain .user .service .UserService ;
99import com .bigpicture .moonrabbit .global .auth .jwt .dto .JwtDTO ;
1010import io .swagger .v3 .oas .annotations .Operation ;
11+ import io .swagger .v3 .oas .annotations .media .Schema ;
1112import jakarta .servlet .http .HttpServletResponse ;
1213import jakarta .validation .Valid ;
14+ import jakarta .validation .constraints .NotBlank ;
1315import lombok .RequiredArgsConstructor ;
1416import org .springframework .data .domain .Page ;
1517import org .springframework .http .HttpStatus ;
@@ -167,4 +169,19 @@ public ResponseEntity<UserResponseDTO> updateProfileImage(
167169 return new ResponseEntity <>(responseDTO , HttpStatus .OK );
168170 }
169171
172+ // Access Token 재발급 요청 DTO
173+ public record ReissueRequestDTO (
174+ @ NotBlank (message = "Refresh Token은 필수입니다." )
175+ @ Schema (description = "리프레시 토큰" , example = "eyJhbGciOiJIUzI1NiJ9..." )
176+ String refreshToken
177+ ) {}
178+
179+ // 토큰 재발급 API
180+ @ PostMapping ("/reissue" )
181+ @ Operation (summary = "Access Token 재발급" , description = "유효한 Refresh Token을 사용하여 Access Token을 재발급합니다." )
182+ public ResponseEntity <JwtDTO > reissueToken (@ Valid @ RequestBody ReissueRequestDTO requestDTO ) {
183+ JwtDTO jwtDTO = userService .reissueAccessToken (requestDTO .refreshToken ());
184+ return new ResponseEntity <>(jwtDTO , HttpStatus .OK );
185+ }
186+
170187}
You can’t perform that action at this time.
0 commit comments