Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Main = gcmd.Command{ Name: "main", Usage: "main", Brief: "start http server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { s := g.Server() apiBasePath := g.Cfg().MustGet(ctx, "server.api_base_path").String() if apiBasePath == "" { g.Log().Fatal(ctx, "环境配置不能为空") } s.Group(apiBasePath, func(group *ghttp.RouterGroup) { uploadPath := g.Cfg().MustGet(ctx, "upload.path").String() if uploadPath == "" { g.Log().Fatal(ctx, "文件上传配置路径不能为空") } s.AddStaticPath("/api/upload", uploadPath) group.Middleware( service.Middleware().Ctx, service.Middleware().CORS, service.Middleware().ResponseHandler, ) group.Bind( controller.Login.Login, controller.Login.Logout, controller.Login.MSALLoginSso, ) group.Middleware(service.Middleware().TokenAuth) group.Bind( controller.Login.GetInfo, controller.Login.GetRouters, ) group.Group("/system", func(group *ghttp.RouterGroup) { group.Bind( controller.SysUser, controller.SysRole, controller.SysMenu, controller.SysDictType, controller.SysDictData, controller.SysDept, controller.SysConfig, ) }) group.Group("/monitor", func(group *ghttp.RouterGroup) { group.Bind( controller.SysLoginLog, controller.SysOperLog, controller.SysUserOnline, controller.SysJob, ) }) group.Group("/tool", func(group *ghttp.RouterGroup) { group.Bind( controller.SysGenTable, ) }) }) s.Run() return nil }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.