change layout
CI / changes (push) Successful in 5s
CI / docker-bff (push) Failing after 7s
CI / docker-product (push) Failing after 5s
CI / docker-admin (push) Failing after 4s
CI / docker-user (push) Failing after 6s

This commit is contained in:
2026-08-20 15:41:44 +08:00
parent 57e04be304
commit be8f89f449
176 changed files with 7009 additions and 4498 deletions
+6 -5
View File
@@ -1,10 +1,11 @@
package utils
import (
"encoding/json"
"reflect"
"regexp"
"strings"
jsoniter "github.com/json-iterator/go"
)
const YMDHIS = "2006-01-02 15:04:05"
@@ -35,7 +36,7 @@ func GetStructKeys(obj any) []string {
fileName, ok := objT.Field(i).Tag.Lookup("json")
if ok {
keys = append(keys, fileName)
}else{
} else {
keys = append(keys, objT.Field(i).Name)
}
}
@@ -55,7 +56,7 @@ func Struct2map(obj any) (data map[string]any, err error) {
}
if ok {
data[fileName] = objV.Field(i).Interface()
}else{
} else {
data[objT.Field(i).Name] = objV.Field(i).Interface()
}
}
@@ -69,7 +70,7 @@ func IsString(obj interface{}) bool {
return kind == reflect.String
}
func CheckInArrInt(list []int, val int) {
func CheckInArrInt(list []int, val int) {
}
@@ -85,7 +86,7 @@ func CheckInStr(list []string, val string) bool {
func JsonToStrArr(jsonStr string) ([]string, error) {
var arr []string
err := json.Unmarshal([]byte(jsonStr), &arr)
err := jsoniter.Unmarshal([]byte(jsonStr), &arr)
return arr, err
}