[v1.4.2] ToStringMap

This commit is contained in:
兔子
2024-08-29 23:23:02 +08:00
parent d87a67db73
commit 3cc4a9587f
3 changed files with 22 additions and 15 deletions

View File

@@ -177,3 +177,8 @@ func (this *StructStruct) Slice(obj any) (slice []any) {
}
return s
}
// ToStringMap - 将结构体转换为map[string]any
func (this *StructStruct) ToStringMap(obj any) (result map[string]any) {
return cast.ToStringMap(Json.Encode(obj))
}