From aced495cd66cb680be7c924ddd95a0d5b3d806f4 Mon Sep 17 00:00:00 2001 From: huang <1724659546@qq.com> Date: Fri, 3 Oct 2025 20:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=B9=89model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/infra/models/pig.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/infra/models/pig.go b/internal/infra/models/pig.go index a954799..485fff7 100644 --- a/internal/infra/models/pig.go +++ b/internal/infra/models/pig.go @@ -33,13 +33,12 @@ const ( // PigBatch 是猪批次的核心模型,代表了一群被共同管理的猪 type PigBatch struct { gorm.Model - BatchNumber string `gorm:"size:50;not null;uniqueIndex;comment:批次编号,如 2024-W25-A01"` - OriginType PigBatchOriginType `gorm:"size:20;not null;comment:批次来源 (自繁, 外购)"` - StartDate time.Time `gorm:"not null;comment:批次开始日期 (如转入日或购买日)"` - InitialCount int `gorm:"not null;comment:初始数量"` - CurrentCount int `gorm:"not null;comment:当前存栏数量"` - CurrentSickCount int `gorm:"not null;default:0;comment:当前病猪数量"` - Status PigBatchStatus `gorm:"size:20;not null;index;comment:批次状态"` + BatchNumber string `gorm:"size:50;not null;uniqueIndex;comment:批次编号,如 2024-W25-A01"` + OriginType PigBatchOriginType `gorm:"size:20;not null;comment:批次来源 (自繁, 外购)"` + StartDate time.Time `gorm:"not null;comment:批次开始日期 (如转入日或购买日)"` + EndDate time.Time `gorm:"not null;comment:批次结束日期 (全部淘汰或售出)"` + InitialCount int `gorm:"not null;comment:初始数量"` + Status PigBatchStatus `gorm:"size:20;not null;index;comment:批次状态"` } func (PigBatch) TableName() string {