feat(cache):实验性增加缓存操作函数。

This commit is contained in:
徐涛
2022-08-25 09:48:21 +08:00
parent 4aa7221158
commit 4025965e98
7 changed files with 256 additions and 1 deletions

View File

@@ -30,3 +30,11 @@ func ConvertStructToMap[T any](origin T) map[string]interface{} {
json.Unmarshal(incr, &dest)
return dest
}
func ConvertSliceToInterfaceSlice[T any](origin []T) []interface{} {
dest := make([]interface{}, len(origin))
for i, e := range origin {
dest[i] = e
}
return dest
}