|
@ -110,6 +110,21 @@ func InterfaceToMapInterface(data interface{})(map[string]interface{},error){ |
|
|
return returnData,nil |
|
|
return returnData,nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//将interface转成[]map[string]interface
|
|
|
|
|
|
func InterfaceToMapInterfaceArr(data interface{})([]map[string]interface{},error){ |
|
|
|
|
|
dataJson,err := json.Marshal(data) |
|
|
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil,err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var returnData []map[string]interface{} |
|
|
|
|
|
err = json.Unmarshal(dataJson,&returnData) |
|
|
|
|
|
|
|
|
|
|
|
return returnData,nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 对map进行字典序排序 |
|
|
* 对map进行字典序排序 |
|
|
* @param data map[string]string |
|
|
* @param data map[string]string |
|
|