This commit is contained in:
2026-04-20 22:51:41 +02:00
parent 89fc0119f3
commit 81eec53978
27 changed files with 1067 additions and 399 deletions
+25
View File
@@ -118,6 +118,31 @@ func (s *Server) handleEtoroStats(w http.ResponseWriter, r *http.Request) {
s.handleEtoroStatus(w, r)
}
func (s *Server) handleAnalyzeDeep(w http.ResponseWriter, r *http.Request) {
var body struct {
Tickers []string `json:"tickers"`
}
if err := json.NewDecoder(r.Body).Decode(&body); err != nil || len(body.Tickers) == 0 {
http.Error(w, "tickers required", http.StatusBadRequest)
return
}
if len(body.Tickers) > 50 {
body.Tickers = body.Tickers[:50] // limite de sécurité
}
w.Header().Set("Content-Type", "application/json")
if s.scanner.Analyze(body.Tickers) {
w.Write([]byte(`{"status":"started"}`))
} else {
w.Write([]byte(`{"status":"already_running"}`))
}
}
func (s *Server) handleAnalyzeStatus(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(s.scanner.AnalyzeStatus())
}
// Scan watchlist signal - déjà dans handlers_scanner.go, on ajoute juste
// un champ source à la query existante