2025-02-26 22:28:19 +08:00
|
|
|
package database
|
|
|
|
|
|
2025-03-02 04:36:17 +08:00
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
2025-02-26 22:28:19 +08:00
|
|
|
|
2025-03-01 20:00:54 +08:00
|
|
|
type Category struct {
|
2025-03-07 23:26:54 +08:00
|
|
|
ID string `gorm:"primaryKey" json:"id"`
|
|
|
|
|
Name string `gorm:"not null" json:"name"`
|
|
|
|
|
Code string `gorm:"not null;unique" json:"code"`
|
|
|
|
|
Description string `gorm:"default:null" json:"description"`
|
|
|
|
|
Sequence int `gorm:"default:null" json:"sequence"`
|
|
|
|
|
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
|
|
|
|
|
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
|
|
|
|
|
DeletedAt time.Time `gorm:"default:null" json:"deleted_at"`
|
2025-03-05 23:55:41 +08:00
|
|
|
|
|
|
|
|
News []News `gorm:"many2many:news_categories" json:"news"`
|
2025-03-02 04:36:17 +08:00
|
|
|
}
|