新增快手平台和对应的接口
This commit is contained in:
@@ -15,6 +15,8 @@ import (
|
||||
type PlatformConfig struct {
|
||||
*entity.DatasourcePlatform
|
||||
AccessToken string
|
||||
AppKey string
|
||||
AppSecret string
|
||||
}
|
||||
|
||||
// GetApiUrl 拼接完整 API URL
|
||||
@@ -52,6 +54,15 @@ func (m *PlatformManager) GetPlatform(ctx context.Context, platformCode string)
|
||||
}
|
||||
case "API_KEY":
|
||||
cfg.AccessToken = platform.ApiKey
|
||||
case "SIGN":
|
||||
if platform.AuthConfig != nil {
|
||||
if ak, _ := platform.AuthConfig["app_key"].(string); ak != "" {
|
||||
cfg.AppKey = ak
|
||||
}
|
||||
if as, _ := platform.AuthConfig["app_secret"].(string); as != "" {
|
||||
cfg.AppSecret = as
|
||||
}
|
||||
}
|
||||
default:
|
||||
logrus.Warnf("平台 %s 认证类型 %s 未处理", platformCode, platform.AuthType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user