// 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"), ) }