增加前台模块,添加实例html模板页面

This commit is contained in:
孟帅
2022-12-15 16:12:08 +08:00
parent 6b3333340f
commit a7658b9b8b
18 changed files with 594 additions and 86 deletions

View File

@@ -17,7 +17,7 @@ var (
serverCloseSignal chan struct{}
Main = &gcmd.Command{
Description: `
欢迎使用HotGo!
命令提示符
---------------------------------------------------------------------------------
启动服务
>> HTTP服务 [go run main.go http]
@@ -34,8 +34,8 @@ var (
Name: "help",
Brief: "查看帮助",
Description: `
欢迎使用 HotGo
当前版本:v2.0.0
github地址:https://github.com/bufanyun/hotgo
文档地址:文档正在书写中,请耐心等一等。
`,
}

View File

@@ -11,6 +11,8 @@ import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gcmd"
baseApi "hotgo/api/home/base"
"hotgo/internal/controller/home/base"
"hotgo/internal/library/casbin"
"hotgo/internal/model"
"hotgo/internal/router"
@@ -55,7 +57,7 @@ var (
// 注册默认首页路由
group.ALL("/", func(r *ghttp.Request) {
r.Response.Write("hello hotGo!!")
_, _ = base.Site.Index(r.Context(), &baseApi.SiteIndexReq{})
return
})
@@ -72,6 +74,8 @@ var (
// 注册websocket路由
router.WebSocket(ctx, group)
// 注册前台页面路由
router.Home(ctx, group)
})
// 启动定时任务