作者 tangxuhui

Merge branch 'dev' into test

... ... @@ -113,6 +113,8 @@ spec:
value: "http://allied-creation-basic-dev.fjmaimaimai.com"
- name: SMS_SERVE_HOST
value: "https://sms.fjmaimaimai.com:9897"
- name: SUPLUS_SALE_APP
value: "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
# - name: REDIS_HOST
# valueFrom:
# configMapKeyRef:
... ...
... ... @@ -119,6 +119,8 @@ spec:
value: "https://allied-creation-basic-test.fjmaimaimai.com"
- name: SMS_SERVE_HOST
value: "https://sms.fjmaimaimai.com:9897"
- name: SUPLUS_SALE_APP
value: "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
# - name: REDIS_HOST
# valueFrom:
# configMapKeyRef:
... ...
... ... @@ -31,6 +31,9 @@ var SUPLUS_ADMIN_BASE_HOST = "http://suplus-admin-base-test.fjmaimaimai.com"
//通用模块短信服务
var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
//素加销售导航服务
var SUPLUS_SALE_APP = "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
// TODO:特殊短信验证码,不验证,正式环境注入空
var SMSCODE_ALL_POWER = "999512"
... ... @@ -65,4 +68,7 @@ func init() {
if os.Getenv("SMSCODE_ALL_POWER") != "" {
SMSCODE_ALL_POWER = os.Getenv("SMSCODE_ALL_POWER")
}
if os.Getenv("SUPLUS_SALE_APP") != "" {
SUPLUS_SALE_APP = os.Getenv("SUPLUS_SALE_APP")
}
}
... ...
package mobile_client
import (
"fmt"
"github.com/beego/beego/v2/client/httplib"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers"
)
//代理请求转发
type ReverseProxyController struct {
controllers.BaseController
}
func (controller *ReverseProxyController) SuplusSaleApp() {
//routePrefix := "/suplus-sale-app"
proxyHostUrl := constant.SUPLUS_SALE_APP + "/v1/platform/district"
req := httplib.Post(proxyHostUrl)
req.Header("Content-Type", "application/json")
req = req.Body(controller.Ctx.Input.RequestBody)
fmt.Println(string(controller.Ctx.Input.RequestBody))
// req.JSONBody() b.req.Header.Set(, "application/json")
respData, err := req.Bytes()
if err != nil {
controller.Response(nil, err)
return
}
controller.Ctx.Output.Header("Content-Type", "application/json; charset=utf-8")
controller.Ctx.Output.Body(respData)
}
... ...
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/mobile_client"
)
func init() {
/***** 转发销售导航的请求*****/
web.Router("/suplus-sale-app/v1/platform/district", &mobile_client.ReverseProxyController{}, "post:SuplusSaleApp")
}
... ...