neck_ring_bind_log.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package model
  2. const (
  3. OperationNameBind = "绑定"
  4. OperationNameUnbind = "解绑"
  5. OperationNameUpdate = "编辑"
  6. EventEnterBind = "入场绑定"
  7. EventDieBind = "死亡解绑"
  8. DefaultBind = "正常绑定"
  9. DefaultUnBind = "正常解绑"
  10. )
  11. type NeckRingBindLog struct {
  12. Id int64 `json:"id"`
  13. PastureId int64 `json:"pastureId"`
  14. NeckRingNumber string `json:"neckRingNumber"`
  15. CowId int64 `json:"cowId"`
  16. EarNumber string `json:"earNumber"`
  17. OperationName string `json:"operationName"`
  18. Remarks string `json:"remarks"`
  19. MessageId int64 `json:"messageId"`
  20. MessageName string `json:"messageName"`
  21. CreatedAt int64 `json:"createdAt"`
  22. UpdatedAt int64 `json:"updatedAt"`
  23. }
  24. func (n *NeckRingBindLog) TableName() string {
  25. return "neck_ring_bind_log"
  26. }
  27. func NewNeckRingBindLog(pastureId int64, number string, cowInfo *Cow, currUser *SystemUser, remarks string) *NeckRingBindLog {
  28. return &NeckRingBindLog{
  29. PastureId: pastureId,
  30. NeckRingNumber: number,
  31. CowId: cowInfo.Id,
  32. EarNumber: cowInfo.EarNumber,
  33. MessageId: currUser.Id,
  34. MessageName: currUser.Name,
  35. Remarks: remarks,
  36. }
  37. }