mingyang-admin-iot-app/api/internal/handler/routes.go

66 lines
1.3 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/list",
Handler: user.ListUserInfoHandler(serverCtx),
},
}...,
),
)
}