neck_ring_estrus.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. ExposeEstrusType pasturePb.ExposeEstrusType_Kind `json:"exposeEstrusType"`
  13. EstrusStartDate string `json:"estrusStartDate"`
  14. ActiveDate string `json:"activeDate"`
  15. LastEstrusDate string `json:"lastEstrusDate"`
  16. Level pasturePb.EstrusLevel_Kind `json:"level"`
  17. IsPeak pasturePb.IsShow_Kind `json:"isPeak"`
  18. DayHigh int32 `json:"dayHigh"`
  19. MaxHigh int32 `json:"maxHigh"`
  20. CheckResult pasturePb.CheckResult_Kind `json:"checkResult"`
  21. Remarks string `json:"remarks"`
  22. IsShow pasturePb.IsShow_Kind `json:"isShow"`
  23. CreatedAt int64 `json:"createdAt"`
  24. UpdatedAt int64 `json:"updatedAt"`
  25. }
  26. func (n *NeckRingEstrus) TableName() string {
  27. return "neck_ring_estrus"
  28. }
  29. func NewNeckRingEstrus(
  30. pastureId int64,
  31. cow *Cow,
  32. exposeEstrusType pasturePb.ExposeEstrusType_Kind,
  33. level pasturePb.EstrusLevel_Kind,
  34. checkResult pasturePb.CheckResult_Kind,
  35. isShow pasturePb.IsShow_Kind,
  36. ) *NeckRingEstrus {
  37. return &NeckRingEstrus{
  38. PastureId: pastureId,
  39. CowId: cow.Id,
  40. NeckRingNumber: cow.NeckRingNumber,
  41. EarNumber: cow.EarNumber,
  42. Lact: cow.Lact,
  43. ExposeEstrusType: exposeEstrusType,
  44. Level: level,
  45. IsShow: isShow,
  46. CheckResult: checkResult,
  47. }
  48. }