feat(grpc): add gRPC server infrastructure and schedule sync service

Add gRPC server support with configurable TLS, environment-based settings, and Wire injection. Implement schedule synchronization service with task runner integration for external course data fetching.

- Add gRPC configuration with env var overrides (APP_GRPC_ENABLED, APP_GRPC_PORT, etc.)
- Create gRPC server infrastructure with runner task management
- Implement ScheduleSyncService for course data synchronization
- Add sync endpoint to schedule handler for external system integration
- Update repository with context-aware batch delete operation
- Wire all dependencies including zap logger for structured logging
This commit is contained in:
2026-03-13 20:40:20 +08:00
parent cf36b1350d
commit c561a0bb0c
20 changed files with 3241 additions and 5 deletions

View File

@@ -190,3 +190,14 @@ conversation_cache:
batch_threshold: 100 # 条数阈值
batch_max_size: 500 # 单次最大批量
buffer_max_size: 10000 # 写缓冲最大条数
# gRPC 服务器配置
# 环境变量:
# APP_GRPC_ENABLED, APP_GRPC_PORT
# APP_GRPC_TLS_ENABLED, APP_GRPC_TLS_CERT_FILE, APP_GRPC_TLS_KEY_FILE
grpc:
enabled: true
port: 50051
tls_enabled: false
tls_cert_file: ""
tls_key_file: ""