Added authorization
This commit is contained in:
parent
c3c3d65d32
commit
b96dd39795
50 changed files with 685 additions and 410 deletions
13
internal/interfaces/api/mapper/response_from_image_result.go
Normal file
13
internal/interfaces/api/mapper/response_from_image_result.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package mapper
|
||||
|
||||
import (
|
||||
"58team_blog/internal/application/common"
|
||||
"58team_blog/internal/interfaces/api/responses"
|
||||
)
|
||||
|
||||
func ResponseFromImageResult(result *common.ImageResult) responses.ImageResponse {
|
||||
return responses.ImageResponse{
|
||||
Id: result.Id.String(),
|
||||
Path: result.Path,
|
||||
}
|
||||
}
|
||||
|
|
@ -15,5 +15,7 @@ func ResponseFormPostFindByIdResult(result *queries.PostFindByIdResult) response
|
|||
Content: res.Content,
|
||||
CreatedAt: res.CreatedAt,
|
||||
UpdatedAt: res.UpdatedAt,
|
||||
Tags: res.Tags,
|
||||
Category: res.Category,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,12 @@ import (
|
|||
func itemFromResult(item *common.PostResult) responses.GetListPostResponseItem {
|
||||
return responses.GetListPostResponseItem{
|
||||
Id: item.Id.String(),
|
||||
UserId: item.UserId.String(),
|
||||
Title: item.Title,
|
||||
Description: item.Description,
|
||||
UpdatedAt: item.UpdatedAt.String(),
|
||||
Tags: item.Tags,
|
||||
Category: item.Category,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,5 +14,7 @@ func ResponseFromPostResult(result *common.PostResult) responses.PostResponse {
|
|||
Content: result.Content,
|
||||
CreatedAt: result.CreatedAt,
|
||||
UpdatedAt: result.UpdatedAt,
|
||||
Category: result.Category,
|
||||
Tags: result.Tags,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue