96 lines
2.1 KiB
Go
96 lines
2.1 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctls v1.12.7
|
|
|
|
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
base "mingyang-admin-app-api/internal/handler/base"
|
|
user "mingyang-admin-app-api/internal/handler/user"
|
|
user_public "mingyang-admin-app-api/internal/handler/user_public"
|
|
"mingyang-admin-app-api/internal/svc"
|
|
|
|
"github.com/zeromicro/go-zero/rest"
|
|
)
|
|
|
|
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/init/database",
|
|
Handler: base.InitDatabaseHandler(serverCtx),
|
|
},
|
|
},
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/get/verifyCode",
|
|
Handler: user_public.GetVerifyCodeHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/register",
|
|
Handler: user_public.RegisterHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/login",
|
|
Handler: user_public.LoginHandler(serverCtx),
|
|
},
|
|
},
|
|
)
|
|
|
|
server.AddRoutes(
|
|
rest.WithMiddlewares(
|
|
[]rest.Middleware{serverCtx.Authority},
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user",
|
|
Handler: user.GetUserInfoByIdHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user/info",
|
|
Handler: user.GetUserInfoByTokenHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user/list",
|
|
Handler: user.ListUserInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user/update",
|
|
Handler: user.UpdateUserInfoHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user/logout",
|
|
Handler: user.LogoutHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user/passWordReset",
|
|
Handler: user.PassWordResetHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user/checkLogin",
|
|
Handler: user.CheckLoginHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/user/oauthAuthorize",
|
|
Handler: user.OauthAuthorizeHandler(serverCtx),
|
|
},
|
|
}...,
|
|
),
|
|
)
|
|
}
|