same_time_cow.go 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. package model
  2. import (
  3. "time"
  4. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  5. )
  6. type SameTimeCow struct {
  7. Id int64 `json:"id"`
  8. CowId int64 `json:"cowId"`
  9. SameTimeId int64 `json:"sameTimeId"`
  10. Status pasturePb.SameTimeStatus_Kind `json:"status"`
  11. NextSameTimeType pasturePb.SameTimeType_Kind `json:"nextSameTimeType"`
  12. NextSameTimeAt int64 `json:"nextSameTimeAt"`
  13. StartAt int64 `json:"startAt"`
  14. EndAt int64 `json:"endAt"`
  15. CreatedAt int64 `json:"createdAt"`
  16. UpdatedAt int64 `json:"updatedAt"`
  17. }
  18. func (s *SameTimeCow) TableName() string {
  19. return "same_time_cow"
  20. }
  21. func NewSameTimeCow(cowId, sameTimeId int64) *SameTimeCow {
  22. return &SameTimeCow{
  23. CowId: cowId,
  24. SameTimeId: sameTimeId,
  25. Status: pasturePb.SameTimeStatus_No_Start,
  26. StartAt: time.Now().Unix(),
  27. }
  28. }