优化null相关

This commit is contained in:
xiangheng
2024-08-16 12:33:23 +08:00
parent 8e75b9b54a
commit fe6ec94516
2 changed files with 25 additions and 4 deletions

View File

@@ -17,7 +17,18 @@ func EncodeInt(value any) any {
switch v := value.(type) {
case map[string]any:
if v["Int"] != nil {
return v["Int"]
val := v["Int"]
switch i := val.(type) {
case *int:
return *i
case *int64:
return *i
case *string:
return *i
default:
return ""
}
// return val
}
}
return ""