From e55dbd93c7b8d8f3f9cb10a9d8357b3f8e033541 Mon Sep 17 00:00:00 2001 From: AlkaidChan <362774405@qq.com> Date: Fri, 19 Jan 2024 20:00:27 +0800 Subject: [PATCH] feat(bk-bscp): access blueking notification center --- bcs-services/bcs-bscp/cmd/api-server/service/bknotice.go | 2 +- bcs-services/bcs-bscp/pkg/cc/service.go | 1 + bcs-services/bcs-bscp/pkg/components/bknotice/bknotice.go | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bcs-services/bcs-bscp/cmd/api-server/service/bknotice.go b/bcs-services/bcs-bscp/cmd/api-server/service/bknotice.go index 4c73c508f6..8b579014d1 100644 --- a/bcs-services/bcs-bscp/cmd/api-server/service/bknotice.go +++ b/bcs-services/bcs-bscp/cmd/api-server/service/bknotice.go @@ -30,7 +30,7 @@ func (s *bkNoticeService) GetCurrentAnnouncements(w http.ResponseWriter, r *http // Prepare the new request proxyURL := fmt.Sprintf("%s/v1/announcement/get_current_announcements/?platform=%s", - config.G.Base.AppCode, cc.ApiServer().BKNotice.Host) + cc.ApiServer().BKNotice.Host, cc.ApiServer().Esb.AppCode) proxyReq, err := http.NewRequest("GET", proxyURL, nil) if err != nil { diff --git a/bcs-services/bcs-bscp/pkg/cc/service.go b/bcs-services/bcs-bscp/pkg/cc/service.go index 5a9063e569..f3f08a2d34 100644 --- a/bcs-services/bcs-bscp/pkg/cc/service.go +++ b/bcs-services/bcs-bscp/pkg/cc/service.go @@ -73,6 +73,7 @@ type ApiServerSetting struct { Log LogOption `yaml:"log"` Repo Repository `yaml:"repository"` BKNotice BKNotice `yaml:"bkNotice"` + Esb Esb `yaml:"esb"` FeatureFlags map[FeatureFlag]FeatureFlagOption `yaml:"featureFlags"` } diff --git a/bcs-services/bcs-bscp/pkg/components/bknotice/bknotice.go b/bcs-services/bcs-bscp/pkg/components/bknotice/bknotice.go index 0f9e243ae0..671425090f 100644 --- a/bcs-services/bcs-bscp/pkg/components/bknotice/bknotice.go +++ b/bcs-services/bcs-bscp/pkg/components/bknotice/bknotice.go @@ -20,7 +20,6 @@ import ( "github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/cc" "github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/components" - "github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/config" ) type registerSystemResp struct { @@ -34,7 +33,7 @@ func RegisterSystem(ctx context.Context) error { url := fmt.Sprintf("%s/v1/register/", cc.ApiServer().BKNotice.Host) authHeader := fmt.Sprintf("{\"bk_app_code\": \"%s\", \"bk_app_secret\": \"%s\"}", - config.G.Base.AppCode, config.G.Base.AppSecret) + cc.ApiServer().Esb.AppCode, cc.ApiServer().Esb.AppSecret) resp, err := components.GetClient().R(). SetContext(ctx).