95 lines
3.8 KiB
Go
95 lines
3.8 KiB
Go
package dict
|
||
|
||
import (
|
||
"time"
|
||
)
|
||
|
||
// DatasourcePlatform 数据源平台配置实体
|
||
type DatasourcePlatform struct {
|
||
// 主键和标识字段
|
||
ID int64 `orm:"id" json:"id" description:"主键ID,自增长"`
|
||
PlatformCode string `orm:"platform_code" json:"platformCode" description:"平台编码,唯一标识"`
|
||
PlatformName string `orm:"platform_name" json:"platformName" description:"平台名称"`
|
||
Description string `orm:"description" json:"description" description:"平台描述"`
|
||
|
||
// 状态和基础配置
|
||
Status string `orm:"status" json:"status" description:"状态: ACTIVE启用, INACTIVE停用"`
|
||
ApiBaseUrl string `orm:"api_base_url" json:"apiBaseUrl" description:"API基础地址"`
|
||
|
||
// 认证配置
|
||
AuthType string `orm:"auth_type" json:"authType" description:"认证类型: TOKEN/API_KEY/OAUTH2/BASIC"`
|
||
Token string `orm:"token" json:"token" description:"认证token/密钥"`
|
||
ApiKey string `orm:"api_key" json:"apiKey" description:"API Key"`
|
||
ClientId string `orm:"client_id" json:"clientId" description:"OAuth2 Client ID"`
|
||
ClientSecret string `orm:"client_secret" json:"clientSecret" description:"OAuth2 Client Secret"`
|
||
|
||
// 限流配置
|
||
RateLimitPerMinute int `orm:"rate_limit_per_minute" json:"rateLimitPerMinute" description:"每分钟请求限制"`
|
||
RateLimitPerHour int `orm:"rate_limit_per_hour" json:"rateLimitPerHour" description:"每小时请求限制"`
|
||
ConcurrencyLimit int `orm:"concurrency_limit" json:"concurrencyLimit" description:"并发连接限制"`
|
||
RequestTimeoutMs int `orm:"request_timeout_ms" json:"requestTimeoutMs" description:"请求超时时间(毫秒)"`
|
||
|
||
// 重试策略
|
||
MaxRetries int `orm:"max_retries" json:"maxRetries" description:"最大重试次数"`
|
||
RetryDelayMs int `orm:"retry_delay_ms" json:"retryDelayMs" description:"重试延迟(毫秒)"`
|
||
|
||
// 元数据
|
||
CreatedBy string `orm:"created_by" json:"createdBy" description:"创建人"`
|
||
CreatedAt *time.Time `orm:"created_at" json:"createdAt" description:"创建时间"`
|
||
UpdatedBy string `orm:"updated_by" json:"updatedBy" description:"更新人"`
|
||
UpdatedAt *time.Time `orm:"updated_at" json:"updatedAt" description:"更新时间"`
|
||
Version int `orm:"version" json:"version" description:"版本号(乐观锁)"`
|
||
}
|
||
|
||
// DatasourcePlatformCol 数据源平台配置表字段定义
|
||
type DatasourcePlatformCol struct {
|
||
ID string
|
||
PlatformCode string
|
||
PlatformName string
|
||
Description string
|
||
Status string
|
||
ApiBaseUrl string
|
||
AuthType string
|
||
Token string
|
||
ApiKey string
|
||
ClientId string
|
||
ClientSecret string
|
||
RateLimitPerMinute string
|
||
RateLimitPerHour string
|
||
ConcurrencyLimit string
|
||
RequestTimeoutMs string
|
||
MaxRetries string
|
||
RetryDelayMs string
|
||
CreatedBy string
|
||
CreatedAt string
|
||
UpdatedBy string
|
||
UpdatedAt string
|
||
Version string
|
||
}
|
||
|
||
// DatasourcePlatformCols 数据源平台配置表字段常量
|
||
var DatasourcePlatformCols = DatasourcePlatformCol{
|
||
ID: "id",
|
||
PlatformCode: "platform_code",
|
||
PlatformName: "platform_name",
|
||
Description: "description",
|
||
Status: "status",
|
||
ApiBaseUrl: "api_base_url",
|
||
AuthType: "auth_type",
|
||
Token: "token",
|
||
ApiKey: "api_key",
|
||
ClientId: "client_id",
|
||
ClientSecret: "client_secret",
|
||
RateLimitPerMinute: "rate_limit_per_minute",
|
||
RateLimitPerHour: "rate_limit_per_hour",
|
||
ConcurrencyLimit: "concurrency_limit",
|
||
RequestTimeoutMs: "request_timeout_ms",
|
||
MaxRetries: "max_retries",
|
||
RetryDelayMs: "retry_delay_ms",
|
||
CreatedBy: "created_by",
|
||
CreatedAt: "created_at",
|
||
UpdatedBy: "updated_by",
|
||
UpdatedAt: "updated_at",
|
||
Version: "version",
|
||
}
|