49 lines
970 B
Go
49 lines
970 B
Go
// Code generated by the atomctl ; DO NOT EDIT.
|
|
|
|
package auth
|
|
|
|
import (
|
|
. "backend/pkg/f"
|
|
|
|
_ "git.ipao.vip/rogeecn/atom"
|
|
_ "git.ipao.vip/rogeecn/atom/contracts"
|
|
"github.com/gofiber/fiber/v3"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// @provider contracts.HttpRoute atom.GroupRoutes
|
|
type Routes struct {
|
|
log *log.Entry `inject:"false"`
|
|
controller *Controller
|
|
}
|
|
|
|
func (r *Routes) Prepare() error {
|
|
r.log = log.WithField("module", "routes.auth")
|
|
return nil
|
|
}
|
|
|
|
func (r *Routes) Name() string {
|
|
return "auth"
|
|
}
|
|
|
|
func (r *Routes) Register(router fiber.Router) {
|
|
// 注册路由组: Controller
|
|
router.Get("/auth/wechat/jump", Func1(
|
|
r.controller.JumpToAuth,
|
|
QueryParam[string]("redirectUri"),
|
|
))
|
|
|
|
router.Get("/auth/login", Func3(
|
|
r.controller.Login,
|
|
QueryParam[string]("code"),
|
|
QueryParam[string]("state"),
|
|
QueryParam[string]("redirectUri"),
|
|
))
|
|
|
|
router.Get("/MP_verify_:uuid.txt", Func1(
|
|
r.controller.Verify,
|
|
PathParam[string]("uuid"),
|
|
))
|
|
|
|
}
|