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