refactor(service): 重构服务代码结构并更新配置

This commit is contained in:
2026-05-18 19:19:17 +08:00
parent 5f98e52b34
commit c49144794d
35 changed files with 1281 additions and 1162 deletions

10
main.go
View File

@@ -4,10 +4,9 @@ import (
"context"
"os"
"os/signal"
"prompts-core/controller/prompt"
"syscall"
"prompts-core/controller"
"gitea.com/red-future/common/http"
"gitea.com/red-future/common/jaeger"
_ "gitea.com/red-future/common/swagger"
@@ -20,14 +19,13 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
defer jaeger.ShutDown(ctx)
// 注册路由
http.RouteRegister([]interface{}{
controller.Prompt,
controller.Session,
prompt.Prompt,
prompt.Session,
})
// 监听退出信号,确保 Ctrl+C 能完整退出并关闭 http server
// 监听退出信号,确保 Ctrl+C 能完整退出并关闭 gateway server
quit := make(chan os.Signal, 1)
signal.Notify(quit, os.Interrupt, syscall.SIGTERM)
<-quit