app_pasture_list.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package model
  2. import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  3. type AppPastureList struct {
  4. Id int64 `json:"id"`
  5. FarmId string `json:"farmId"`
  6. Name string `json:"name"`
  7. ShortName string `json:"shortName"`
  8. GroupId int64 `json:"groupId"`
  9. Province string `json:"province"`
  10. City string `json:"city"`
  11. County string `json:"county"`
  12. Address string `json:"address"`
  13. LegalPersonName string `json:"legalPersonName"`
  14. LegalPersonPhone string `json:"legalPersonPhone"`
  15. FactoryDirectorName string `json:"factoryDirectorName"`
  16. FactoryDirectorPhone string `json:"factoryDirectorPhone"`
  17. Category int32 `json:"category"`
  18. CurrentScale string `json:"currentScale"`
  19. PlanScale string `json:"planScale"`
  20. AppId string `json:"appId"`
  21. Status int32 `json:"status"`
  22. IsShow pasturePb.IsShow_Kind `json:"isShow"`
  23. ProductionModel int32 `json:"productionModel"`
  24. Remarks string `json:"remarks"`
  25. CreatedName string `json:"createdName"`
  26. CreatedAt int64 `json:"createdAt"`
  27. UpdatedAt string `json:"updatedAt"`
  28. }
  29. func (a *AppPastureList) TableName() string {
  30. return "app_pasture_list"
  31. }
  32. type AppPastureListSlice []*AppPastureList
  33. func (a AppPastureListSlice) ToPB() []*pasturePb.UserPasture {
  34. res := make([]*pasturePb.UserPasture, len(a))
  35. for i, d := range a {
  36. res[i] = &pasturePb.UserPasture{
  37. FarmId: d.FarmId,
  38. Name: d.Name,
  39. }
  40. }
  41. return res
  42. }