medol-be/app/module/article_comments/mapper/article_comments.mapper.go

24 lines
775 B
Go
Raw Normal View History

package mapper
import (
"go-humas-be/app/database/entity"
res "go-humas-be/app/module/article_comments/response"
)
func ArticleCommentsResponseMapper(articleCommentsReq *entity.ArticleComments) (articleCommentsRes *res.ArticleCommentsResponse) {
if articleCommentsReq != nil {
articleCommentsRes = &res.ArticleCommentsResponse{
ID: articleCommentsReq.ID,
Message: articleCommentsReq.Message,
ArticleId: articleCommentsReq.ArticleId,
CommentFrom: articleCommentsReq.CommentFrom,
ParentId: articleCommentsReq.ParentId,
IsPublic: articleCommentsReq.IsPublic,
IsActive: articleCommentsReq.IsActive,
CreatedAt: articleCommentsReq.CreatedAt,
UpdatedAt: articleCommentsReq.UpdatedAt,
}
}
return articleCommentsRes
}