Parcourir la source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx il y a 3 ans
Parent
révision
1382a12598
3 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 1 1
      service/jsyb_service.go
  2. 2 0
      utils/csbhttp/httpcaller.go
  3. 4 0
      utils/csbhttp/httpparams.go

+ 1 - 1
service/jsyb_service.go Voir le fichier

65
 func HttpRequest(url string, ak string, sk string, timestamp int64, requestByte []byte, json string) string {
65
 func HttpRequest(url string, ak string, sk string, timestamp int64, requestByte []byte, json string) string {
66
 	fmt.Println(url)
66
 	fmt.Println(url)
67
 	//step 1. 设置请求参数
67
 	//step 1. 设置请求参数
68
-	csbHP := csbhttp.NewHttpParams("http://10.72.3.83:8086/CSB?name='111111'") //设置请求地址及url参数
68
+	csbHP := csbhttp.NewHttpParams("http://10.72.3.83:8086/CSB") //设置请求地址及url参数
69
 	//设置调用方式 get 或者 post
69
 	//设置调用方式 get 或者 post
70
 	csbHP.SetMethod("post")
70
 	csbHP.SetMethod("post")
71
 	//csbHP.AddParam("input", "")
71
 	//csbHP.AddParam("input", "")

+ 2 - 0
utils/csbhttp/httpcaller.go Voir le fichier

167
 func Invoke(params HttpParams) (str string, rtnHeaders map[string][]string, hcError *HttpCallerException) {
167
 func Invoke(params HttpParams) (str string, rtnHeaders map[string][]string, hcError *HttpCallerException) {
168
 	//init rtnHeaders
168
 	//init rtnHeaders
169
 	rtnHeaders = make(map[string][]string)
169
 	rtnHeaders = make(map[string][]string)
170
+	fmt.Println("~~~~~~")
171
+	fmt.Println(params)
170
 
172
 
171
 	hcError = params.Validate()
173
 	hcError = params.Validate()
172
 	if hcError != nil {
174
 	if hcError != nil {

+ 4 - 0
utils/csbhttp/httpparams.go Voir le fichier

121
 		hp.ct.bytesBody = byteArr //TODO: copy or pointer ?
121
 		hp.ct.bytesBody = byteArr //TODO: copy or pointer ?
122
 		hp.ct.contentType = BINARY
122
 		hp.ct.contentType = BINARY
123
 	}
123
 	}
124
+	fmt.Println("------")
125
+	fmt.Println(hp.ct.jsonBody)
126
+	fmt.Println(hp.ct.bytesBody)
127
+	fmt.Println("------")
124
 
128
 
125
 	return nil
129
 	return nil
126
 }
130
 }