neck_ring_estrus.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package model
  2. import (
  3. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  4. )
  5. type NeckRingEstrus struct {
  6. Id int64 `json:"id"`
  7. PastureId int64 `json:"pastureId"`
  8. CowId int64 `json:"cowId"`
  9. NeckRingNumber string `json:"neckRingNumber"`
  10. EarNumber string `json:"earNumber"`
  11. Lact int32 `json:"lact"`
  12. EstrusStartDate string `json:"estrusStartDate"`
  13. LastEstrusDate string `json:"lastEstrusDate"`
  14. ActiveDate string `json:"activeDate"`
  15. ActiveLevel pasturePb.EstrusLevel_Kind `json:"activeLevel"`
  16. IsPeak pasturePb.IsShow_Kind `json:"isPeak"`
  17. DayHigh int32 `json:"dayHigh"`
  18. MaxHigh int32 `json:"maxHigh"`
  19. CheckResult pasturePb.CheckResult_Kind `json:"checkResult"`
  20. CheckAt int64 `json:"checkAt"`
  21. IsShow pasturePb.IsShow_Kind `json:"isShow"`
  22. CreatedAt int64 `json:"createdAt"`
  23. UpdatedAt int64 `json:"updatedAt"`
  24. }
  25. func (n *NeckRingEstrus) TableName() string {
  26. return "neck_ring_estrus"
  27. }
  28. func NewNeckRingEstrus(pastureId int64, cow *Cow, level pasturePb.EstrusLevel_Kind, checkResult pasturePb.CheckResult_Kind, isShow pasturePb.IsShow_Kind) *NeckRingEstrus {
  29. return &NeckRingEstrus{
  30. PastureId: pastureId,
  31. CowId: cow.Id,
  32. NeckRingNumber: cow.NeckRingNumber,
  33. EarNumber: cow.EarNumber,
  34. Lact: cow.Lact,
  35. ActiveLevel: level,
  36. IsShow: isShow,
  37. CheckResult: checkResult,
  38. }
  39. }
  40. type GroupEstrusData struct {
  41. CowId int64
  42. PastureId int64
  43. EarNumber string
  44. Records []*NeckRingEstrus
  45. Moved bool
  46. }