|
|
@ -1,6 +1,7 @@ |
|
|
|
package helper |
|
|
|
|
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"net/url" |
|
|
|
"sort" |
|
|
@ -95,6 +96,20 @@ func MapStringToInterface(src map[string]string) map[string]interface{} { |
|
|
|
return target |
|
|
|
} |
|
|
|
|
|
|
|
//将interface转成map[string]interface
|
|
|
|
func InterfaceToMapInterface(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进行字典序排序 |
|
|
|
* @param data map[string]string |
|
|
|