| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <?php
- return [
- /*
- |--------------------------------------------------------------------------
- | Transfer模块配置
- |--------------------------------------------------------------------------
- |
- | Transfer模块的核心配置选项
- |
- */
- // 模块基本信息
- 'name' => 'Transfer',
- 'version' => '1.0.0',
- 'description' => '资金划转模块',
- // 默认配置
- 'defaults' => [
- // 默认汇率
- 'exchange_rate' => 1.0000,
-
- // 默认货币类型
- 'currency_id' => 2, // 钻石
-
- // 默认资金账户类型
- 'fund_id' => 2,
-
- // 金额精度
- 'amount_precision' => 10,
-
- // 汇率精度
- 'rate_precision' => 4,
- ],
- // 限制配置
- 'limits' => [
- // 最小转出金额
- 'min_transfer_amount' => '0.0000000001',
-
- // 最大转出金额
- 'max_transfer_amount' => '999999999.9999999999',
-
- // 每日转出次数限制
- 'daily_transfer_count' => 10,
-
- // 每日转出金额限制
- 'daily_transfer_amount' => '50000.0000000000',
-
- // 业务ID最小长度
- 'business_id_min_length' => 3,
-
- // 业务ID最大长度
- 'business_id_max_length' => 100,
- ],
- // 外部API配置
- 'api' => [
- // 请求超时时间(秒)
- 'timeout' => 30,
-
- // 连接超时时间(秒)
- 'connect_timeout' => 10,
-
- // 重试次数
- 'retry_times' => 3,
-
- // 重试间隔(秒)
- 'retry_delay' => 2,
-
- // 签名算法
- 'signature_method' => 'md5',
-
- // User-Agent
- 'user_agent' => 'Transfer-Module/1.0',
- ],
- // 回调配置
- 'callback' => [
- // 最大重试次数
- 'max_retries' => 3,
-
- // 重试延迟(分钟)
- 'retry_delays' => [1, 2, 4], // 指数退避
-
- // 回调超时时间(秒)
- 'timeout' => 30,
-
- // 回调数据最大大小(字节)
- 'max_data_size' => 1024,
- ],
- // 队列配置
- 'queue' => [
- // 默认队列名称
- 'default' => 'transfer',
-
- // 回调队列名称
- 'callback' => 'transfer_callback',
-
- // 任务最大尝试次数
- 'max_tries' => 3,
-
- // 任务超时时间(秒)
- 'timeout' => 120,
-
- // 失败任务保留时间(秒)
- 'failed_job_retention' => 86400, // 24小时
- ],
- // 日志配置
- 'logging' => [
- // 是否启用详细日志
- 'detailed' => true,
-
- // 日志级别
- 'level' => 'info',
-
- // 是否记录API请求响应
- 'log_api_requests' => true,
-
- // 是否记录回调数据
- 'log_callback_data' => true,
-
- // 敏感字段(不记录到日志)
- 'sensitive_fields' => [
- 'password',
- 'token',
- 'secret',
- 'key',
- 'signature',
- ],
- ],
- // 缓存配置
- 'cache' => [
- // 缓存前缀
- 'prefix' => 'transfer:',
-
- // 应用配置缓存时间(秒)
- 'app_config_ttl' => 3600, // 1小时
-
- // 统计数据缓存时间(秒)
- 'stats_ttl' => 300, // 5分钟
-
- // 是否启用缓存
- 'enabled' => true,
- ],
- // 监控配置
- 'monitoring' => [
- // 是否启用性能监控
- 'performance' => true,
-
- // 是否启用错误监控
- 'error_tracking' => true,
-
- // 慢查询阈值(毫秒)
- 'slow_query_threshold' => 1000,
-
- // 慢API阈值(毫秒)
- 'slow_api_threshold' => 5000,
- ],
- // 安全配置
- 'security' => [
- // 是否启用签名验证
- 'signature_verification' => true,
-
- // 是否启用IP白名单
- 'ip_whitelist_enabled' => false,
-
- // IP白名单
- 'ip_whitelist' => [],
-
- // 是否启用频率限制
- 'rate_limiting' => true,
-
- // 频率限制配置
- 'rate_limit' => [
- 'max_attempts' => 60, // 每分钟最大请求次数
- 'decay_minutes' => 1, // 重置时间
- ],
- ],
- // 通知配置
- 'notifications' => [
- // 是否启用通知
- 'enabled' => true,
-
- // 通知渠道
- 'channels' => ['mail', 'database'],
-
- // 需要通知的事件
- 'events' => [
- 'order_failed' => true,
- 'api_error' => true,
- 'callback_failed' => true,
- 'daily_summary' => true,
- ],
-
- // 通知接收者
- 'recipients' => [
- 'admin@example.com',
- ],
- ],
- // 开发配置
- 'development' => [
- // 是否启用调试模式
- 'debug' => env('APP_DEBUG', false),
-
- // 是否启用SQL日志
- 'sql_logging' => false,
-
- // 是否启用API模拟
- 'api_mock' => false,
-
- // 模拟响应延迟(毫秒)
- 'mock_delay' => 1000,
- ],
- ];
|