| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- // Code generated by goctl. DO NOT EDIT.
- // goctl 1.10.2
- package handler
- import (
- "net/http"
- application "udeServer/internal/handler/application"
- 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),
- },
- },
- 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: "/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"),
- )
- }
|