feat(auth): 重构认证模块,添加OTP发送和登录功能
This commit is contained in:
@@ -24,7 +24,6 @@ type Routes struct {
|
||||
log *log.Entry `inject:"false"`
|
||||
middlewares *middlewares.Middlewares
|
||||
// Controller instances
|
||||
auth *Auth
|
||||
common *Common
|
||||
content *Content
|
||||
creator *Creator
|
||||
@@ -49,17 +48,6 @@ func (r *Routes) Name() string {
|
||||
// Register registers all HTTP routes with the provided fiber router.
|
||||
// Each route is registered with its corresponding controller action and parameter bindings.
|
||||
func (r *Routes) Register(router fiber.Router) {
|
||||
// Register routes for controller: Auth
|
||||
r.log.Debugf("Registering route: Post /v1/auth/login -> auth.Login")
|
||||
router.Post("/v1/auth/login"[len(r.Path()):], DataFunc1(
|
||||
r.auth.Login,
|
||||
Body[dto.LoginForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/auth/otp -> auth.SendOTP")
|
||||
router.Post("/v1/auth/otp"[len(r.Path()):], Func1(
|
||||
r.auth.SendOTP,
|
||||
Body[dto.SendOTPForm]("form"),
|
||||
))
|
||||
// Register routes for controller: Common
|
||||
r.log.Debugf("Registering route: Post /v1/upload -> common.Upload")
|
||||
router.Post("/v1/upload"[len(r.Path()):], DataFunc2(
|
||||
|
||||
Reference in New Issue
Block a user