Просмотр исходного кода

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

csx 3 лет назад
Родитель
Сommit
2c02d7a1ea
3 измененных файлов: 40 добавлений и 44 удалений
  1. 2 2
      conf/app.conf
  2. 1 2
      routers/router.go
  3. 37 40
      service/jsyb_service.go

+ 2 - 2
conf/app.conf Просмотреть файл

45
 
45
 
46
 
46
 
47
 [prod]
47
 [prod]
48
-org_id = 10188
48
+org_id = 9919
49
 mobile_token_expiration_second = 86400
49
 mobile_token_expiration_second = 86400
50
 httpdomain = https://api.xt.kuyicloud.com
50
 httpdomain = https://api.xt.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com
59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
60
 gdyb_paasid = "sg03_prd"
60
 gdyb_paasid = "sg03_prd"
61
 # gdyb_paasid = "jm_sc_yjyy"
61
 # gdyb_paasid = "jm_sc_yjyy"
62
-#gdyb_paasid="zh_prd_yjyy"
62
+#gdyb_paasid="zh_prd_yrojyy"
63
 #gdyb_paasid = "sz_prd_yjyy"
63
 #gdyb_paasid = "sz_prd_yjyy"
64
 #gdyb_paasid = "zq_prd_yjyy"
64
 #gdyb_paasid = "zq_prd_yjyy"
65
 
65
 

+ 1 - 2
routers/router.go Просмотреть файл

2
 
2
 
3
 import (
3
 import (
4
 	"gdyb/controllers/hb"
4
 	"gdyb/controllers/hb"
5
-	"gdyb/controllers/js"
6
 	"gdyb/controllers/sg"
5
 	"gdyb/controllers/sg"
7
 	"gdyb/controllers/zh"
6
 	"gdyb/controllers/zh"
8
 
7
 
28
 	hb.HbybRegistRouters()
27
 	hb.HbybRegistRouters()
29
 	//sz.SZHisManagerApiRegistRouters()
28
 	//sz.SZHisManagerApiRegistRouters()
30
 	zh.ZHHisManagerApiRegistRouters()
29
 	zh.ZHHisManagerApiRegistRouters()
31
-	js.JSybRegistRouters()
30
+	//js.JSybRegistRorouters()
32
 
31
 
33
 }
32
 }

+ 37 - 40
service/jsyb_service.go Просмотреть файл

1
 package service
1
 package service
2
 
2
 
3
 import (
3
 import (
4
-	"bytes"
5
 	"crypto/hmac"
4
 	"crypto/hmac"
6
 	"crypto/sha1"
5
 	"crypto/sha1"
7
 	"encoding/base64"
6
 	"encoding/base64"
8
 	"encoding/json"
7
 	"encoding/json"
9
 	"fmt"
8
 	"fmt"
10
 	"gdyb/utils/csbhttp"
9
 	"gdyb/utils/csbhttp"
11
-	"io/ioutil"
12
-	"net/http"
13
 	"strconv"
10
 	"strconv"
14
 	"time"
11
 	"time"
15
 )
12
 )
54
 	inputMessage["input"] = input //交易输入
51
 	inputMessage["input"] = input //交易输入
55
 
52
 
56
 	//var inputLog string
53
 	//var inputLog string
57
-	bytesData, err := json.Marshal(inputMessage)
54
+	bytesData, _ := json.Marshal(inputMessage)
58
 	//inputLog = string(bytesData)
55
 	//inputLog = string(bytesData)
59
-	fmt.Println(string(bytesData))
60
-	if err != nil {
61
-		fmt.Println(err.Error())
62
-		return err.Error(), ""
63
-	}
64
-	reader := bytes.NewReader(bytesData)
65
-
66
-	request, err := http.NewRequest("POST", "http://10.72.3.87:8086/CSB/1101", reader)
67
-	if err != nil {
68
-		fmt.Println(err.Error())
69
-		return err.Error(), ""
70
-	}
71
-	key := "_api_access_key=" + access_key + "&_api_name=" + "hssServives" + "&_api_timestamp=" + strconv.FormatInt(timestamp, 10) + "&_api_version=" + "1.0.0"
72
-
73
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
74
-	request.Header.Set("_api_timestamp", strconv.FormatInt(timestamp, 10))
75
-	request.Header.Set("_api_name", "hssServives")
76
-	request.Header.Set("_api_version", "1.0.0")
77
-	request.Header.Set("_api_access_key", access_key)
78
-	request.Header.Set("_api_signature", hmacsha1(key, secret_key))
79
-
80
-	client := http.Client{}
81
-	resp, err := client.Do(request)
82
-	if err != nil {
83
-		fmt.Println(err.Error())
84
-		return err.Error(), ""
85
-	}
86
-	respBytes, err := ioutil.ReadAll(resp.Body)
87
-	if err != nil {
88
-		fmt.Println(err.Error())
89
-		return err.Error(), ""
90
-	}
91
-	fmt.Println(string(respBytes))
92
-	str := string(respBytes)
93
-	return str, ""
94
-	//return HttpRequest(request_url, access_key, secret_key, timestamp, bytesData, string(bytesData)), inputLog
56
+	//fmt.Println(string(bytesData))
57
+	//if err != nil {
58
+	//	fmt.Println(err.Error())
59
+	//	return err.Error(), ""
60
+	//}
61
+	//reader := bytes.NewReader(bytesData)
62
+	//
63
+	//request, err := http.NewRequest("POST", "http://10.72.3.87:8086/CSB/1101", reader)
64
+	//if err != nil {
65
+	//	fmt.Println(err.Error())
66
+	//	return err.Error(), ""
67
+	//}
68
+	//key := "_api_access_key=" + access_key + "&_api_name=" + "hssServives" + "&_api_timestamp=" + strconv.FormatInt(timestamp, 10) + "&_api_version=" + "1.0.0"
69
+	//
70
+	//request.Header.Set("Content-Type", "application/json;charset=UTF-8")
71
+	//request.Header.Set("_api_timestamp", strconv.FormatInt(timestamp, 10))
72
+	//request.Header.Set("_api_name", "hssServives")
73
+	//request.Header.Set("_api_version", "1.0.0")
74
+	//request.Header.Set("_api_access_key", access_key)
75
+	//request.Header.Set("_api_signature", hmacsha1(key, secret_key))
76
+	//
77
+	//client := http.Client{}
78
+	//resp, err := client.Do(request)
79
+	//if err != nil {
80
+	//	fmt.Println(err.Error())
81
+	//	return err.Error(), ""
82
+	//}
83
+	//respBytes, err := ioutil.ReadAll(resp.Body)
84
+	//if err != nil {
85
+	//	fmt.Println(err.Error())
86
+	//	return err.Error(), ""
87
+	//}
88
+	//fmt.Println(string(respBytes))
89
+	//str := string(respBytes)
90
+	//return str, ""
91
+	return HttpRequest(request_url, access_key, secret_key, timestamp, bytesData, string(bytesData)), ""
95
 }
92
 }
96
 func HttpRequest(url string, ak string, sk string, timestamp int64, requestByte []byte, json string) string {
93
 func HttpRequest(url string, ak string, sk string, timestamp int64, requestByte []byte, json string) string {
97
 	fmt.Println(url)
94
 	fmt.Println(url)