Exemplo n.º 1
0
func EC(paramMap map[string]string) interface{} {
	HostAdd := util.GetMMSDAServer()
	client := mcpacknpc.NewClient(HostAdd)
	request := packEC(paramMap)
	reply := new(Reply)
	start := time.Now().Nanosecond() //test
	client.Call(request, reply)
	returnda := parserReply(reply)
	beego.Notice("++++daTime+++++", (time.Now().Nanosecond() - start)) //test
	if paramMap["tp"] == "api" {
		return returnda
	} else {
		baidu := baidubase64.NewBaiduB64()
		retMap := make(map[string]interface{}, 1)
		retByte, err := json.Marshal(returnda)
		if err != nil {
			beego.Notice("json error:", err)
			return returnda
		}
		retMap["data"] = baidu.BaiduB64Encode(string(retByte), 0)
		//retMap["data"] = base64.StdEncoding.EncodeToString(retByte)
		return retMap
	}

}
Exemplo n.º 2
0
func CQ(paramMap map[string]string) *ReturnMMSDA {
	//server := []string{HostAdd}
	HostAdd := util.GetMMSDAServer()
	client := mcpacknpc.NewClient(HostAdd)
	request := packCQ(paramMap)
	reply := new(Reply)
	client.Call(request, reply)
	returnda := parserReply(reply)
	return returnda
}