// Code generated by goctl. DO NOT EDIT. // goctl 1.9.2 package handler import ( "net/http" user "juwan-backend/app/users/api/internal/handler/user" "juwan-backend/app/users/api/internal/svc" "github.com/zeromicro/go-zero/rest" ) func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( rest.WithMiddlewares( []rest.Middleware{serverCtx.Logger}, []rest.Route{ { // 用户登出 Method: http.MethodPost, Path: "/:userId/logout", Handler: user.LogoutHandler(serverCtx), }, { // 修改用户密码 Method: http.MethodPut, Path: "/:userId/password", Handler: user.UpdatePasswordHandler(serverCtx), }, { // 修改密码-使用验证码 Method: http.MethodPut, Path: "/forgot-password/reset", Handler: user.UpdatePasswordByVcodeHandler(serverCtx), }, { // 用户登录接口 Method: http.MethodPost, Path: "/login", Handler: user.LoginHandler(serverCtx), }, { // 用户注册接口 Method: http.MethodPost, Path: "/register", Handler: user.RegisterHandler(serverCtx), }, }..., ), rest.WithPrefix("/api/v1/auth"), ) server.AddRoutes( rest.WithMiddlewares( []rest.Middleware{serverCtx.Logger}, []rest.Route{ { // 获取用户信息 Method: http.MethodGet, Path: "/:userId", Handler: user.GetUserInfoHandler(serverCtx), }, { // 修改用户信息 Method: http.MethodPut, Path: "/:userId", Handler: user.UpdateUserInfoHandler(serverCtx), }, { // 获取当前登录用户信息 Method: http.MethodGet, Path: "/me", Handler: user.GetMeHandler(serverCtx), }, { // 更改当前登录用户信息 Method: http.MethodPut, Path: "/me", Handler: user.UpdateMeHandler(serverCtx), }, }..., ), rest.WithPrefix("/api/v1/user"), ) }