mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
feat: migrated prisma -> gorm
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package article
|
||||
|
||||
import "time"
|
||||
|
||||
type Article struct {
|
||||
Id int `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Body string `json:"body"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
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(
|
||||
@@ -19,14 +21,14 @@ func FromApi(
|
||||
}
|
||||
|
||||
func FromDb(
|
||||
id int,
|
||||
id uint32,
|
||||
title string,
|
||||
body string,
|
||||
createdAt string,
|
||||
updatedAt string,
|
||||
createdAt time.Time,
|
||||
updatedAt time.Time,
|
||||
) Article {
|
||||
return Article{
|
||||
Id: id,
|
||||
ID: id,
|
||||
Title: title,
|
||||
Body: body,
|
||||
CreatedAt: createdAt,
|
||||
|
||||
Reference in New Issue
Block a user