mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
clean: first clean archi sandbox implementation
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package article
|
||||
|
||||
type Article struct {
|
||||
Id int
|
||||
Title string
|
||||
Body string
|
||||
createdAt string
|
||||
updatedAt string
|
||||
}
|
||||
|
||||
func FromApi(
|
||||
title string,
|
||||
body string,
|
||||
) Article {
|
||||
return Article{
|
||||
Title: title,
|
||||
Body: body,
|
||||
}
|
||||
}
|
||||
|
||||
func FromDb(
|
||||
id int,
|
||||
title string,
|
||||
body string,
|
||||
createdAt string,
|
||||
updatedAt string,
|
||||
) Article {
|
||||
return Article{
|
||||
Id: id,
|
||||
Title: title,
|
||||
Body: body,
|
||||
createdAt: createdAt,
|
||||
updatedAt: updatedAt,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user