Skip to content

Commit

Permalink
feat: BookmarkApi 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonjy committed Apr 15, 2024
1 parent 7e6c6c3 commit 586cc0e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.rollthedice.backend.domain.bookmark.api;

import com.rollthedice.backend.domain.news.dto.response.NewsResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface BookmarkApi {

@Operation(
summary = "북마크 전체 조회",
description = "북마크한 뉴스를 전체 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"bookmark"}
)
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "OK"
)
}
)
List<NewsResponse> getBookmarked(
@Parameter
Pageable pageable
);

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rollthedice.backend.domain.bookmark.controller;
package com.rollthedice.backend.domain.bookmark.api;

import com.rollthedice.backend.domain.bookmark.service.BookmarkService;
import com.rollthedice.backend.domain.news.dto.response.NewsResponse;
Expand All @@ -15,11 +15,12 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("bookmark")
public class BookmarkController {
public class BookmarkController implements BookmarkApi {
private final BookmarkService bookmarkService;

@ResponseStatus(HttpStatus.OK)
@GetMapping("")
@Override
public List<NewsResponse> getBookmarked(final Pageable pageable) {
return bookmarkService.getBookmarkedNews(pageable);
}
Expand Down

0 comments on commit 586cc0e

Please sign in to comment.