作者 tangxuhui

Merge branch 'dev' into test

@@ -113,6 +113,8 @@ spec: @@ -113,6 +113,8 @@ spec:
113 value: "http://allied-creation-basic-dev.fjmaimaimai.com" 113 value: "http://allied-creation-basic-dev.fjmaimaimai.com"
114 - name: SMS_SERVE_HOST 114 - name: SMS_SERVE_HOST
115 value: "https://sms.fjmaimaimai.com:9897" 115 value: "https://sms.fjmaimaimai.com:9897"
  116 + - name: SUPLUS_SALE_APP
  117 + value: "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
116 # - name: REDIS_HOST 118 # - name: REDIS_HOST
117 # valueFrom: 119 # valueFrom:
118 # configMapKeyRef: 120 # configMapKeyRef:
@@ -119,6 +119,8 @@ spec: @@ -119,6 +119,8 @@ spec:
119 value: "https://allied-creation-basic-test.fjmaimaimai.com" 119 value: "https://allied-creation-basic-test.fjmaimaimai.com"
120 - name: SMS_SERVE_HOST 120 - name: SMS_SERVE_HOST
121 value: "https://sms.fjmaimaimai.com:9897" 121 value: "https://sms.fjmaimaimai.com:9897"
  122 + - name: SUPLUS_SALE_APP
  123 + value: "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
122 # - name: REDIS_HOST 124 # - name: REDIS_HOST
123 # valueFrom: 125 # valueFrom:
124 # configMapKeyRef: 126 # configMapKeyRef:
@@ -31,6 +31,9 @@ var SUPLUS_ADMIN_BASE_HOST = "http://suplus-admin-base-test.fjmaimaimai.com" @@ -31,6 +31,9 @@ var SUPLUS_ADMIN_BASE_HOST = "http://suplus-admin-base-test.fjmaimaimai.com"
31 //通用模块短信服务 31 //通用模块短信服务
32 var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897" 32 var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
33 33
  34 +//素加销售导航服务
  35 +var SUPLUS_SALE_APP = "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
  36 +
34 // TODO:特殊短信验证码,不验证,正式环境注入空 37 // TODO:特殊短信验证码,不验证,正式环境注入空
35 var SMSCODE_ALL_POWER = "999512" 38 var SMSCODE_ALL_POWER = "999512"
36 39
@@ -65,4 +68,7 @@ func init() { @@ -65,4 +68,7 @@ func init() {
65 if os.Getenv("SMSCODE_ALL_POWER") != "" { 68 if os.Getenv("SMSCODE_ALL_POWER") != "" {
66 SMSCODE_ALL_POWER = os.Getenv("SMSCODE_ALL_POWER") 69 SMSCODE_ALL_POWER = os.Getenv("SMSCODE_ALL_POWER")
67 } 70 }
  71 + if os.Getenv("SUPLUS_SALE_APP") != "" {
  72 + SUPLUS_SALE_APP = os.Getenv("SUPLUS_SALE_APP")
  73 + }
68 } 74 }
  1 +package mobile_client
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/client/httplib"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers"
  9 +)
  10 +
  11 +//代理请求转发
  12 +
  13 +type ReverseProxyController struct {
  14 + controllers.BaseController
  15 +}
  16 +
  17 +func (controller *ReverseProxyController) SuplusSaleApp() {
  18 + //routePrefix := "/suplus-sale-app"
  19 + proxyHostUrl := constant.SUPLUS_SALE_APP + "/v1/platform/district"
  20 + req := httplib.Post(proxyHostUrl)
  21 + req.Header("Content-Type", "application/json")
  22 + req = req.Body(controller.Ctx.Input.RequestBody)
  23 + fmt.Println(string(controller.Ctx.Input.RequestBody))
  24 + // req.JSONBody() b.req.Header.Set(, "application/json")
  25 + respData, err := req.Bytes()
  26 + if err != nil {
  27 + controller.Response(nil, err)
  28 + return
  29 + }
  30 + controller.Ctx.Output.Header("Content-Type", "application/json; charset=utf-8")
  31 + controller.Ctx.Output.Body(respData)
  32 +
  33 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/mobile_client"
  6 +)
  7 +
  8 +func init() {
  9 +
  10 + /***** 转发销售导航的请求*****/
  11 + web.Router("/suplus-sale-app/v1/platform/district", &mobile_client.ReverseProxyController{}, "post:SuplusSaleApp")
  12 +}