42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
// ==========================================================================
|
||
// GFast自动生成router操作代码。
|
||
// 生成日期:2023-09-01 17:51:42
|
||
// 生成路径: internal/app/test/router/test_owner_info.go
|
||
// 生成人:yqq
|
||
// desc:业主方基本情况
|
||
// company:云南奇讯科技有限公司
|
||
// ==========================================================================
|
||
|
||
package router
|
||
|
||
import (
|
||
"context"
|
||
"github.com/gogf/gf/v2/net/ghttp"
|
||
"github.com/tiger1103/gfast/v3/internal/app/system/service"
|
||
"github.com/tiger1103/gfast/v3/internal/app/test/controller"
|
||
"github.com/tiger1103/gfast/v3/library/libRouter"
|
||
)
|
||
|
||
var R = new(Router)
|
||
|
||
type Router struct{}
|
||
|
||
func (router *Router) BindController(ctx context.Context, group *ghttp.RouterGroup) {
|
||
group.Group("/", func(group *ghttp.RouterGroup) {
|
||
//登录验证拦截
|
||
service.GfToken().Middleware(group)
|
||
////context拦截器
|
||
group.Middleware(service.Middleware().Ctx, service.Middleware().Auth)
|
||
//后台操作日志记录
|
||
group.Hook("/*", ghttp.HookAfterOutput, service.OperateLog().OperationLog)
|
||
group.Bind(
|
||
controller.TestContactInfo,
|
||
controller.TestFollowInfo,
|
||
)
|
||
//自动绑定定义的控制器
|
||
if err := libRouter.RouterAutoBind(ctx, router, group); err != nil {
|
||
panic(err)
|
||
}
|
||
})
|
||
}
|