28 lines
646 B
Go
28 lines
646 B
Go
package common
|
|
|
|
type Values struct {
|
|
Value any `json:"value,omitempty"`
|
|
EnumID int `json:"enum_id,omitempty"`
|
|
Enum string `json:"enum,omitempty"`
|
|
}
|
|
type CustomFieldsValue struct {
|
|
FieldID int `json:"field_id"`
|
|
FieldName string `json:"field_name,omitempty"`
|
|
FieldCode string `json:"field_code,omitempty"`
|
|
FieldType string `json:"field_type,omitempty"`
|
|
Values []Values `json:"values"`
|
|
}
|
|
|
|
type CustomFieldsValues []CustomFieldsValue
|
|
|
|
func (vs CustomFieldsValues) GetValuesByID(
|
|
id int,
|
|
) ([]Values, bool) {
|
|
for _, v := range vs {
|
|
if v.FieldID == id {
|
|
return v.Values, true
|
|
}
|
|
}
|
|
return nil, false
|
|
}
|
|
|