package model import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" type EventTransferGroup struct { Id int64 `json:"id"` CowId int64 `json:"cowId"` PenInId int32 `json:"penInId"` PenOutId int32 `json:"penOutId"` DayAge int32 `json:"dayAge"` Lact int32 `json:"lact"` TransferDate string `json:"transferDate"` TransferReasonId int64 `json:"transferReasonId"` Remarks string `json:"remarks"` MessageId int64 `json:"messageId"` MessageName string `json:"messageName"` OperationId int64 `json:"operationId"` OperationName string `json:"operationName"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` } func (e *EventTransferGroup) TableName() string { return "event_transfer_group" } func NewEventTransferGroup(cow *Cow, req *pasturePb.TransferGroupEventData, currentUser *SystemUser, operationUser *SystemUser) *EventTransferGroup { return &EventTransferGroup{ CowId: int64(req.CowId), PenInId: req.TransferInPenId, PenOutId: cow.PenId, Lact: cow.Lact, DayAge: cow.GetDayAge(), TransferDate: req.TransferDate, TransferReasonId: int64(req.TransferReasonId), Remarks: req.Remarks, MessageId: currentUser.Id, MessageName: currentUser.Name, OperationId: operationUser.Id, OperationName: operationUser.Name, } }