1234567891011121314151617181920212223242526272829303132333435363738 |
- package model
- import operationPb "kpt-tmr-group/proto/go/backend/operation"
- type FeedFormulaDistributeLog struct {
- Id int64 `json:"id"`
- FeedFormulaId int64 `json:"feed_formula_id"`
- PastureId int64 `json:"pasture_id"`
- PastureName string `json:"pasture_name"`
- IsShow operationPb.IsShow_Kind `json:"is_show"`
- CreatedAt int64 `json:"created_at"`
- UpdatedAt int64 `json:"updated_at"`
- }
- func (f *FeedFormulaDistributeLog) TableName() string {
- return "feed_formula_distribute_log"
- }
- func NewFeedFormulaDistributeLog(feedFormulaId, pastureId int64, isShow operationPb.IsShow_Kind) *FeedFormulaDistributeLog {
- return &FeedFormulaDistributeLog{
- FeedFormulaId: feedFormulaId,
- PastureId: pastureId,
- IsShow: isShow,
- }
- }
- func NewFeedFormulaDistributeLogList(feedFormulaList []*FeedFormula, pastureId int64, pastureName string, isShow operationPb.IsShow_Kind) []*FeedFormulaDistributeLog {
- res := make([]*FeedFormulaDistributeLog, 0)
- for _, v := range feedFormulaList {
- res = append(res, &FeedFormulaDistributeLog{
- FeedFormulaId: v.Id,
- PastureId: pastureId,
- PastureName: pastureName,
- IsShow: isShow,
- })
- }
- return res
- }
|