From dbc843d0b37f786fb816131bcc7ebca86dbe72e9 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 06 八月 2020 09:58:46 +0800
Subject: [PATCH] add crossRecord

---
 controllers/restriction.go |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/controllers/restriction.go b/controllers/restriction.go
index c4d4fdd..37ede7b 100644
--- a/controllers/restriction.go
+++ b/controllers/restriction.go
@@ -4,6 +4,7 @@
 	"car-service/extend/code"
 	"car-service/extend/util"
 	"encoding/json"
+	"fmt"
 	"github.com/astaxie/beego"
 	"net/http"
 	"github.com/robfig/cron"
@@ -31,7 +32,7 @@
 	} else {
 		resp.Success= false
 		resp.Status= http.StatusBadRequest
-		resp.Data= nil
+		resp.Data= "鏁版嵁璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯"
 	}
 	c.Data["json"] = resp
 	c.ServeJSON()
@@ -42,7 +43,7 @@
 func Schedule() {
 	c := cron.New()
 	//姣忓ぉ鍑屾櫒5鐐规墽琛屼竴娆★紝鑾峰彇褰撴棩鏁版嵁
-	c.AddFunc("0 0 5 * * ?", func() {
+	c.AddFunc("0 0 1 * * ?", func() {
 		todayRes = nil
 		getRestrictionInfo()
 	})
@@ -81,11 +82,13 @@
 	url := "http://v.juhe.cn/xianxing/index?key="+ juHeAppKey +"&city=beijing&type=1"
 	b, err := util.DoPostRequest(url, util.CONTENT_TYPE_JSON, nil, nil, nil)
 	if err != nil {
+		fmt.Println("err:", err)
 		return
 	}
 	var result JuHeResult
 	err = json.Unmarshal(b, &result)
 	if err != nil {
+		fmt.Println("unmarshal err:", err)
 		return
 	}
 	if result.ErrorCode == 0 {

--
Gitblit v1.8.0