Version: 0.4.0.dev.260302

修改了gitignore文件,使得yaml不会被上传,保护隐私
接入eino,实现了agent的消息sse流式传输
This commit is contained in:
LoveLosita
2026-03-02 14:30:07 +08:00
parent fca4004024
commit 5f86dcda2b
18 changed files with 498 additions and 13 deletions

View File

@@ -44,10 +44,14 @@ func Start() {
rdb := inits.InitRedis()
//工具包
limiter := pkg.NewRateLimiter(rdb)
//初始化agent
aiHub, err := inits.InitEino()
if err != nil {
log.Fatalf("Failed to initialize Eino: %v", err)
}
//中间件
//dao 层
cacheRepo := dao.NewCacheDAO(rdb)
_ = db.Use(middleware.NewGormCachePlugin(cacheRepo)) // 注册 GORM 插件
userRepo := dao.NewUserDAO(db)
@@ -62,18 +66,21 @@ func Start() {
courseService := service.NewCourseService(courseRepo, scheduleRepo)
taskClassService := service.NewTaskClassService(taskClassRepo, cacheRepo, scheduleRepo, manager)
scheduleService := service.NewScheduleService(scheduleRepo, userRepo, taskClassRepo, manager, cacheRepo)
agentService := service.NewAgentService(aiHub)
//api 层
userApi := api.NewUserHandler(userService)
taskApi := api.NewTaskHandler(taskSv)
courseApi := api.NewCourseHandler(courseService)
taskClassApi := api.NewTaskClassHandler(taskClassService)
scheduleApi := api.NewScheduleAPI(scheduleService)
agentApi := api.NewAgentHandler(agentService)
handlers := &api.ApiHandlers{
UserHandler: userApi,
TaskHandler: taskApi,
TaskClassHandler: taskClassApi,
CourseHandler: courseApi,
ScheduleHandler: scheduleApi,
AgentHandler: agentApi,
}
r := routers.RegisterRouters(handlers, cacheRepo, limiter)
routers.StartEngine(r)