2024-08-25 07:08:49 +00:00
|
|
|
// Code generated by goctl. DO NOT EDIT.
|
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
member "app-cloudep-portal-api-gateway/internal/handler/member"
|
|
|
|
"app-cloudep-portal-api-gateway/internal/svc"
|
|
|
|
|
|
|
|
"github.com/zeromicro/go-zero/rest"
|
|
|
|
)
|
|
|
|
|
|
|
|
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
|
server.AddRoutes(
|
|
|
|
[]rest.Route{
|
|
|
|
{
|
|
|
|
Method: http.MethodPost,
|
|
|
|
Path: "/member",
|
|
|
|
Handler: member.CreateAccountHandler(serverCtx),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Method: http.MethodPost,
|
|
|
|
Path: "/member/login",
|
|
|
|
Handler: member.LoginHandler(serverCtx),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Method: http.MethodPost,
|
|
|
|
Path: "/member/forget-password-code",
|
2024-08-26 06:36:58 +00:00
|
|
|
Handler: member.ForgetPasswordCodeHandler(serverCtx),
|
2024-08-25 07:08:49 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
Method: http.MethodGet,
|
|
|
|
Path: "/member/check-verify-code",
|
|
|
|
Handler: member.CheckVerifyCodeHandler(serverCtx),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Method: http.MethodPut,
|
|
|
|
Path: "/member/update-password",
|
|
|
|
Handler: member.UpadtePasswordHandler(serverCtx),
|
|
|
|
},
|
2024-08-26 06:36:58 +00:00
|
|
|
{
|
|
|
|
Method: http.MethodPut,
|
|
|
|
Path: "/member/refresh_access_token",
|
|
|
|
Handler: member.RefreshAccessTokenHandler(serverCtx),
|
|
|
|
},
|
2024-08-25 07:08:49 +00:00
|
|
|
},
|
|
|
|
rest.WithPrefix("/api/v1"),
|
|
|
|
rest.WithTimeout(3000*time.Millisecond),
|
|
|
|
)
|
|
|
|
|
|
|
|
server.AddRoutes(
|
|
|
|
rest.WithMiddlewares(
|
2024-08-26 06:36:58 +00:00
|
|
|
[]rest.Middleware{serverCtx.AuthMiddleware.Handle},
|
2024-08-25 07:08:49 +00:00
|
|
|
[]rest.Route{
|
|
|
|
{
|
|
|
|
Method: http.MethodGet,
|
|
|
|
Path: "/member/logout",
|
|
|
|
Handler: member.LogoutHandler(serverCtx),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Method: http.MethodGet,
|
|
|
|
Path: "/member/info",
|
|
|
|
Handler: member.InfoHandler(serverCtx),
|
|
|
|
},
|
|
|
|
}...,
|
|
|
|
),
|
|
|
|
rest.WithPrefix("/api/v1"),
|
|
|
|
rest.WithTimeout(3000*time.Millisecond),
|
|
|
|
)
|
|
|
|
}
|