重构RPC逻辑

This commit is contained in:
marvzhang
2020-03-10 12:08:26 +08:00
parent ab33640a50
commit e5b4ac6310
13 changed files with 386 additions and 227 deletions

14
backend/utils/rpc.go Normal file
View File

@@ -0,0 +1,14 @@
package utils
import "encoding/json"
// Object 转化为 String
func ObjectToString(params interface{}) string {
bytes, _ := json.Marshal(params)
return BytesToString(bytes)
}
// 获取 RPC 参数
func GetRpcParam(key string, params map[string]string) string {
return params[key]
}