mirror of
https://github.com/Damillora/Yuriko.git
synced 2024-11-21 09:17:32 +00:00
Add total to search API
This commit is contained in:
parent
eb25a333e7
commit
14d04c649f
@ -12,6 +12,7 @@ import (
|
||||
type SearchResult struct {
|
||||
Page int `json:"page"`
|
||||
PerPage int `json:"per_page"`
|
||||
Total int `json:"total"`
|
||||
Result []models.ArticleSearchResult `json:"result"`
|
||||
}
|
||||
|
||||
@ -44,6 +45,7 @@ func SearchArticles(q string, page int) (SearchResult, error) {
|
||||
return SearchResult{
|
||||
Page: page,
|
||||
PerPage: perPage,
|
||||
Total: searchResult.Found,
|
||||
Result: articles,
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user