package model import ( pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" ) type EventEstrus struct { Id int64 `json:"id"` PastureId int64 `json:"pastureId"` CowId int64 `json:"cowId"` NeckRingNumber string `json:"neckRingNumber"` EarNumber string `json:"earNumber"` Lact int32 `json:"lact"` DayAge int32 `json:"dayAge"` CalvingAge int32 `json:"calvingAge"` ExposeEstrusType pasturePb.ExposeEstrusType_Kind `json:"exposeEstrusType"` LastEstrusDay int64 `json:"lastEstrusDay"` PlanDay int64 `json:"planDay"` RealityDay int64 `json:"realityDay"` EndDay int64 `json:"endDay"` IsMating pasturePb.IsShow_Kind `json:"isMating"` UnMatingReasonsKind pasturePb.UnMatingReasons_Kind `json:"unMatingReasonsKind"` UnMatingReasonsName string `json:"unMatingReasonsName"` Remarks string `json:"remarks"` IsShow pasturePb.IsShow_Kind `json:"isShow"` OperationId int64 `json:"operationId"` OperationName string `json:"operationName"` MessageId int64 `json:"messageId"` MessageName string `json:"messageName"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` } func (e *EventEstrus) TableName() string { return "event_estrus" } func NewEventEstrus( pastureId int64, cow *Cow, exposeEstrusType pasturePb.ExposeEstrusType_Kind, isShow pasturePb.IsShow_Kind, isMating pasturePb.IsShow_Kind, PlanDay int32, operationUser, currentUser *SystemUser, ) *EventEstrus { return &EventEstrus{ PastureId: pastureId, CowId: cow.Id, Lact: cow.Lact, DayAge: cow.DayAge, CalvingAge: cow.CalvingAge, NeckRingNumber: cow.NeckRingNumber, EarNumber: cow.EarNumber, ExposeEstrusType: exposeEstrusType, PlanDay: int64(PlanDay), RealityDay: int64(PlanDay), IsMating: isMating, IsShow: isShow, OperationId: operationUser.Id, OperationName: operationUser.Name, MessageId: currentUser.Id, MessageName: currentUser.Name, } }