46 lines
848 B
Go
46 lines
848 B
Go
// 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),
|
|
)
|
|
}
|