feat: Sites feature backend
This commit is contained in:
1 parent
45fcbd890d
commit
a11338094e
98 files changed
+5365
-214
No files matched your search
@@ -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