initial commit

This commit is contained in:
2025-05-22 19:39:08 +08:00
commit 531bb42d01
103 changed files with 10291 additions and 0 deletions

View File

@ -0,0 +1,45 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.8.3
package handler
import (
"net/http"
"godemo/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: "/api/user/login",
Handler: loginHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/user/register",
Handler: registerHandler(serverCtx),
},
},
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/api/user/:user_id",
Handler: getUserInfoHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/user/logout",
Handler: logoutHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
)
}