70 lines
1.5 KiB
Go
70 lines
1.5 KiB
Go
// 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{
|
|
{
|
|
// mobile code login
|
|
Method: http.MethodPost,
|
|
Path: "/user/mobileCodeLogin",
|
|
Handler: user.MobileCodeLoginHandler(serverCtx),
|
|
},
|
|
{
|
|
// mobile login
|
|
Method: http.MethodPost,
|
|
Path: "/user/mobileLogin",
|
|
Handler: user.MobileLoginHandler(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"),
|
|
)
|
|
}
|