init
This commit is contained in:
13
core/json.go
Normal file
13
core/json.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func JsonToString(postData interface{}) string {
|
||||
jsons, errs := json.Marshal(postData) //转换成JSON返回的是byte[]
|
||||
if errs != nil {
|
||||
return ""
|
||||
}
|
||||
return string(jsons)
|
||||
}
|
||||
Reference in New Issue
Block a user