|
@@ -254,21 +254,33 @@ func SendThs(title, labelStr, abstract, jumpBaseUrl, logoUrl string) (err error)
|
|
|
sendUrl := utils.THS_SendUrl
|
|
|
//fmt.Println("sendUrl:", sendUrl)
|
|
|
|
|
|
- utils.FileLog.Info("title:%s", title)
|
|
|
+ //标题字符长度截取,最多50位字符
|
|
|
+ title = utils.SubStr(title, 50)
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("title:%s", title))
|
|
|
title, err = gorsa.PublicEncrypt(title, pubKey)
|
|
|
- utils.FileLog.Info("labelStr:%s", labelStr)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //简介字符长度截取,最多50位字符
|
|
|
+ abstract = utils.SubStr(abstract, 50)
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("abstract:%s", abstract))
|
|
|
abstract, err = gorsa.PublicEncrypt(abstract, pubKey)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("labelStr:%s", labelStr))
|
|
|
label, err := gorsa.PublicEncrypt(labelStr, pubKey)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
jumpUrl, err := gorsa.PublicEncrypt(jumpBaseUrl, pubKey)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
picUrl, err := gorsa.PublicEncrypt(logoUrl, pubKey)
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -331,18 +343,26 @@ func SyncWxGroup(openCompanyCode, deadline string) (err error) {
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
deadline, err = gorsa.PublicEncrypt(deadline, pubKey)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ status := `1`
|
|
|
+ status, err = gorsa.PublicEncrypt(status, pubKey)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
//开始发送
|
|
|
client := http.Client{}
|
|
|
form := url.Values{}
|
|
|
form.Add("thirdWechatGroupId", openCompanyCode)
|
|
|
form.Add("deadline", deadline)
|
|
|
+ form.Add("status", status)
|
|
|
|
|
|
- utils.FileLog.Info("SendThs parms:%s", form.Encode())
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("SendThs SyncWxGroup parms:%s", form.Encode()))
|
|
|
resp, err := client.PostForm(sendUrl, form)
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -352,7 +372,7 @@ func SyncWxGroup(openCompanyCode, deadline string) (err error) {
|
|
|
body, _ := ioutil.ReadAll(resp.Body)
|
|
|
|
|
|
fmt.Println(string(body))
|
|
|
- utils.FileLog.Info("ThsResult parms:%s", string(body))
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("SyncWxGroup ThsResult parms:%s", string(body)))
|
|
|
|
|
|
//同花顺接口返回数据
|
|
|
var tshResult TshResult
|