72 lines
1.6 KiB
Go
72 lines
1.6 KiB
Go
// 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",
|
|
Handler: member.ForgetPasswordCodeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/member/check-verify-code",
|
|
Handler: member.CheckVerifyCodeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/member/update-password",
|
|
Handler: member.UpadtePasswordHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPut,
|
|
Path: "/member/refresh_access_token",
|
|
Handler: member.RefreshAccessTokenHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/api/v1"),
|
|
rest.WithTimeout(3000*time.Millisecond),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
rest.WithMiddlewares(
|
|
[]rest.Middleware{serverCtx.AuthMiddleware.Handle},
|
|
[]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),
|
|
)
|
|
}
|