refac: renamed 'post' -> 'article'

This commit is contained in:
Florian Sylvain
2025-11-17 19:27:48 +01:00
parent cb9a431488
commit b470bfcc67
44 changed files with 701 additions and 967 deletions
@@ -1,16 +1,17 @@
package models
import (
"gorm.io/gorm"
"time"
"gorm.io/gorm"
)
type Post struct {
type Article struct {
gorm.Model
ID uint32 `gorm:"primary_key;auto_increment;not_null"`
Title string
Body string
Images []*Image `gorm:"many2many:post_images;"`
Images []*Image `gorm:"many2many:article_images;"`
IsOnline bool `gorm:"not_null;default:false"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
+3 -2
View File
@@ -1,15 +1,16 @@
package models
import (
"gorm.io/gorm"
"time"
"gorm.io/gorm"
)
type Image struct {
gorm.Model
ID uint32 `gorm:"primary_key;auto_increment;not_null"`
Path string
PostID uint32
ArticleID uint32
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
}