Files
ai-ops/internal/handler/healing_handler.go

30 lines
781 B
Go
Raw Permalink Normal View History

2026-05-12 17:47:32 +08:00
package handler
import (
"net/http"
"github.com/company/ai-ops/pkg/response"
)
// HealingHandler 是自愈管理 HTTP 处理器
type HealingHandler struct{}
func NewHealingHandler() *HealingHandler {
return &HealingHandler{}
}
func (h *HealingHandler) RegisterRoutes(mux *http.ServeMux) {
mux.HandleFunc("GET /api/v1/ai-ops/healings", h.ListHealings)
mux.HandleFunc("GET /api/v1/ai-ops/healings/{id}", h.GetHealing)
}
func (h *HealingHandler) ListHealings(w http.ResponseWriter, r *http.Request) {
// TODO: 实现列表查询
response.Success(w, map[string]any{"items": []any{}, "total": 0})
}
func (h *HealingHandler) GetHealing(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
response.Success(w, map[string]any{"id": id, "status": "pending"})
}