| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- // Code generated by goctl. DO NOT EDIT.
- // goctl 1.10.2
- package handler
- import (
- "net/http"
- application "udeServer/internal/handler/application"
- applicationconfig "udeServer/internal/handler/applicationconfig"
- custompage "udeServer/internal/handler/custompage"
- ops "udeServer/internal/handler/ops"
- systemlog "udeServer/internal/handler/systemlog"
- "udeServer/internal/svc"
- "github.com/zeromicro/go-zero/rest"
- )
- func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
- server.AddRoutes(
- []rest.Route{
- {
- Method: http.MethodGet,
- Path: "/db/ping",
- Handler: DbPingHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/directories",
- Handler: CreateDirectoryHandler(serverCtx),
- },
- {
- Method: http.MethodGet,
- Path: "/directories",
- Handler: ListDirectoriesHandler(serverCtx),
- },
- {
- Method: http.MethodGet,
- Path: "/directories/:id",
- Handler: GetDirectoryHandler(serverCtx),
- },
- {
- Method: http.MethodPut,
- Path: "/directories/:id",
- Handler: UpdateDirectoryHandler(serverCtx),
- },
- {
- Method: http.MethodDelete,
- Path: "/directories/:id",
- Handler: DeleteDirectoryHandler(serverCtx),
- },
- {
- Method: http.MethodGet,
- Path: "/dirs/children",
- Handler: ListDirChildrenHandler(serverCtx),
- },
- {
- Method: http.MethodGet,
- Path: "/from/:name",
- Handler: UdeServerHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/keys/create",
- Handler: CreateKeyHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/keys/delete",
- Handler: DeleteKeyHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/keys/detail",
- Handler: GetKeyHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/keys/list",
- Handler: ListKeysHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/keys/update",
- Handler: UpdateKeyHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/services",
- Handler: CreateServiceHandler(serverCtx),
- },
- {
- Method: http.MethodGet,
- Path: "/services",
- Handler: ListServicesHandler(serverCtx),
- },
- {
- Method: http.MethodGet,
- Path: "/services/:id",
- Handler: GetServiceHandler(serverCtx),
- },
- {
- Method: http.MethodPut,
- Path: "/services/:id",
- Handler: UpdateServiceHandler(serverCtx),
- },
- {
- Method: http.MethodDelete,
- Path: "/services/:id",
- Handler: DeleteServiceHandler(serverCtx),
- },
- {
- Method: http.MethodPost,
- Path: "/services/:id/brush",
- Handler: BrushServiceHandler(serverCtx),
- },
- {
- // 启用服务联动挂载(状态开关拨向"启用")
- Method: http.MethodPost,
- Path: "/services/:id/mount",
- Handler: MountServiceHandler(serverCtx),
- },
- {
- // 停用服务联动卸载(状态开关拨向"停用")
- Method: http.MethodPost,
- Path: "/services/:id/unmount",
- Handler: UnmountServiceHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1"),
- )
- server.AddRoutes(
- []rest.Route{
- {
- // 添加应用凭证
- Method: http.MethodPost,
- Path: "/addApplication",
- Handler: application.AddApplicationHandler(serverCtx),
- },
- {
- // 应用凭证列表
- Method: http.MethodPost,
- Path: "/applicationList",
- Handler: application.ApplicationListHandler(serverCtx),
- },
- {
- // 删除应用凭证
- Method: http.MethodPost,
- Path: "/deleteApplication",
- Handler: application.DeleteApplicationHandler(serverCtx),
- },
- {
- // 下发应用凭证密钥
- Method: http.MethodPost,
- Path: "/distributeApiSecret",
- Handler: application.DistributeApiSecretHandler(serverCtx),
- },
- {
- // 重置应用凭证密钥
- Method: http.MethodPost,
- Path: "/resetApplication",
- Handler: application.ResetApplicationHandler(serverCtx),
- },
- {
- // 切换应用凭证状态(启用/禁用互换)
- Method: http.MethodPost,
- Path: "/updateApplicationStatus",
- Handler: application.UpdateApplicationStatusHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1/applicationCredentials"),
- )
- server.AddRoutes(
- []rest.Route{
- {
- // 添加配置
- Method: http.MethodPost,
- Path: "/addConfig",
- Handler: applicationconfig.AddConfigHandler(serverCtx),
- },
- {
- // 配置分页列表
- Method: http.MethodPost,
- Path: "/configList",
- Handler: applicationconfig.ConfigListHandler(serverCtx),
- },
- {
- // 删除配置
- Method: http.MethodPost,
- Path: "/deleteConfig",
- Handler: applicationconfig.DeleteConfigHandler(serverCtx),
- },
- {
- // 更新配置(默认配置 edit_flag=1 不允许改配置项名)
- Method: http.MethodPost,
- Path: "/updateConfig",
- Handler: applicationconfig.UpdateConfigHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1/applicationConfig"),
- )
- server.AddRoutes(
- []rest.Route{
- {
- // 复位自定义页面信息
- Method: http.MethodPost,
- Path: "/clear",
- Handler: custompage.ClearCacheHandler(serverCtx),
- },
- {
- // 获取自定义页面信息
- Method: http.MethodGet,
- Path: "/get",
- Handler: custompage.GetCacheHandler(serverCtx),
- },
- {
- // 设置自定义页面信息(标题/logo)
- Method: http.MethodPost,
- Path: "/set",
- Handler: custompage.SetCacheHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1/customPage"),
- )
- server.AddRoutes(
- []rest.Route{
- {
- // WebSocket 运维诊断(ping/traceroute/telnet)
- Method: http.MethodGet,
- Path: "/ws/ops",
- Handler: ops.OpsHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1"),
- )
- server.AddRoutes(
- []rest.Route{
- {
- // 日志归档
- Method: http.MethodPost,
- Path: "/archive",
- Handler: systemlog.LogArchiveHandler(serverCtx),
- },
- {
- // 日志审计(校验Hmac防篡改)
- Method: http.MethodPost,
- Path: "/audit",
- Handler: systemlog.LogAuditHandler(serverCtx),
- },
- {
- // 日志详情
- Method: http.MethodPost,
- Path: "/detail",
- Handler: systemlog.LogDetailHandler(serverCtx),
- },
- {
- // 查看完整链路
- Method: http.MethodPost,
- Path: "/link",
- Handler: systemlog.LogLinkHandler(serverCtx),
- },
- {
- // 日志分页列表
- Method: http.MethodPost,
- Path: "/list",
- Handler: systemlog.LogListHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1/systemLog"),
- )
- server.AddRoutes(
- []rest.Route{
- {
- // 归档打包下载(zip)
- Method: http.MethodPost,
- Path: "/download",
- Handler: systemlog.LogArchiveDownloadHandler(serverCtx),
- },
- {
- // 归档列表
- Method: http.MethodPost,
- Path: "/list",
- Handler: systemlog.LogArchiveListHandler(serverCtx),
- },
- {
- // 归档恢复
- Method: http.MethodPost,
- Path: "/restore",
- Handler: systemlog.LogArchiveRestoreHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1/logArchive"),
- )
- server.AddRoutes(
- []rest.Route{
- {
- // 恢复记录列表
- Method: http.MethodPost,
- Path: "/list",
- Handler: systemlog.LogRestoreListHandler(serverCtx),
- },
- },
- rest.WithPrefix("/api/v1/logRestore"),
- )
- }
|