Files
panel/internal/route/monitor.go
T
renovate[bot] 1df45f438b chore(deps): Update non-major dependencies (#1750)
* chore(deps): Update non-major dependencies

* fix: 适配 libtnb validator v0.4.3 与 cron v0.5.4 新 API

- 自定义规则改经 WithRules/WithFallibleRules 注入,exists/not_exists 转为
  FallibleRule 让数据库错误上抛而非静默失败
- openapi contrib 移除运行时 Op,端点文档改为 Document 闭包在定义处捕获类型
- SetDefault 已移除,Bind 校验器改由 service.SetValidator 注入
- cron.New 现在返回 error

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 耗子 <haozi@loli.email>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 23:11:15 +08:00

21 lines
931 B
Go

package route
import (
"net/http"
"github.com/acepanel/panel/v3/internal/request"
"github.com/acepanel/panel/v3/internal/service"
)
// MonitorRoutes 监控路由
func MonitorRoutes(monitorService *service.MonitorService) Endpoints {
svc := monitorService
return Endpoints{
{Method: http.MethodGet, Path: "/api/monitor/setting", Handler: svc.GetSetting, Summary: "获取监控设置", Tags: []string{"监控"}},
{Method: http.MethodPost, Path: "/api/monitor/setting", Handler: svc.UpdateSetting, Summary: "更新监控设置", Tags: []string{"监控"}, Document: DescribeReq[request.MonitorSetting]()},
{Method: http.MethodPost, Path: "/api/monitor/clear", Handler: svc.Clear, Summary: "清空监控数据", Tags: []string{"监控"}},
{Method: http.MethodGet, Path: "/api/monitor/list", Handler: svc.List, Summary: "监控数据列表", Tags: []string{"监控"}, Document: DescribeReq[request.MonitorList]()},
}
}