feat: 补齐消毒、种源与二维码身份链

This commit is contained in:
weijuesen
2026-08-14 08:39:56 +08:00
parent cc93c9a053
commit 6b222abb7b
24 changed files with 1344 additions and 9 deletions
+7 -6
View File
@@ -21,14 +21,15 @@ type Batch struct {
ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
RoomID string `gorm:"column:room_id;type:uuid;index" json:"roomId"`
Name string `gorm:"size:64" json:"name"`
Variety *string `gorm:"size:64" json:"variety,omitempty"` // 品种
Source *string `gorm:"size:128" json:"source,omitempty"` // 蚕种来源/供应商
SeedBatchNo *string `gorm:"column:seed_batch_no;size:64" json:"seedBatchNo,omitempty"` // 蚕种批次号
QuarantineNo *string `gorm:"column:quarantine_no;size:64" json:"quarantineNo,omitempty"` // 检疫证明编
Instar *int `gorm:"type:int" json:"instar,omitempty"` // 龄期 1-5
Variety *string `gorm:"size:64" json:"variety,omitempty"` // 品种
Source *string `gorm:"size:128" json:"source,omitempty"` // 蚕种来源/供应商
SeedSourceID *string `gorm:"column:seed_source_id;type:uuid;index" json:"seedSourceId,omitempty"`
SeedBatchNo *string `gorm:"column:seed_batch_no;size:64" json:"seedBatchNo,omitempty"` // 蚕种批次
QuarantineNo *string `gorm:"column:quarantine_no;size:64" json:"quarantineNo,omitempty"` // 检疫证明编号
Instar *int `gorm:"type:int" json:"instar,omitempty"` // 龄期 1-5
EnteredAt *time.Time `gorm:"column:entered_at;type:timestamptz" json:"enteredAt,omitempty"` // 入房时间
MountAt *time.Time `gorm:"column:mount_at;type:timestamptz" json:"mountAt,omitempty"` // 上蔟时间
Status string `gorm:"size:16;default:rearing" json:"status"` // rearing/mounted/finished
Status string `gorm:"size:16;default:rearing" json:"status"` // rearing/mounted/finished
Note *string `gorm:"type:text" json:"note,omitempty"`
CreatedAt time.Time `gorm:"type:timestamptz" json:"createdAt"`
UpdatedAt time.Time `gorm:"type:timestamptz" json:"updatedAt"`