From 8aa30b5b25636074f824ff502e52eb16ae627b4d Mon Sep 17 00:00:00 2001 From: cjy Date: Fri, 17 Oct 2025 08:49:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20dci=20=E7=9A=84?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/dev/config.yaml | 4 ++++ conf/k8stest/config.yaml | 4 ++++ conf/prod/config.yaml | 4 ++++ config/config.go | 10 ++++++++-- pkg/bccr/bccr.go | 7 ++++--- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/conf/dev/config.yaml b/conf/dev/config.yaml index 4d2101b..1405499 100644 --- a/conf/dev/config.yaml +++ b/conf/dev/config.yaml @@ -23,6 +23,10 @@ BccrYXT: access_key_id: "ACSvp2GUdWUucS7r" access_key_secret: "dQ8hFkLs2qnMNYRuvrtzDp6mtQB7uVwg" end_point: "openapi-sit.antchain.antgroup.com" +BccrYXTT: + access_key_id: "ACP3FoMEReCspQE9" + access_key_secret: "dSKMGNjByXJsd1jcqjZomSPkwvR9AfBJ" + end_point: "openapi-sit.antchain.antgroup.com" #aliYunRtc: # appid: "aeztom27" # app_key: "76c62466cbd77d7a3606660a15861d1e" diff --git a/conf/k8stest/config.yaml b/conf/k8stest/config.yaml index e3d21cd..8e96a25 100644 --- a/conf/k8stest/config.yaml +++ b/conf/k8stest/config.yaml @@ -17,6 +17,10 @@ BccrYXT: access_key_secret: "dQ8hFkLs2qnMNYRuvrtzDp6mtQB7uVwg" # end_point: "openapi.antchain.antgroup.com" # 正式的 endpoint end_point: "openapi-sit.antchain.antgroup.com" # 测试式的 endpoint +BccrYXTT: + access_key_id: "ACP3FoMEReCspQE9" + access_key_secret: "dSKMGNjByXJsd1jcqjZomSPkwvR9AfBJ" + end_point: "openapi-sit.antchain.antgroup.com" # 测试式的 endpoint #redis: # db: ${oa-meeting.redis.db} # addr: ${redis.addr} diff --git a/conf/prod/config.yaml b/conf/prod/config.yaml index d127ad3..319a816 100644 --- a/conf/prod/config.yaml +++ b/conf/prod/config.yaml @@ -9,6 +9,10 @@ BccrYXT: access_key_id: "ACSvp2GUdWUucS7r" access_key_secret: "dQ8hFkLs2qnMNYRuvrtzDp6mtQB7uVwg" end_point: "openapi.antchain.antgroup.com" +BccrYXTT: + access_key_id: "ACP3FoMEReCspQE9" + access_key_secret: "dSKMGNjByXJsd1jcqjZomSPkwvR9AfBJ" + end_point: "openapi.antchain.antgroup.com" #redis: # db: ${oa-meeting.redis.db} # addr: ${redis.addr} diff --git a/config/config.go b/config/config.go index 3e209b2..05e00ed 100644 --- a/config/config.go +++ b/config/config.go @@ -2,12 +2,13 @@ package config import ( "chain-dci/pkg/msg" - "dubbo.apache.org/dubbo-go/v3/common/constant" "fmt" - "github.com/spf13/viper" "os" "reflect" "strings" + + "dubbo.apache.org/dubbo-go/v3/common/constant" + "github.com/spf13/viper" ) var Data = new(AppConfig) @@ -39,6 +40,11 @@ type AppConfig struct { AccessKeySecret string `mapstructure:"access_key_secret"` EndPoint string `mapstructure:"end_point"` } + BccrYXTT struct { + AccessKeyID string `mapstructure:"access_key_id"` + AccessKeySecret string `mapstructure:"access_key_secret"` + EndPoint string `mapstructure:"end_point"` + } Redis struct { DB string Addr string diff --git a/pkg/bccr/bccr.go b/pkg/bccr/bccr.go index 87d704a..ebdead9 100644 --- a/pkg/bccr/bccr.go +++ b/pkg/bccr/bccr.go @@ -2,6 +2,7 @@ package bccr import ( dciConfig "chain-dci/config" + bccrClient "github.com/antchain-openapi-sdk-go/bccr/client" "github.com/google/wire" ) @@ -12,9 +13,9 @@ func NewBccrClient() *bccrClient.Client { // Endpoint 请参考 https://api.aliyun.com/product/rtc bccrConfig := new(bccrClient.Config) - bccrConfig.SetEndpoint(dciConfig.Data.BccrYXT.EndPoint) - bccrConfig.SetAccessKeyId(dciConfig.Data.BccrYXT.AccessKeyID) - bccrConfig.SetAccessKeySecret(dciConfig.Data.BccrYXT.AccessKeySecret) + bccrConfig.SetEndpoint(dciConfig.Data.BccrYXTT.EndPoint) + bccrConfig.SetAccessKeyId(dciConfig.Data.BccrYXTT.AccessKeyID) + bccrConfig.SetAccessKeySecret(dciConfig.Data.BccrYXTT.AccessKeySecret) client, err := bccrClient.NewClient(bccrConfig) if err != nil {