-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/notify-#36
- Loading branch information
Showing
47 changed files
with
855 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/ripple/BE/auth/controller/AuthControllerV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.ripple.BE.auth.controller; | ||
|
||
import com.ripple.BE.auth.service.AuthService; | ||
import com.ripple.BE.global.dto.response.ApiResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
@RequestMapping("/api/v2/auth") | ||
@Tag(name = "Auth V2", description = "인증 API (v2)") | ||
public class AuthControllerV2 { | ||
|
||
private final AuthService authService; | ||
|
||
@Operation(summary = "카카오 로그인 (v2)", description = "네이티브 앱에서 카카오 로그인을 진행합니다.") | ||
@GetMapping("/login/kakao") | ||
public ResponseEntity<ApiResponse<Object>> kakaoLogin(@RequestParam String accessToken) { | ||
|
||
String jwtToken = authService.kakaoLoginV2(accessToken); | ||
|
||
return ResponseEntity.status(HttpStatus.OK).body(ApiResponse.from(jwtToken)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ripple/BE/news/dto/response/NewsPreviewResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.ripple.BE.news.dto.response; | ||
|
||
import com.ripple.BE.global.utils.RelativeTimeFormatter; | ||
import com.ripple.BE.news.dto.NewsDTO; | ||
|
||
public record NewsPreviewResponse( | ||
Long id, | ||
String title, | ||
String content, | ||
String publisher, | ||
long views, | ||
String url, | ||
String category, | ||
Boolean isScraped, | ||
String createdDate) { | ||
|
||
public static NewsPreviewResponse toNewsPreviewResponse(NewsDTO newDTO) { | ||
return new NewsPreviewResponse( | ||
newDTO.id(), | ||
newDTO.title(), | ||
newDTO.content(), | ||
newDTO.publisher(), | ||
newDTO.views(), | ||
newDTO.url(), | ||
newDTO.category().toString(), | ||
newDTO.isScraped(), | ||
RelativeTimeFormatter.formatRelativeTime(newDTO.createdDate())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.