category.go 689 B

1234567891011121314151617181920212223
  1. package model
  2. import (
  3. "time"
  4. "gorm.io/gorm"
  5. )
  6. // NewsCategory 对应 cy_news_category 表
  7. type NewsCategory struct {
  8. ID uint `gorm:"primaryKey"`
  9. ParentID uint `gorm:"column:parent_id;default:0;not null"`
  10. Name string `gorm:"column:name;size:50;not null"`
  11. Sort int `gorm:"column:sort;default:100;not null"`
  12. Status int8 `gorm:"column:status;default:1;not null"`
  13. CreateTime time.Time `gorm:"column:create_time"`
  14. UpdateTime time.Time `gorm:"column:update_time"`
  15. DeleteTime gorm.DeletedAt `gorm:"column:delete_time;index"`
  16. }
  17. func (NewsCategory) TableName() string {
  18. return "cy_news_category"
  19. }