作者 tangxuhui
1 -FROM golang:latest 1 +FROM 192.168.0.243:5000/mmm/allied-creation-gateway:20210809
2 ENV APP_DIR $GOPATH/src/project 2 ENV APP_DIR $GOPATH/src/project
3 RUN mkdir -p $APP_DIR 3 RUN mkdir -p $APP_DIR
4 WORKDIR $APP_DIR/ 4 WORKDIR $APP_DIR/
@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
4 "github.com/beego/beego/v2/server/web" 4 "github.com/beego/beego/v2/server/web"
5 "github.com/linmadan/egglib-go/log/logrus" 5 "github.com/linmadan/egglib-go/log/logrus"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
  7 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/cache" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/cache"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
9 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" 10 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
@@ -5,7 +5,7 @@ import ( @@ -5,7 +5,7 @@ import (
5 "strconv" 5 "strconv"
6 ) 6 )
7 7
8 -const SERVICE_NAME = "gateway" 8 +const SERVICE_NAME = "allied-creation-gateway"
9 9
10 var LOG_LEVEL = "debug" 10 var LOG_LEVEL = "debug"
11 11
@@ -9,8 +9,8 @@ import ( @@ -9,8 +9,8 @@ import (
9 9
10 "github.com/beego/beego/v2/server/web" 10 "github.com/beego/beego/v2/server/web"
11 "github.com/linmadan/egglib-go/web/beego/filters" 11 "github.com/linmadan/egglib-go/web/beego/filters"
12 -  
13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" 12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
14 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/routers" 14 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/routers"
15 ) 15 )
16 16
@@ -34,7 +34,7 @@ func init() { @@ -34,7 +34,7 @@ func init() {
34 web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors()) 34 web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors())
35 web.InsertFilter("/*", web.BeforeExec, filters.CreateRequstLogFilter(log.Logger)) 35 web.InsertFilter("/*", web.BeforeExec, filters.CreateRequstLogFilter(log.Logger))
36 web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(log.Logger), web.WithReturnOnOutput(false)) 36 web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(log.Logger), web.WithReturnOnOutput(false))
37 - web.InsertFilter("/v1/app1/*", web.BeforeExec, filters.SecureHandler( 37 + web.InsertFilter("/v1/app11/*", web.BeforeExec, filters.SecureHandler(
38 filters.WithEnableCheckTimestamp(false), 38 filters.WithEnableCheckTimestamp(false),
39 filters.WithOnInvalidRequest(func(ctx *context.Context) { 39 filters.WithOnInvalidRequest(func(ctx *context.Context) {
40 headerData, _ := json.Marshal(ctx.Input.Context.Request.Header) 40 headerData, _ := json.Marshal(ctx.Input.Context.Request.Header)