Skip to content

feat: implement Presentation layer for favorite heritages list API / お気に入り一覧・IDs取得APIのPresentation層実装 #557

Description

@zigzagdev

Parent Issue / 親Issue

#555

Motivation / 目的

Implement the Controller and routes for listing favorite heritages and fetching favorite ids, as part of #555.

お気に入り一覧・ID一覧取得API(#555)のPresentation層として、Controllerとエンドポイントを実装します。

What to do / 実施内容

  • FavoriteController
    • getMyFavorites(): ListMyFavoritesUseCase を呼び出す
      • 200 with the list (empty array when none)
    • getMyFavoriteIds(): GetFavoriteHeritageIdsUseCase を呼び出す
      • 200 with { "world_heritage_ids": [...] }

Routes

  • GET /api/v1/users/me/favorites
  • GET /api/v1/users/me/favorites/ids

全て auth:sanctum ミドルウェア必須。ユーザーIDは認証済みユーザーから取得する。

Tests / テスト

  • test_getMyFavorites_returns_200_with_list
  • test_getMyFavorites_returns_200_with_empty_list_when_none
  • test_getMyFavoriteIds_returns_200_with_ids
  • test_getMyFavoriteIds_returns_200_with_empty_array_when_none

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions