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
Implement #53 Get popular board list #54
Implement #53 Get popular board list #54
Conversation
Co-authored-by: wagaru <wagaru@hotmail.com>
Co-authored-by: wagaru <wagaru@hotmail.com>
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.
LGTM
LGTM |
@@ -86,6 +86,10 @@ func (usecase *MockUsecase) GetBoards(ctx context.Context, userID string) []bbs. | |||
panic("Not implemented") | |||
} | |||
|
|||
func (usecase *MockUsecase) GetPopularBoards(ctx context.Context) []bbs.BoardRecord { | |||
panic("Not implemented") |
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.
這邊能不能不要用 panic, 而是return error?
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.
好,待會改
internal/usecase/usecase.go
Outdated
@@ -24,6 +24,8 @@ type Usecase interface { | |||
GetBoardByID(ctx context.Context, boardID string) (bbs.BoardRecord, error) | |||
// GetBoards returns all board records | |||
GetBoards(ctx context.Context, userID string) []bbs.BoardRecord | |||
// GetPopularBoards returns top 100 popular board records | |||
GetPopularBoards(ctx context.Context) []bbs.BoardRecord |
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.
回傳的部分建議增加 error
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.
好~
已修改完畢,那因為目前 GetPopularBoards 太過簡單,所以目前 error 值都回傳 nil,之後如果排序的部分可以實作或是 usecase.repo.GetBoards 也有回傳 error 值的話再更改。 |
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.
LGTM
Some fields are missing in the current implementation since go-bbs does not export those methods yet. Use a mock to fill the fields
Implement issue #58 [主線] [PTT] 實作個人看板的使用者資訊 (repository)
add route classes test
添加 openapi 支援
📝 相關的 issue / Related Issues
⛏ 變更內容 / Details of Changes