Fixed health check; Fixed dex config; Add rank trader info view;

This commit is contained in:
icy
2025-11-01 18:58:32 +08:00
parent 29da893937
commit 8d93a8a095
17 changed files with 518 additions and 83 deletions

View File

@@ -65,12 +65,12 @@ func corsMiddleware() gin.HandlerFunc {
// setupRoutes 设置路由
func (s *Server) setupRoutes() {
// 健康检查
s.router.Any("/health", s.handleHealth)
// API路由组
api := s.router.Group("/api")
{
// 健康检查
api.Any("/health", s.handleHealth)
// 认证相关路由(无需认证)
api.POST("/register", s.handleRegister)
api.POST("/login", s.handleLogin)
@@ -1352,7 +1352,7 @@ func (s *Server) Start() error {
addr := fmt.Sprintf(":%d", s.port)
log.Printf("🌐 API服务器启动在 http://localhost%s", addr)
log.Printf("📊 API文档:")
log.Printf(" • GET /health - 健康检查")
log.Printf(" • GET /api/health - 健康检查")
log.Printf(" • GET /api/traders - AI交易员列表")
log.Printf(" • POST /api/traders - 创建新的AI交易员")
log.Printf(" • DELETE /api/traders/:id - 删除AI交易员")