neck_ring_bind_log.go 1.0 KB

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