u
This commit is contained in:
1 parent
33113f279c
commit
c2c5cc92af
16 files changed
+864
-352
No files matched your search
@@ -86,6 +86,16 @@ func (m M) GetString(key string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetArray 获取 map 中的 []M,如果不存在或类型不对返回空切片
|
||||
func (m M) GetArray(key string) []M {
|
||||
if v, ok := m[key]; ok {
|
||||
if arr, ok := v.([]M); ok {
|
||||
return arr
|
||||
}
|
||||
}
|
||||
return NewArr()
|
||||
}
|
||||
|
||||
// 核心获取整数的方法,返回 int64
|
||||
func (m M) getIntValue(key string) int64 {
|
||||
if v, ok := m[key]; ok && v != nil {
|
||||
|
||||
Reference in new issue
Block a user