feed_formula_distribute_log.go 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package model
  2. import operationPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/operation"
  3. type FeedFormulaDistributeLog struct {
  4. Id int64 `json:"id"`
  5. FeedFormulaId int64 `json:"feed_formula_id"`
  6. PastureId int64 `json:"pasture_id"`
  7. PastureName string `json:"pasture_name"`
  8. IsShow operationPb.IsShow_Kind `json:"is_show"`
  9. CreatedAt int64 `json:"created_at"`
  10. UpdatedAt int64 `json:"updated_at"`
  11. }
  12. func (f *FeedFormulaDistributeLog) TableName() string {
  13. return "feed_formula_distribute_log"
  14. }
  15. func NewFeedFormulaDistributeLog(feedFormulaId, pastureId int64, pastureName string, isShow operationPb.IsShow_Kind) *FeedFormulaDistributeLog {
  16. return &FeedFormulaDistributeLog{
  17. FeedFormulaId: feedFormulaId,
  18. PastureId: pastureId,
  19. IsShow: isShow,
  20. }
  21. }
  22. func NewFeedFormulaDistributeLogList(feedFormulaList []*operationPb.DistributeFeedRequest, pastureId int64, pastureName string, isShow operationPb.IsShow_Kind) []*FeedFormulaDistributeLog {
  23. res := make([]*FeedFormulaDistributeLog, 0)
  24. for _, v := range feedFormulaList {
  25. res = append(res, NewFeedFormulaDistributeLog(int64(v.Id), pastureId, pastureName, isShow))
  26. }
  27. return res
  28. }