|
@@ -2,9 +2,7 @@ package maycur
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
- "encoding/json"
|
|
|
"fmt"
|
|
|
- "hongze/hongze_task/models"
|
|
|
"hongze/hongze_task/services/alarm_msg"
|
|
|
"hongze/hongze_task/utils"
|
|
|
"io/ioutil"
|
|
@@ -22,7 +20,7 @@ func DailyUpdateCompanyProfile(cont context.Context) (err error) {
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("DailyUpdateCompanyProfile ErrMsg: %s", err.Error())
|
|
|
// 出错的话hongze_admin那边有报错, 这边只要定时请求了就行...
|
|
|
- alarm_msg.SendAlarmMsg(fmt.Sprintf("每日更新客户档案失败, ErrMsg: %s", err.Error()), 2)
|
|
|
+ go alarm_msg.SendAlarmMsg(fmt.Sprintf("每日更新客户档案失败, ErrMsg: %s", err.Error()), 2)
|
|
|
}
|
|
|
}()
|
|
|
|
|
@@ -44,25 +42,26 @@ func DailyUpdateCompanyProfile(cont context.Context) (err error) {
|
|
|
defer func() {
|
|
|
_ = resp.Body.Close()
|
|
|
}()
|
|
|
- b, e := ioutil.ReadAll(resp.Body)
|
|
|
- if e != nil {
|
|
|
- err = fmt.Errorf("resp body read err: %s", e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- if len(b) == 0 {
|
|
|
- err = fmt.Errorf("resp body is empty")
|
|
|
- return
|
|
|
- }
|
|
|
- // 解密
|
|
|
- bo := utils.DesBase64Decrypt(b)
|
|
|
- result := new(models.BaseResponse)
|
|
|
- if e = json.Unmarshal(bo, &result); e != nil {
|
|
|
- err = fmt.Errorf("result unmarshal err: %s\nresult: %s", e.Error(), string(b))
|
|
|
- return
|
|
|
- }
|
|
|
- if result.Ret != 200 {
|
|
|
- err = fmt.Errorf("result: %s", string(b))
|
|
|
- return err
|
|
|
- }
|
|
|
+
|
|
|
+ //b, e := ioutil.ReadAll(resp.Body)
|
|
|
+ //if e != nil {
|
|
|
+ // err = fmt.Errorf("resp body read err: %s", e.Error())
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //if len(b) == 0 {
|
|
|
+ // err = fmt.Errorf("resp body is empty")
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //// 解密
|
|
|
+ //bo := utils.DesBase64Decrypt(b)
|
|
|
+ //result := new(models.BaseResponse)
|
|
|
+ //if e = json.Unmarshal(bo, &result); e != nil {
|
|
|
+ // err = fmt.Errorf("result unmarshal err: %s\nresult: %s", e.Error(), string(b))
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //if result.Ret != 200 {
|
|
|
+ // err = fmt.Errorf("result: %s", string(b))
|
|
|
+ // return err
|
|
|
+ //}
|
|
|
return
|
|
|
}
|