定义病猪子服务

This commit is contained in:
2025-10-06 15:35:20 +08:00
parent 1b026d6106
commit 648a790cec
8 changed files with 83 additions and 51 deletions

View File

@@ -80,8 +80,8 @@ const (
ReasonTypeHealthCare MedicationReasonType = "保健"
)
// GroupMedicationLog 记录了对整个猪批次的用药情况
type GroupMedicationLog struct {
// MedicationLog 记录了对整个猪批次的用药情况
type MedicationLog struct {
gorm.Model
PigBatchID uint `gorm:"not null;index;comment:关联的猪批次ID"`
MedicationID uint `gorm:"not null;index;comment:关联的药品ID"`
@@ -94,6 +94,6 @@ type GroupMedicationLog struct {
HappenedAt time.Time `gorm:"primaryKey;comment:用药时间"`
}
func (GroupMedicationLog) TableName() string {
return "group_medication_logs"
func (MedicationLog) TableName() string {
return "medication_logs"
}