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:
@@ -3,6 +3,7 @@ package wire
|
||||
import (
|
||||
"carrot_bbs/internal/cache"
|
||||
"carrot_bbs/internal/config"
|
||||
"carrot_bbs/internal/grpc/runner"
|
||||
"carrot_bbs/internal/pkg/email"
|
||||
"carrot_bbs/internal/pkg/gorse"
|
||||
"carrot_bbs/internal/pkg/openai"
|
||||
@@ -12,6 +13,7 @@ import (
|
||||
"carrot_bbs/internal/service"
|
||||
|
||||
"github.com/google/wire"
|
||||
"go.uber.org/zap"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -36,6 +38,7 @@ var ServiceSet = wire.NewSet(
|
||||
ProvideVoteService,
|
||||
ProvideChatService,
|
||||
ProvideScheduleService,
|
||||
ProvideScheduleSyncService,
|
||||
ProvideGroupService,
|
||||
ProvideUploadService,
|
||||
)
|
||||
@@ -168,6 +171,15 @@ func ProvideScheduleService(
|
||||
return service.NewScheduleService(scheduleRepo)
|
||||
}
|
||||
|
||||
// ProvideScheduleSyncService 提供课表同步服务
|
||||
func ProvideScheduleSyncService(
|
||||
taskManager *runner.TaskManager,
|
||||
scheduleRepo repository.ScheduleRepository,
|
||||
logger *zap.Logger,
|
||||
) service.ScheduleSyncService {
|
||||
return service.NewScheduleSyncService(taskManager, scheduleRepo, logger)
|
||||
}
|
||||
|
||||
// ProvideGroupService 提供群组服务
|
||||
func ProvideGroupService(
|
||||
db *gorm.DB,
|
||||
|
||||
Reference in New Issue
Block a user