Files
36Wisdom/biz/controller/router.go
T
adminandClaude Opus 4.7 414c7de007 feat: 分支闯关判分与终局结算(含单测)
choose 校验节点/选项归属与解锁链,终局在 common.WithLock 内按
技术设计 4.3/4.4 结算:首次到达才结算、连续失败限扣、余额不为负、
完美集齐全终局 +20 并解锁计策卡与下一计;路径流水尽力而为。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-08-13 12:47:01 +08:00

31 lines
750 B
Go

package controller
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gctx"
"36wisdom/common/auth"
)
// Register 注册全部路由分组;各业务控制器在对应任务中挂载。
func Register(s *ghttp.Server) {
s.Use(ghttp.MiddlewareHandlerResponse)
s.BindHandler("GET:/ping", func(r *ghttp.Request) {
r.Response.Write("pong")
})
secret := g.Cfg().MustGet(gctx.New(), "auth.secret").String()
// 前台:公开接口(注册/登录),鉴权接口按模块挂载
s.Group("/api", func(g *ghttp.RouterGroup) {
g.Bind(Parent)
g.Group("/", func(g *ghttp.RouterGroup) {
g.Middleware(auth.Middleware(secret, ""))
g.Bind(Child, Strategy, Level, LevelPlay)
})
})
}