34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package mapper
|
|
|
|
import (
|
|
"go-humas-be/app/database/entity"
|
|
res "go-humas-be/app/module/articles/response"
|
|
)
|
|
|
|
func ArticlesResponseMapper(articlesReq *entity.Articles) (articlesRes *res.ArticlesResponse) {
|
|
if articlesReq != nil {
|
|
articlesRes = &res.ArticlesResponse{
|
|
ID: articlesReq.ID,
|
|
Title: articlesReq.Title,
|
|
Slug: articlesReq.Slug,
|
|
Description: articlesReq.Description,
|
|
HtmlDescription: articlesReq.HtmlDescription,
|
|
TypeId: articlesReq.TypeId,
|
|
Tags: articlesReq.Tags,
|
|
ThumbnailPath: articlesReq.ThumbnailPath,
|
|
ThumbnailUrl: articlesReq.ThumbnailUrl,
|
|
PageUrl: articlesReq.PageUrl,
|
|
CreatedById: articlesReq.CreatedById,
|
|
ShareCount: articlesReq.ShareCount,
|
|
ViewCount: articlesReq.ViewCount,
|
|
DownloadCount: articlesReq.DownloadCount,
|
|
StatusId: articlesReq.StatusId,
|
|
IsPublish: articlesReq.IsPublish,
|
|
PublishedAt: articlesReq.PublishedAt,
|
|
IsActive: articlesReq.IsActive,
|
|
CreatedAt: articlesReq.CreatedAt,
|
|
UpdatedAt: articlesReq.UpdatedAt,
|
|
}
|
|
}
|
|
return articlesRes
|
|
} |