uint/uint64全部改为uint32

This commit is contained in:
2025-11-10 22:23:31 +08:00
parent 3e711551e7
commit ecd2d37c70
96 changed files with 775 additions and 785 deletions

View File

@@ -1,16 +1,12 @@
package models
import (
"gorm.io/gorm"
)
/*
猪场固定资产相关模型
*/
// PigHouse 定义了猪舍,是猪栏的集合
type PigHouse struct {
gorm.Model
Model
Name string `gorm:"size:100;not null;unique;comment:猪舍名称, 如 '育肥舍A栋'"`
Description string `gorm:"size:255;comment:描述信息"`
Pens []Pen `gorm:"foreignKey:HouseID"` // 一个猪舍包含多个猪栏
@@ -30,10 +26,10 @@ const (
// Pen 是猪栏的物理实体模型, 是所有空间相关数据的“锚点”
type Pen struct {
gorm.Model
Model
PenNumber string `gorm:"not null;comment:猪栏的唯一编号, 如 A-01"`
HouseID uint `gorm:"index;comment:所属猪舍ID"`
PigBatchID *uint `gorm:"index;comment:关联的猪批次ID"`
HouseID uint32 `gorm:"index;comment:所属猪舍ID"`
PigBatchID *uint32 `gorm:"index;comment:关联的猪批次ID"`
Capacity int `gorm:"not null;comment:设计容量 (头)"`
Status PenStatus `gorm:"not null;index;comment:猪栏当前状态"`
}