neck_ring_health_warning.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package model
  2. type NeckRingHealthWarning struct {
  3. Id int64 `json:"id"`
  4. NeckRingHealthId int64 `json:"neckRingHealthId"`
  5. PastureId int64 `json:"pastureId"`
  6. CowId int64 `json:"cowId"`
  7. EarNumber string `json:"earNumber"`
  8. NeckRingNumber string `json:"neckRingNumber"`
  9. HeatDate string `json:"heatDate"`
  10. MinHigh int32 `json:"minHigh"`
  11. MinChew int32 `json:"minChew"`
  12. MinIntake int32 `json:"minIntake"`
  13. ChewSum int32 `json:"chewSum"`
  14. BeforeThreeSumChew int32 `json:"beforeThreeSumChew"`
  15. Score int32 `json:"score"`
  16. CreatedAt int64 `json:"created"`
  17. UpdatedAt int64 `json:"updated"`
  18. }
  19. func (n *NeckRingHealthWarning) TableName() string {
  20. return "neck_ring_health_warning"
  21. }
  22. func NewNeckRingHealthWarning(pastureId int64, neckRingHealth *NeckRingHealth, cow *Cow, newScore int32) *NeckRingHealthWarning {
  23. return &NeckRingHealthWarning{
  24. NeckRingHealthId: pastureId,
  25. PastureId: neckRingHealth.Id,
  26. CowId: cow.Id,
  27. EarNumber: cow.EarNumber,
  28. NeckRingNumber: cow.NeckRingNumber,
  29. HeatDate: "",
  30. MinHigh: neckRingHealth.MinHigh,
  31. MinChew: neckRingHealth.MinChew,
  32. MinIntake: neckRingHealth.MinInactive,
  33. ChewSum: neckRingHealth.SumChew,
  34. BeforeThreeSumChew: neckRingHealth.BeforeThreeSumChew,
  35. Score: newScore,
  36. }
  37. }