Files
schisandra-album-cloud-micr…/app/auth/internal/handler/routes.go
landaiqing 97ca3fc7b0 🎉 init
2024-11-12 17:00:16 +08:00

44 lines
1.0 KiB
Go

// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.3
package handler
import (
"net/http"
"time"
user "schisandra-album-cloud-microservices/app/auth/internal/handler/user"
"schisandra-album-cloud-microservices/app/auth/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.I18nMiddleware, serverCtx.SecurityHeadersMiddleware},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/login",
Handler: user.AccountLoginHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/phone_login",
Handler: user.PhoneLoginHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/reset_password",
Handler: user.ResetPasswordHandler(serverCtx),
},
}...,
),
rest.WithSignature(serverCtx.Config.Signature),
rest.WithPrefix("/api/auth/user"),
rest.WithTimeout(10000*time.Millisecond),
rest.WithMaxBytes(1048576),
)
}