refactor: 使用泛型重构参数绑定等

This commit is contained in:
meilin.huang
2025-05-24 16:22:54 +08:00
parent 666b191b6c
commit d6280ea280
75 changed files with 1340 additions and 732 deletions

View File

@@ -1,8 +1,8 @@
package cache
import (
"encoding/json"
"mayfly-go/pkg/utils/anyx"
"mayfly-go/pkg/utils/jsonx"
"time"
"github.com/may-fly/cast"
@@ -65,7 +65,7 @@ func (dc *defaultCache) GetInt(k string) (int, bool) {
func (dc *defaultCache) GetJson(k string, valPtr any) bool {
if val, ok := dc.GetStr(k); ok {
jsonx.To(val, valPtr)
json.Unmarshal([]byte(val), valPtr)
return true
}
return false