Files
RenewCMS/domain/post/post.go
T
Florian Sylvain 554fdc1989 clean: Article to Post in domain and related use cases
Renamed the 'Article' domain to 'Post' in order to better reflect the purpose and utility of the object. The change involved renaming all related use cases, classes, and other references from 'Article' to 'Post' and updating all functions and data types to work with Posts instead of Articles.
2023-09-06 01:56:27 +02:00

38 lines
570 B
Go

package post
import "time"
type Post struct {
ID uint32 `json:"id"`
Title string `json:"title"`
Body string `json:"body"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func FromApi(
title string,
body string,
) Post {
return Post{
Title: title,
Body: body,
}
}
func FromDb(
id uint32,
title string,
body string,
createdAt time.Time,
updatedAt time.Time,
) Post {
return Post{
ID: id,
Title: title,
Body: body,
CreatedAt: createdAt,
UpdatedAt: updatedAt,
}
}