| 1234567891011121314151617181920212223242526272829303132333435363738 | 
							- package model
 
- import (
 
- 	pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
 
- 	"github.com/nicksnyder/go-i18n/v2/i18n"
 
- )
 
- type ConfigImmunizationConditions struct {
 
- 	Id           int32                                 `json:"id"`
 
- 	PastureId    int64                                 `json:"pastureId"`
 
- 	Kind         pasturePb.ImmunizationConditions_Kind `json:"kind"`
 
- 	I18nFieldTag string                                `json:"i18nFieldTag"`
 
- 	Remarks      string                                `json:"remarks"`
 
- 	IsShow       pasturePb.IsShow_Kind                 `json:"isShow"`
 
- 	CreatedAt    int64                                 `json:"createdAt"`
 
- 	UpdatedAt    int64                                 `json:"updatedAt"`
 
- }
 
- func (c *ConfigImmunizationConditions) TableName() string {
 
- 	return "config_immunization_conditions"
 
- }
 
- type ConfigImmunizationConditionsSlice []*ConfigImmunizationConditions
 
- func (c ConfigImmunizationConditionsSlice) ToPB(userModel *UserModel) []*pasturePb.ConfigOptionsList {
 
- 	res := make([]*pasturePb.ConfigOptionsList, 0)
 
- 	for _, v := range c {
 
- 		label, _ := userModel.LanguageContent.Localize(&i18n.LocalizeConfig{
 
- 			MessageID: v.I18nFieldTag,
 
- 		})
 
- 		res = append(res, &pasturePb.ConfigOptionsList{
 
- 			Value:    int32(v.Kind),
 
- 			Label:    label,
 
- 			Disabled: true,
 
- 		})
 
- 	}
 
- 	return res
 
- }
 
 
  |