// Code generated by goctl. DO NOT EDIT. // goctl 1.9.2 package handler import ( "net/http" announcement "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/announcement" common "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/common" console "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/console" order "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/order" serverhandler "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/server" subscribe "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/subscribe" system "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/system" ticket "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/ticket" user "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/user" "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc" "github.com/zeromicro/go-zero/rest" ) func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( []rest.Route{ { Method: http.MethodPut, Path: "/:id", Handler: announcement.UpdateAnnouncementHandler(serverCtx), }, { Method: http.MethodDelete, Path: "/:id", Handler: announcement.DeleteAnnouncementHandler(serverCtx), }, { Method: http.MethodPost, Path: "/create", Handler: announcement.CreateAnnouncementHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/announcement"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodGet, Path: "/health", Handler: common.HealthHandler(serverCtx), }, }, rest.WithPrefix("/api/v1/admin"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodGet, Path: "/stats", Handler: console.GetConsoleStatsHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/console"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodPut, Path: "/:order_no/status", Handler: order.UpdateOrderStatusHandler(serverCtx), }, { Method: http.MethodGet, Path: "/list", Handler: order.GetOrderListHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/order"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodPut, Path: "/:id", Handler: serverhandler.UpdateServerHandler(serverCtx), }, { Method: http.MethodDelete, Path: "/:id", Handler: serverhandler.DeleteServerHandler(serverCtx), }, { Method: http.MethodPost, Path: "/create", Handler: serverhandler.CreateServerHandler(serverCtx), }, { Method: http.MethodGet, Path: "/list", Handler: serverhandler.GetServerListHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/server"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodPut, Path: "/:id", Handler: subscribe.UpdateSubscribeHandler(serverCtx), }, { Method: http.MethodDelete, Path: "/:id", Handler: subscribe.DeleteSubscribeHandler(serverCtx), }, { Method: http.MethodPost, Path: "/create", Handler: subscribe.CreateSubscribeHandler(serverCtx), }, { Method: http.MethodGet, Path: "/list", Handler: subscribe.GetSubscribeListHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/subscribe"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodGet, Path: "/register", Handler: system.GetRegisterConfigHandler(serverCtx), }, { Method: http.MethodPut, Path: "/register", Handler: system.UpdateRegisterConfigHandler(serverCtx), }, { Method: http.MethodGet, Path: "/site", Handler: system.GetSiteConfigHandler(serverCtx), }, { Method: http.MethodPut, Path: "/site", Handler: system.UpdateSiteConfigHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/system"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodGet, Path: "/:id", Handler: ticket.GetTicketDetailHandler(serverCtx), }, { Method: http.MethodPost, Path: "/:id/follow", Handler: ticket.CreateTicketFollowHandler(serverCtx), }, { Method: http.MethodPut, Path: "/:id/status", Handler: ticket.UpdateTicketStatusHandler(serverCtx), }, { Method: http.MethodGet, Path: "/list", Handler: ticket.GetTicketListHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/ticket"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodGet, Path: "/:id", Handler: user.GetUserDetailHandler(serverCtx), }, { Method: http.MethodDelete, Path: "/:id", Handler: user.DeleteUserHandler(serverCtx), }, { Method: http.MethodGet, Path: "/list", Handler: user.GetUserListHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), rest.WithPrefix("/api/v1/admin/user"), ) }