-
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.
- Loading branch information
jhsong76
committed
Jan 2, 2024
1 parent
66816fd
commit 2f44b9a
Showing
4 changed files
with
63 additions
and
9 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
36 changes: 36 additions & 0 deletions
36
src/main/java/com/hackerton/demo/domain/keyword/KeywordController.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,36 @@ | ||
package com.hackerton.demo.domain.keyword; | ||
|
||
import com.hackerton.demo.domain.common.ApiResponse; | ||
import com.hackerton.demo.domain.common.ApiResponseStatus; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
|
||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
@Slf4j | ||
@RequestMapping("/keyword") | ||
public class KeywordController { | ||
private final ChatService chatService; | ||
|
||
@GetMapping("/{userId}") | ||
@Operation(summary = "해당 유저의 오늘의 키워드 조회 ", description = "pathvariable로 들어오는 유저의 키워드를 조회합니다." | ||
+ "토큰 미구현으로 1~6번 인덱스 유저 조회 가능.") | ||
@ApiResponses({ | ||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "GET_SUCCESS", description = "조회 성공"), | ||
}) | ||
public ResponseEntity<ApiResponse<List<KeywordDto>>> getKeyword(@PathVariable(name = "userId") Long userId) { | ||
List<KeywordDto> keywordDtos = chatService.getKeywordList(userId); | ||
ApiResponse<List<KeywordDto>> apiResponse = new ApiResponse<>(ApiResponseStatus.GET_SUCCESS, keywordDtos); | ||
return ResponseEntity.ok(apiResponse); | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/hackerton/demo/domain/keyword/KeywordRespository.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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package com.hackerton.demo.domain.keyword; | ||
|
||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface KeywordRespository extends JpaRepository<Keyword, Long> { | ||
|
||
List<Keyword> findAllByUserId(Long userId); | ||
} |