legalgo-BE-go/database/category_model.go

22 lines
710 B
Go
Raw Normal View History

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-02 04:36:17 +08:00
ID string `gorm:"primaryKey" json:"id"`
2025-03-01 21:27:28 +08:00
Code string `gorm:"not null;unique" json:"code"`
2025-02-26 22:28:19 +08:00
Name string `gorm:"not null" json:"name"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}
2025-03-02 04:36:17 +08:00
type CategoryModel struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `gorm:"not null;unique" json:"name"`
Code string `gorm:"not null" json:"code"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}