package model import ( pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" ) type ConfigCowSource struct { Id int64 `json:"id"` Name string `json:"name"` Remarks string `json:"remarks"` IsShow pasturePb.IsShow_Kind `json:"is_show"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` } func (c *ConfigCowSource) TableName() string { return "config_cow_source" } type ConfigCowSourceSlice []*ConfigCowSource func (c ConfigCowSourceSlice) ToPB() []*pasturePb.SearchBaseConfigList { res := make([]*pasturePb.SearchBaseConfigList, len(c)) for i, d := range c { res[i] = &pasturePb.SearchBaseConfigList{ Id: int32(d.Id), Name: d.Name, Remarks: d.Remarks, IsShow: d.IsShow, CreatedAt: int32(d.CreatedAt), UpdatedAt: int32(d.UpdatedAt), } } return res }