feat: add SearchPostListDTO for search responses
This commit is contained in:
@@ -29,6 +29,14 @@ type PostListDTO struct {
|
|||||||
Offset int `json:"offset"`
|
Offset int `json:"offset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SearchPostListDTO struct {
|
||||||
|
Posts []PostDTO `json:"posts"`
|
||||||
|
Count int `json:"count"`
|
||||||
|
Query string `json:"query"`
|
||||||
|
Limit int `json:"limit"`
|
||||||
|
Offset int `json:"offset"`
|
||||||
|
}
|
||||||
|
|
||||||
func ToPostDTO(post *database.Post) PostDTO {
|
func ToPostDTO(post *database.Post) PostDTO {
|
||||||
if post == nil {
|
if post == nil {
|
||||||
return PostDTO{}
|
return PostDTO{}
|
||||||
|
|||||||
Reference in New Issue
Block a user