up
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user