app_pasture_list.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 pasturePb.PastureCategory_Kind `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. PastureId int64 `json:"pastureId"`
  29. PastureUrl string `json:"pastureUrl"`
  30. }
  31. func (a *AppPastureList) TableName() string {
  32. return "app_pasture_list"
  33. }
  34. type AppPastureListSlice []*AppPastureList
  35. func (a AppPastureListSlice) ToPB() []*pasturePb.UserPasture {
  36. res := make([]*pasturePb.UserPasture, len(a))
  37. for i, d := range a {
  38. res[i] = &pasturePb.UserPasture{
  39. FarmId: d.FarmId,
  40. Name: d.Name,
  41. }
  42. }
  43. return res
  44. }