定义model

This commit is contained in:
2025-10-03 20:46:04 +08:00
parent 6cc6d719e1
commit 25e9e07cc8

View File

@@ -40,7 +40,6 @@ type PigBatch struct {
CurrentCount int `gorm:"not null;comment:当前存栏数量"` CurrentCount int `gorm:"not null;comment:当前存栏数量"`
CurrentSickCount int `gorm:"not null;default:0;comment:当前病猪数量"` CurrentSickCount int `gorm:"not null;default:0;comment:当前病猪数量"`
Status PigBatchStatus `gorm:"size:20;not null;index;comment:批次状态"` Status PigBatchStatus `gorm:"size:20;not null;index;comment:批次状态"`
Pens []Pen `gorm:"foreignKey:PigBatchID;comment:所在圈舍ID"`
} }
func (PigBatch) TableName() string { func (PigBatch) TableName() string {