package model import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" type EventBodyScore struct { Id int64 `json:"id"` CowId int64 `json:"cow_id"` EarNumber string `json:"ear_number"` Score int32 `json:"score"` Lact int32 `json:"lact"` DayAge int32 `json:"day_age"` ScoreAt int64 `json:"score_at"` Remarks string `json:"remarks"` StaffMemberId int64 `json:"staff_member_id"` OperationId int64 `json:"operation_id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` } func (e *EventBodyScore) TableName() string { return "event_body_score" } func NewEventBodyScore(cow *Cow, operationId int64, req *pasturePb.BodyScoreEventRequest) *EventBodyScore { return &EventBodyScore{ CowId: cow.Id, EarNumber: cow.EarNumber, Score: req.Score, Lact: cow.Lact, DayAge: cow.GetDayAge(), ScoreAt: int64(req.ScoreAt), Remarks: req.Remarks, StaffMemberId: int64(req.StaffMemberId), OperationId: operationId, } }