Browse Source

短信接口

lining 6 years ago
parent
commit
55de81bbbb
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/dashoo.cn/backend/api/business/oilrtx/RtxService.go

+ 3 - 5
src/dashoo.cn/backend/api/business/oilrtx/RtxService.go

@@ -3,7 +3,6 @@ package oilrtx
 import (
 	"dashoo.cn/utils"
 	"encoding/json"
-	"fmt"
 	"io/ioutil"
 	"log"
 	"net/http"
@@ -162,12 +161,11 @@ func (s *RtxService) HandleSendMsg(username string, tomobile string, message str
 	json, err := json.Marshal(msg)
 	params := string(json)
 	//msgStr, _ := simplifiedchinese.GBK.NewEncoder().String(message)
-	url := "http://gateway.dgyt.com/devopsapi/sendmsg"
+	url := "http://apigw.dgyt.com/devopsapi/sendmsg"
 	//req, err := http.NewRequest("post", "http://api.uidp.dgyt.petrochina/SMS/API/sendSMS", strings.NewReader(params))
-	fmt.Println(url)
-	req, err := http.NewRequest("post", url, strings.NewReader(params))
+	req, err := http.NewRequest("POST", url, strings.NewReader(params))
 	//resp, err := http.Get(url)
-	//req.Header.Add("Content-Type", "application/json")
+	req.Header.Add("Content-Type", "application/json")
 	//req.Header.Add("X-Token", "/LT6VRmkY8mpGHJzWMKxzMQhjbkXwAHsk0zJkRfAPtjC0Wsecn1539xiULbJU32D59Kh0jTuUD0=")
 
 	resp, err := client.Do(req)