Files
panel/internal/route/process.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

29 lines
1013 B
Go

package route
import (
"net/http"
"github.com/acepanel/panel/v3/internal/request"
"github.com/acepanel/panel/v3/internal/service"
)
// ProcessRoutes 进程路由
func ProcessRoutes(processService *service.ProcessService) Endpoints {
svc := processService
return Endpoints{
{Method: http.MethodGet, Path: "/api/process", Handler: svc.List,
Summary: "进程列表", Tags: []string{"进程"},
Document: DescribeReq[request.ProcessList]()},
{Method: http.MethodGet, Path: "/api/process/detail", Handler: svc.Detail,
Summary: "进程详情", Tags: []string{"进程"},
Document: DescribeReq[request.ProcessDetail]()},
{Method: http.MethodPost, Path: "/api/process/kill", Handler: svc.Kill,
Summary: "结束进程", Tags: []string{"进程"},
Document: DescribeReq[request.ProcessKill]()},
{Method: http.MethodPost, Path: "/api/process/signal", Handler: svc.Signal,
Summary: "向进程发送信号", Tags: []string{"进程"},
Document: DescribeReq[request.ProcessSignal]()},
}
}