diff --git a/server/internal/usecase/interactor/property.go b/server/internal/usecase/interactor/property.go index 8c08a3b896..5b50daca6b 100644 --- a/server/internal/usecase/interactor/property.go +++ b/server/internal/usecase/interactor/property.go @@ -583,9 +583,23 @@ func convertPropertyFromRedis(p PropertyForRedis) (*property.Property, error) { fieldsDomain := make([]*property.Field, 0, len(p.Items[0].Fields)) for _, field := range p.Items[0].Fields { + + var v interface{} + if field.Field == "padding" { + m := field.V.Value.V.(map[string]interface{}) + v = property.Spacing{ + Top: m["Top"].(float64), + Bottom: m["Bottom"].(float64), + Left: m["Left"].(float64), + Right: m["Right"].(float64), + } + } else { + v = field.V.Value.V + } + valueDomain := value.New( - nil, - field.V.Value.V, + property.DefaultTypes(), + v, value.Type(field.V.Value.T), ) diff --git a/server/pkg/property/value.go b/server/pkg/property/value.go index 1dea1658a8..94501f587e 100644 --- a/server/pkg/property/value.go +++ b/server/pkg/property/value.go @@ -255,3 +255,7 @@ func ValueFromStringOrNumber(s string) *Value { return ValueTypeString.ValueFrom(s) } + +func DefaultTypes() value.TypePropertyMap { + return types +}