From 060a6667bb80deed2461cc3e125805b0fddee870 Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Sat, 23 Mar 2024 21:30:29 +0800 Subject: [PATCH] token2 --- conf/server.conf.dev | 10 ++++------ worker/haha/haha_sync_order.go | 9 ++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/conf/server.conf.dev b/conf/server.conf.dev index c06f7c2..ed171cc 100644 --- a/conf/server.conf.dev +++ b/conf/server.conf.dev @@ -1,22 +1,20 @@ [server] address = "0.0.0.0:9263" #0:PAINC 1:FATAL 2:ERROR 3:WARNING 4:INFO 5:DEBUG 6:TRACE -log_level = 4 +log_level = 5 [mysql] -host = "100.118.29.74" -port = 3307 +host = "14.22.116.197" +port = 9305 user = "film" pass = "7VCfJx7H8MymUm" db = "film" + [weixin] qiye_appid = "ww288920bd3e8c92b2" qiye_secret = "3aqE6LAEKLiGtYBtX7TZm0uY_YD52w3R20AQirSICXY" qiye_agent = "1000013" receiver = ["jiangyong", "zhangping"] -[film] -haha_token = "d6847dfbd7b79bc18709e0311fd7813b" -dadi_token = "321566:7b84a0b1-832a-4492-a96a-23002d6c8715" \ No newline at end of file diff --git a/worker/haha/haha_sync_order.go b/worker/haha/haha_sync_order.go index caa2aa6..cdd2ece 100644 --- a/worker/haha/haha_sync_order.go +++ b/worker/haha/haha_sync_order.go @@ -14,6 +14,7 @@ import ( "io" "net/http" "net/url" + "strings" "time" ) @@ -75,8 +76,8 @@ func (s *SyncOrder) run() { return } var arrs []interface{} - if err := json.Unmarshal([]byte(originText), &arrs); err != nil { - log.Errorf("json.Unmarsha error :%s", err.Error()) + if err := json.Unmarshal([]byte(strings.Trim(originText, "\r\n\t ")), &arrs); err != nil { + log.Errorf("json.Unmarshal error :%s", err.Error()) return } for _, d := range arrs { @@ -124,7 +125,7 @@ func (s *SyncOrder) run() { default: log.Errorf("new order chan is full!") } - + log.Infof("add order :%s", order.OrderNo) } else { model.UpdateOrder(order) select { @@ -132,8 +133,10 @@ func (s *SyncOrder) run() { default: log.Errorf("update order chan is full!") } + log.Infof("update order :%s", order.OrderNo) } } + log.Infof("update/add order total:%d", len(arrs)) } func (s *SyncOrder) httpPost(requestUrl string) ([]byte, error) {