chore: initial import
This commit is contained in:
29
internal/handler/healing_handler.go
Normal file
29
internal/handler/healing_handler.go
Normal file
@@ -0,0 +1,29 @@
|
||||
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"})
|
||||
}
|
||||
Reference in New Issue
Block a user