shanshanzhong 9dacd85a89
Some checks failed
Build docker and publish / prepare (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.admin image_name:ppanel-admin name:admin]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.api image_name:ppanel-api name:api]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.node image_name:ppanel-node name:node]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.queue image_name:ppanel-queue name:queue]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.scheduler image_name:ppanel-scheduler name:scheduler]) (push) Has been cancelled
Build docker and publish / deploy (push) Has been cancelled
Build docker and publish / notify (push) Has been cancelled
初始化
2026-02-26 04:12:43 -08:00

158 lines
3.7 KiB
Go

// Code generated by goctl. DO NOT EDIT.
// goctl 1.9.2
package handler
import (
"net/http"
auth "github.com/zero-ppanel/zero-ppanel/apps/api/internal/handler/auth"
common "github.com/zero-ppanel/zero-ppanel/apps/api/internal/handler/common"
order "github.com/zero-ppanel/zero-ppanel/apps/api/internal/handler/order"
ticket "github.com/zero-ppanel/zero-ppanel/apps/api/internal/handler/ticket"
user "github.com/zero-ppanel/zero-ppanel/apps/api/internal/handler/user"
"github.com/zero-ppanel/zero-ppanel/apps/api/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodPost,
Path: "/login",
Handler: auth.UserLoginHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/register",
Handler: auth.UserRegisterHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/reset_password",
Handler: auth.ResetPasswordHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1/auth"),
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/announcement",
Handler: common.GetAnnouncementListHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/config",
Handler: common.GetGlobalConfigHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/document",
Handler: common.GetDocumentListHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/document/:id",
Handler: common.GetDocumentDetailHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/health",
Handler: common.HealthHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/payment/methods",
Handler: common.GetAvailablePaymentMethodsHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/send_email_code",
Handler: common.SendEmailCodeHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/subscribe",
Handler: common.GetSubscribeListHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/subscribe/group",
Handler: common.GetSubscribeGroupListHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/:order_no",
Handler: order.GetOrderDetailHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/:order_no/close",
Handler: order.CloseOrderHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/create",
Handler: order.CreateOrderHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
rest.WithPrefix("/api/v1/order"),
)
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.MethodPost,
Path: "/create",
Handler: ticket.CreateTicketHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
rest.WithPrefix("/api/v1/ticket"),
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/info",
Handler: user.GetUserInfoHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/password",
Handler: user.UpdateUserPasswordHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/subscribe",
Handler: user.GetUserSubscribeHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
rest.WithPrefix("/api/v1/user"),
)
}