package model import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" type AppPastureList struct { Id int64 `json:"id"` FarmId string `json:"farmId"` Name string `json:"name"` ShortName string `json:"shortName"` GroupId int64 `json:"groupId"` Province string `json:"province"` City string `json:"city"` County string `json:"county"` Address string `json:"address"` LegalPersonName string `json:"legalPersonName"` LegalPersonPhone string `json:"legalPersonPhone"` FactoryDirectorName string `json:"factoryDirectorName"` FactoryDirectorPhone string `json:"factoryDirectorPhone"` Category int32 `json:"category"` CurrentScale string `json:"currentScale"` PlanScale string `json:"planScale"` AppId string `json:"appId"` Status int32 `json:"status"` IsShow pasturePb.IsShow_Kind `json:"isShow"` ProductionModel int32 `json:"productionModel"` Remarks string `json:"remarks"` CreatedName string `json:"createdName"` CreatedAt int64 `json:"createdAt"` UpdatedAt string `json:"updatedAt"` } func (a *AppPastureList) TableName() string { return "app_pasture_list" } type AppPastureListSlice []*AppPastureList func (a AppPastureListSlice) ToPB() []*pasturePb.UserPasture { res := make([]*pasturePb.UserPasture, len(a)) for i, d := range a { res[i] = &pasturePb.UserPasture{ FarmId: d.FarmId, Name: d.Name, } } return res }