package model import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" type ConfigCalvingAnalysisMethod struct { Id int32 `json:"id"` PastureId int64 `json:"pastureId"` Kind pasturePb.CalvingAnalysisMethod_Kind `json:"kind"` Zh string `json:"zh"` En string `json:"en"` Remarks string `json:"remarks"` IsShow pasturePb.IsShow_Kind `json:"is_show"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` } func (c *ConfigCalvingAnalysisMethod) TableName() string { return "config_calving_analysis_method" } type ConfigCalvingAnalysisMethodSlice []*ConfigCalvingAnalysisMethod func (c ConfigCalvingAnalysisMethodSlice) ToPB(lang string) []*pasturePb.ConfigOptionsList { res := make([]*pasturePb.ConfigOptionsList, 0) for _, v := range c { label := v.Zh if lang == "en" { label = v.En } res = append(res, &pasturePb.ConfigOptionsList{ Value: int32(v.Kind), Label: label, Disabled: true, }) } return res }