-
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.
Browse files
Browse the repository at this point in the history
Feat(#21): 게임컨텐츠 api 구현
- Loading branch information
Showing
8 changed files
with
137 additions
and
8 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
40 changes: 40 additions & 0 deletions
40
src/main/java/io/urdego/urdego_content_service/api/controller/ContentGameController.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,40 @@ | ||
package io.urdego.urdego_content_service.api.controller; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import io.urdego.urdego_content_service.api.controller.dto.response.ContentResponse; | ||
import io.urdego.urdego_content_service.domain.service.ContentService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/api/content-service") | ||
@RequiredArgsConstructor | ||
public class ContentGameController { | ||
|
||
private final ContentService contentService; | ||
|
||
|
||
@Tag(name = "백엔드 API") | ||
@Operation(summary = "컨텐츠 개별 조회", description = "contentId로 컨텐츠 세부 조회") | ||
@GetMapping(value = "/content") | ||
public ResponseEntity<ContentResponse> getContent(@RequestParam Long contentId) { | ||
|
||
|
||
ContentResponse responses = contentService.getContent(contentId); | ||
return ResponseEntity.ok().body(responses); | ||
} | ||
|
||
@Tag(name = "백엔드 API") | ||
@Operation(summary = "컨텐츠 랜덤 조회", description = "어데고 컨텐츠20개 랜덤 조회") | ||
@GetMapping(value = "/urdego-content") | ||
public ResponseEntity<List<ContentResponse>> getUrdegoContents(@RequestParam int counts) { | ||
|
||
List<ContentResponse> responses = contentService.getUrdegoContents(counts); | ||
return ResponseEntity.ok().body(responses); | ||
} | ||
} |
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