数据引擎-快手平台数据抽取bug修复

This commit is contained in:
2026-06-16 10:44:10 +08:00
parent e5133eea34
commit b4fc6f54af
22 changed files with 1324 additions and 487 deletions

View File

@@ -7,6 +7,7 @@ import (
dao "dataengine/dao/dict"
dto "dataengine/model/dto/dict"
entity "dataengine/model/entity/dict"
"dataengine/utils"
"github.com/sirupsen/logrus"
)
@@ -32,7 +33,8 @@ type PlatformManager struct{}
// GetPlatform 根据平台编码获取配置
func (m *PlatformManager) GetPlatform(ctx context.Context, platformCode string) (*PlatformConfig, error) {
platform, err := dao.DatasourcePlatform.GetByPlatformCode(ctx, platformCode)
tenantId := utils.GetCurrentTenantId(ctx)
platform, err := dao.DatasourcePlatform.GetByPlatformCode(ctx, platformCode, tenantId)
if err != nil {
return nil, fmt.Errorf("查询平台配置失败 [%s]: %w", platformCode, err)
}
@@ -81,10 +83,11 @@ func (m *PlatformManager) GetPlatform(ctx context.Context, platformCode string)
// GetInterfaces 获取平台下的活跃接口列表
func (m *PlatformManager) GetInterfaces(ctx context.Context, platformId int64) ([]entity.ApiInterface, error) {
tenantId := utils.GetCurrentTenantId(ctx)
interfaces, _, err := dao.ApiInterface.List(ctx, &dto.ListApiInterfaceReq{
PlatformId: platformId,
Status: "active",
})
}, tenantId)
if err != nil {
return nil, err
}
@@ -93,11 +96,12 @@ func (m *PlatformManager) GetInterfaces(ctx context.Context, platformId int64) (
// GetInterfaceByCode 根据编码获取接口定义
func (m *PlatformManager) GetInterfaceByCode(ctx context.Context, platformId int64, code string) (*entity.ApiInterface, error) {
tenantId := utils.GetCurrentTenantId(ctx)
all, _, err := dao.ApiInterface.List(ctx, &dto.ListApiInterfaceReq{
PlatformId: platformId,
Code: code,
Status: "active",
})
}, tenantId)
if err != nil {
return nil, err
}
@@ -113,7 +117,7 @@ func (m *PlatformManager) GetPlatformWithInterfaces(ctx context.Context, platfor
if err != nil {
return nil, nil, err
}
interfaces, err := m.GetInterfaces(ctx, cfg.ID)
interfaces, err := m.GetInterfaces(ctx, cfg.Id)
if err != nil {
return nil, nil, err
}