moving models to one file for convenience

This commit is contained in:
2025-12-10 23:04:43 +00:00
parent d7cfd274c0
commit 5e77b480f7
2 changed files with 10 additions and 17 deletions

View File

@@ -6,6 +6,16 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
) )
type User struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"`
Username string `gorm:"uniqueIndex" json:"username"`
Password []byte `json:"-"`
Admin bool `json:"admin"`
}
type Post struct { type Post struct {
ID uint `gorm:"primarykey" json:"id"` ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"createdAt"` CreatedAt time.Time `json:"createdAt"`

View File

@@ -1,17 +0,0 @@
package models
import (
"time"
"gorm.io/gorm"
)
type User struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"`
Username string `gorm:"uniqueIndex" json:"username"`
Password []byte `json:"-"`
Admin bool `json:"admin"`
}