Skip to content

Conversation

YukiOnishi1129
Copy link
Owner

🎫 Ticket

📝 What we have responded to

📝 Items/perspectives to be checked

📷 Screenshots of the modifications

before after

@github-actions github-actions bot added the bff apollo-gateway label Jan 18, 2025
@YukiOnishi1129 YukiOnishi1129 requested a review from Copilot March 8, 2025 06:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR introduces several changes and refactorings across the bookmark, content, and favorite services. Key changes include refactoring DTOs and adapter interfaces to use new input structs instead of protocol buffer requests, updating repository function names for consistency (e.g. GetBookmarks is renamed to ListBookmark), and adding new functions for retrieving articles by ID and without feeds.

Reviewed Changes

File Description
micro-service/bookmark-service/internal/adapter/persistence_adapter/bookmark_dto.go Added DTO structs for bookmark operations.
micro-service/content-service/internal/adapter/persistence_adapter/article.go Added GetArticleByID and GetArticleWithoutFeeds functions in the article adapter.
micro-service/bookmark-service/internal/adapter/external_adapter/favorite.go Renamed and refactored favorite external adapter functions.
micro-service/bookmark-service/internal/adapter/persistence_adapter/bookmark.go Refactored bookmark persistence adapter methods to use new DTOs and interfaces.
micro-service/bookmark-service/internal/application/usecase/bookmark.go Updated the use case layer to call the new adapter methods and integrate bookmark, content, and favorite data.
micro-service/bookmark-service/* Other files include test changes, updated mocks, and repository interface renames to align with the new naming scheme.

Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.

return &ListBookmarkOutputDTO{}, err
}

outBookmarks := make([]*BookmarkDTO, len(res))
Copy link

Copilot AI Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preallocating the 'outBookmarks' slice with a fixed length and then using 'append' causes the slice to include nil elements at the beginning. Instead, initialize the slice with length 0 and the appropriate capacity via 'make([]*BookmarkDTO, 0, len(res))' or assign elements directly by index.

Suggested change
outBookmarks := make([]*BookmarkDTO, len(res))
outBookmarks := make([]*BookmarkDTO, 0, len(res))

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bff apollo-gateway bookmark-service content-service content-service favorite-service favorite-service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: rpc: favoriteにコメントをつける [Feature]: rpc: bookmarkにコメントをつける

1 participant