uint/uint64全部改为uint32
This commit is contained in:
@@ -2,8 +2,6 @@ package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// PigTransferType 定义了猪只迁移的类型
|
||||
@@ -23,14 +21,14 @@ const (
|
||||
// PigTransferLog 记录了每一次猪只数量在猪栏间的变动事件。
|
||||
// 它作为事件溯源的基础,用于推算任意时间点猪栏的猪只数量。
|
||||
type PigTransferLog struct {
|
||||
gorm.Model
|
||||
Model
|
||||
TransferTime time.Time `gorm:"primaryKey;comment:迁移发生时间" json:"transfer_time"` // 迁移发生时间,作为联合主键
|
||||
PigBatchID uint `gorm:"primaryKey;comment:关联的猪群ID" json:"pig_batch_id"` // 关联的猪群ID,作为联合主键
|
||||
PenID uint `gorm:"primaryKey;comment:发生变动的猪栏ID" json:"pen_id"` // 发生变动的猪栏ID,作为联合主键
|
||||
PigBatchID uint32 `gorm:"primaryKey;comment:关联的猪群ID" json:"pig_batch_id"` // 关联的猪群ID,作为联合主键
|
||||
PenID uint32 `gorm:"primaryKey;comment:发生变动的猪栏ID" json:"pen_id"` // 发生变动的猪栏ID,作为联合主键
|
||||
Quantity int `gorm:"not null;comment:变动数量(正数表示增加,负数表示减少)" json:"quantity"` // 变动数量(正数表示增加,负数减少)
|
||||
Type PigTransferType `gorm:"not null;comment:变动类型" json:"type"` // 变动类型,使用枚举类型
|
||||
CorrelationID string `gorm:"comment:用于关联一次完整操作(如一次调栏会产生两条日志)" json:"correlation_id"` // 用于关联一次完整操作
|
||||
OperatorID uint `gorm:"not null;comment:操作员ID" json:"operator_id"` // 操作员ID
|
||||
OperatorID uint32 `gorm:"not null;comment:操作员ID" json:"operator_id"` // 操作员ID
|
||||
Remarks string `gorm:"comment:备注" json:"remarks"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user