book_categories.go 1.0 KB

1234567891011121314151617181920212223242526
  1. // Code generated by gorm.io/gen. DO NOT EDIT.
  2. // Code generated by gorm.io/gen. DO NOT EDIT.
  3. // Code generated by gorm.io/gen. DO NOT EDIT.
  4. package entity
  5. import (
  6. "time"
  7. )
  8. const TableNameBookCategory = "book_categories"
  9. // BookCategory mapped from table <book_categories>
  10. type BookCategory struct {
  11. ID int64 `gorm:"column:id;type:int;primaryKey;autoIncrement:true" json:"id"` // ID
  12. BookID int64 `gorm:"column:book_id;type:int;not null" json:"book_id"` // 书籍ID
  13. CategoryID *int64 `gorm:"column:category_id;type:int" json:"category_id"` // 分类ID
  14. CreateAt time.Time `gorm:"column:create_at;type:timestamp;not null" json:"create_at"` // 创建时间
  15. UpdateAt time.Time `gorm:"column:update_at;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"update_at"` // 更新时间
  16. }
  17. // TableName BookCategory's table name
  18. func (*BookCategory) TableName() string {
  19. return TableNameBookCategory
  20. }