Browse Source

Merge branch 'aj_google_travel' into debug

longyu 2 years ago
parent
commit
8feeae5e55
3 changed files with 12 additions and 1 deletions
  1. 9 1
      controllers/base_auth.go
  2. 2 0
      models/data_manage/edb_data_base.go
  3. 1 0
      utils/constants.go

+ 9 - 1
controllers/base_auth.go

@@ -8,6 +8,7 @@ import (
 	"net/http"
 	"net/url"
 	"github.com/beego/beego/v2/server/web"
+	"strings"
 
 	"github.com/rdlucklib/rdluck_tools/log"
 )
@@ -31,7 +32,14 @@ func (this *BaseAuthController) Prepare() {
 	fmt.Println("enter prepare")
 	method := this.Ctx.Input.Method()
 	uri := this.Ctx.Input.URI()
-	fmt.Println("Url:", uri)
+	ip := this.Ctx.Input.IP()
+	fmt.Println("Url:", uri+";ip:"+ip)
+	if strings.Contains(ip, "61.140.25.94") {
+		this.JSON(models.BaseResponse{Ret: 6000, Msg: "该图表已被删除", ErrMsg: "该图表已被删除"}, false, false)
+		this.StopRun()
+		return
+	}
+
 	if method != "HEAD" {
 		if method == "POST" || method == "GET" {
 			//authorization := this.Ctx.Input.Header("authorization")

+ 2 - 0
models/data_manage/edb_data_base.go

@@ -61,6 +61,8 @@ func GetEdbDataTableName(source int) (tableName string) {
 		tableName = "edb_data_coal"
 	case utils.DATA_SOURCE_PYTHON:
 		tableName = "edb_data_python"
+	case utils.DATA_SOURCE_GOOGLE_TRAVEL:
+		tableName = "edb_data_google_travel"
 	default:
 		tableName = ""
 	}

+ 1 - 0
utils/constants.go

@@ -60,6 +60,7 @@ const (
 	DATA_SOURCE_COAL                            //煤炭网->26
 	DATA_SOURCE_PYTHON                          //python代码->27
 	DATA_SOURCE_PB_FINANCE                      //彭博财务数据->28
+	DATA_SOURCE_GOOGLE_TRAVEL                   //谷歌出行->29
 )
 
 //数据刷新频率