feat: Sites feature backend
This commit is contained in:
1 parent
45fcbd890d
commit
a11338094e
98 files changed
+5365
-214
No files matched your search
@@ -11,6 +11,7 @@ func ArticleToDomain(m models.Article) article.Article {
|
||||
Title: m.Title,
|
||||
Body: m.Body,
|
||||
IsOnline: m.IsOnline,
|
||||
SiteID: m.SiteID,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
@@ -21,6 +22,7 @@ func ArticleToModel(a article.Article) models.Article {
|
||||
Title: a.Title,
|
||||
Body: a.Body,
|
||||
IsOnline: a.IsOnline,
|
||||
SiteID: a.SiteID,
|
||||
CreatedAt: a.CreatedAt,
|
||||
UpdatedAt: a.UpdatedAt,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package mappers
|
||||
|
||||
import (
|
||||
"RenewCMS/internal/domain/site"
|
||||
"RenewCMS/internal/infrastructure/persistence/models"
|
||||
)
|
||||
|
||||
func SiteToDomain(m models.Site, articleCount int) site.Site {
|
||||
return site.Site{
|
||||
ID: m.ID,
|
||||
Name: m.Name,
|
||||
Key: m.Key,
|
||||
BaseURL: m.BaseURL,
|
||||
DefaultSocialImageID: m.DefaultSocialImageID,
|
||||
DefaultRobots: m.DefaultRobots,
|
||||
Locale: m.Locale,
|
||||
IsDefault: m.IsDefault,
|
||||
ArticleCount: articleCount,
|
||||
}
|
||||
}
|
||||
|
||||
func SiteToModel(s site.Site) models.Site {
|
||||
return models.Site{
|
||||
ID: s.ID,
|
||||
Name: s.Name,
|
||||
Key: s.Key,
|
||||
BaseURL: s.BaseURL,
|
||||
DefaultSocialImageID: s.DefaultSocialImageID,
|
||||
DefaultRobots: s.DefaultRobots,
|
||||
Locale: s.Locale,
|
||||
IsDefault: s.IsDefault,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user