-
Notifications
You must be signed in to change notification settings - Fork 1
feature(micro): fix bookmar and favorite comment rpc #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feature(micro): fix bookmar and favorite comment rpc #289
Conversation
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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.
outBookmarks := make([]*BookmarkDTO, len(res)) | |
outBookmarks := make([]*BookmarkDTO, 0, len(res)) |
Copilot uses AI. Check for mistakes.
🎫 Ticket
📝 What we have responded to
📝 Items/perspectives to be checked
📷 Screenshots of the modifications