|
- package monitoring
-
- import (
- "net/http"
-
- "github.com/zeromicro/go-zero/rest/httpx"
- "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/monitoring"
- "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc"
- )
-
- func AlertRulesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- l := monitoring.NewAlertRulesLogic(r.Context(), svcCtx)
- err := l.AlertRules()
- if err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- } else {
- httpx.Ok(w)
- }
- }
- }
|