From 45204fa41992f74656b147b81ee65ca884c4c5a0 Mon Sep 17 00:00:00 2001 From: akiyatomohiro Date: Thu, 16 May 2024 19:03:47 +0900 Subject: [PATCH] fix --- server/internal/usecase/interactor/property.go | 18 ++++++++++++++++-- server/pkg/property/value.go | 4 ++++ 2 files changed, 20 insertions(+), 2 deletions(-) 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 +}