28 lines
552 B
Go
28 lines
552 B
Go
package mappers
|
|
|
|
import (
|
|
"RenewCMS/internal/domain/article"
|
|
"RenewCMS/internal/infrastructure/persistence/models"
|
|
)
|
|
|
|
func ArticleToDomain(m models.Article) article.Article {
|
|
return article.Article{
|
|
ID: m.ID,
|
|
Title: m.Title,
|
|
Body: m.Body,
|
|
IsOnline: m.IsOnline,
|
|
CreatedAt: m.CreatedAt,
|
|
UpdatedAt: m.UpdatedAt,
|
|
}
|
|
}
|
|
|
|
func ArticleToModel(a article.Article) models.Article {
|
|
return models.Article{
|
|
Title: a.Title,
|
|
Body: a.Body,
|
|
IsOnline: a.IsOnline,
|
|
CreatedAt: a.CreatedAt,
|
|
UpdatedAt: a.UpdatedAt,
|
|
}
|
|
}
|