Added migrations
This commit is contained in:
parent
4a16acc87e
commit
5b18009658
34 changed files with 929 additions and 154 deletions
|
|
@ -0,0 +1,25 @@
|
|||
package dto
|
||||
|
||||
import (
|
||||
"58team_blog/internal/application/common"
|
||||
"58team_blog/internal/application/queries"
|
||||
"58team_blog/internal/interfaces/api/responses"
|
||||
)
|
||||
|
||||
func itemFromResult(item *common.PostResult) responses.GetListPostResponseItem {
|
||||
return responses.GetListPostResponseItem{
|
||||
Id: item.Id.String(),
|
||||
Title: item.Title,
|
||||
Description: item.Description,
|
||||
}
|
||||
}
|
||||
|
||||
func ResponseFromPostGetAllResult(result *queries.PostGetAllResult) responses.GetListPostResponse {
|
||||
var resp []responses.GetListPostResponseItem
|
||||
|
||||
for _, r := range result.Result.Result {
|
||||
resp = append(resp, itemFromResult(r))
|
||||
}
|
||||
|
||||
return resp
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue