| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <?php
- return [
- /*
- |--------------------------------------------------------------------------
- | ThirdParty模块配置
- |--------------------------------------------------------------------------
- |
- | 这里定义了ThirdParty模块的各种配置选项
- |
- */
- // 模块基础配置
- 'module' => [
- 'name' => 'ThirdParty',
- 'version' => '1.0.0',
- 'description' => '第三方服务管理模块',
- 'author' => 'KKU Team',
- ],
- // 默认配置
- 'defaults' => [
- 'timeout' => 30, // 默认超时时间(秒)
- 'retry_times' => 3, // 默认重试次数
- 'retry_delay' => 1000, // 默认重试延迟(毫秒)
- 'auth_type' => 'API_KEY', // 默认认证类型
- 'service_status' => 'INACTIVE', // 默认服务状态
- 'environment' => 'production', // 默认环境
- 'health_check_interval' => 300, // 默认健康检查间隔(秒)
- ],
- // HTTP客户端配置
- 'http' => [
- 'timeout' => 30, // HTTP请求超时时间
- 'connect_timeout' => 10, // 连接超时时间
- 'verify' => true, // 是否验证SSL证书
- 'user_agent' => 'KKU-ThirdParty/1.0',
- 'headers' => [
- 'Accept' => 'application/json',
- 'Content-Type' => 'application/json',
- ],
- ],
- // 重试配置
- 'retry' => [
- 'max_attempts' => 3, // 最大重试次数
- 'delay' => 1000, // 重试延迟(毫秒)
- 'multiplier' => 2, // 延迟倍数
- 'max_delay' => 10000, // 最大延迟(毫秒)
- 'retry_on_status' => [ // 需要重试的HTTP状态码
- 429, 500, 502, 503, 504
- ],
- ],
- // 日志配置
- 'logging' => [
- 'enabled' => true, // 是否启用日志
- 'level' => 'INFO', // 默认日志级别
- 'max_body_size' => 10240, // 最大请求/响应体大小(字节)
- 'sensitive_fields' => [ // 敏感字段(不记录到日志)
- 'password',
- 'secret',
- 'token',
- 'key',
- 'authorization',
- ],
- 'retention_days' => 30, // 日志保留天数
- ],
- // 监控配置
- 'monitoring' => [
- 'enabled' => true, // 是否启用监控
- 'health_check' => [
- 'enabled' => true, // 是否启用健康检查
- 'interval' => 300, // 检查间隔(秒)
- 'timeout' => 10, // 检查超时时间(秒)
- 'retry_times' => 2, // 检查重试次数
- ],
- 'performance' => [
- 'enabled' => true, // 是否启用性能监控
- 'slow_threshold' => 2000, // 慢请求阈值(毫秒)
- 'alert_threshold' => 5000, // 告警阈值(毫秒)
- ],
- 'availability' => [
- 'enabled' => true, // 是否启用可用性监控
- 'check_interval' => 60, // 检查间隔(秒)
- 'failure_threshold' => 3, // 失败阈值
- ],
- ],
- // 配额管理配置
- 'quota' => [
- 'enabled' => true, // 是否启用配额管理
- 'default_limits' => [
- 'PER_MINUTE' => 100, // 每分钟默认限制
- 'PER_HOUR' => 1000, // 每小时默认限制
- 'PER_DAY' => 10000, // 每天默认限制
- 'PER_MONTH' => 100000, // 每月默认限制
- ],
- 'alert_threshold' => 80, // 默认告警阈值(百分比)
- 'auto_reset' => true, // 是否自动重置配额
- ],
- // 缓存配置
- 'cache' => [
- 'enabled' => true, // 是否启用缓存
- 'prefix' => 'thirdparty:', // 缓存键前缀
- 'ttl' => 3600, // 默认缓存时间(秒)
- 'credentials_ttl' => 1800, // 凭证缓存时间(秒)
- 'quota_ttl' => 300, // 配额缓存时间(秒)
- ],
- // 安全配置
- 'security' => [
- 'encryption' => [
- 'enabled' => true, // 是否启用加密
- 'algorithm' => 'AES-256-CBC', // 加密算法
- ],
- 'webhook' => [
- 'verify_signature' => true, // 是否验证Webhook签名
- 'signature_header' => 'X-Signature',
- 'signature_algorithm' => 'sha256',
- ],
- 'rate_limiting' => [
- 'enabled' => true, // 是否启用频率限制
- 'max_requests_per_minute' => 60,
- ],
- ],
- // 告警配置
- 'alerts' => [
- 'enabled' => true, // 是否启用告警
- 'channels' => ['mail', 'sms'], // 告警渠道
- 'thresholds' => [
- 'quota_usage' => 80, // 配额使用告警阈值(百分比)
- 'error_rate' => 10, // 错误率告警阈值(百分比)
- 'response_time' => 5000, // 响应时间告警阈值(毫秒)
- ],
- 'cooldown' => 300, // 告警冷却时间(秒)
- ],
- // 服务提供商配置模板
- 'providers' => [
- 'aliyun' => [
- 'name' => '阿里云',
- 'base_url' => 'https://ecs.aliyuncs.com',
- 'auth_type' => 'API_KEY',
- 'required_credentials' => ['access_key_id', 'access_key_secret'],
- 'regions' => ['cn-hangzhou', 'cn-beijing', 'cn-shanghai'],
- ],
- 'tencent' => [
- 'name' => '腾讯云',
- 'base_url' => 'https://cvm.tencentcloudapi.com',
- 'auth_type' => 'SIGNATURE',
- 'required_credentials' => ['secret_id', 'secret_key'],
- 'regions' => ['ap-beijing', 'ap-shanghai', 'ap-guangzhou'],
- ],
- 'baidu' => [
- 'name' => '百度云',
- 'base_url' => 'https://bcc.bj.baidubce.com',
- 'auth_type' => 'SIGNATURE',
- 'required_credentials' => ['access_key', 'secret_key'],
- 'regions' => ['bj', 'gz', 'su'],
- ],
- ],
- // 服务类型配置
- 'service_types' => [
- 'SMS' => [
- 'name' => '短信服务',
- 'icon' => 'fa-sms',
- 'color' => 'primary',
- 'default_timeout' => 10,
- 'default_retry' => 3,
- ],
- 'EMAIL' => [
- 'name' => '邮件服务',
- 'icon' => 'fa-envelope',
- 'color' => 'info',
- 'default_timeout' => 30,
- 'default_retry' => 2,
- ],
- 'PUSH' => [
- 'name' => '推送服务',
- 'icon' => 'fa-bell',
- 'color' => 'warning',
- 'default_timeout' => 15,
- 'default_retry' => 3,
- ],
- 'PAYMENT' => [
- 'name' => '支付服务',
- 'icon' => 'fa-credit-card',
- 'color' => 'success',
- 'default_timeout' => 60,
- 'default_retry' => 1,
- ],
- 'STORAGE' => [
- 'name' => '存储服务',
- 'icon' => 'fa-cloud',
- 'color' => 'secondary',
- 'default_timeout' => 120,
- 'default_retry' => 2,
- ],
- ],
- // 环境配置
- 'environments' => [
- 'production' => [
- 'name' => '生产环境',
- 'color' => 'danger',
- 'requires_approval' => true,
- ],
- 'staging' => [
- 'name' => '预发布环境',
- 'color' => 'warning',
- 'requires_approval' => false,
- ],
- 'development' => [
- 'name' => '开发环境',
- 'color' => 'info',
- 'requires_approval' => false,
- ],
- 'testing' => [
- 'name' => '测试环境',
- 'color' => 'secondary',
- 'requires_approval' => false,
- ],
- ],
- // 数据清理配置
- 'cleanup' => [
- 'enabled' => true, // 是否启用自动清理
- 'schedule' => '0 2 * * *', // 清理计划(Cron表达式)
- 'retention' => [
- 'logs' => 30, // 日志保留天数
- 'monitors' => 90, // 监控记录保留天数
- 'inactive_credentials' => 180, // 未使用凭证保留天数
- ],
- ],
- // 导出配置
- 'export' => [
- 'formats' => ['csv', 'excel', 'json'],
- 'max_records' => 10000, // 最大导出记录数
- 'chunk_size' => 1000, // 分块大小
- ],
- ];
|