first
This commit is contained in:
63
app/user/cmd/api/internal/handler/routes.go
Normal file
63
app/user/cmd/api/internal/handler/routes.go
Normal file
@@ -0,0 +1,63 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
auth "qnc-server/app/user/cmd/api/internal/handler/auth"
|
||||
user "qnc-server/app/user/cmd/api/internal/handler/user"
|
||||
"qnc-server/app/user/cmd/api/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// get mobile verify code
|
||||
Method: http.MethodPost,
|
||||
Path: "/auth/sendSms",
|
||||
Handler: auth.SendSmsHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/auth/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// login
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/login",
|
||||
Handler: user.LoginHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// register
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/register",
|
||||
Handler: user.RegisterHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/user/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// get user info
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/detail",
|
||||
Handler: user.DetailHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// wechat mini auth
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/wxMiniAuth",
|
||||
Handler: user.WxMiniAuthHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/user/v1"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user