Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateApiHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("CreateApiHandler") info := ApiInfo{} info.SetUp() info.Package = "api" info.Tables = table createWebSrcFile("api/api.js", "api.y", info) }
View Source
var CreateDirHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("CreateDirHandler") filemode := os.ModePerm os.MkdirAll(cfg.Cfg.GetWebTempPath(), filemode) }
View Source
var CreateEnvHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("CreateEnvHandler") info := EnvInfo{} info.SetUp() info.Tables = table createWebSrcFile("config/env.js", "env.y", info) }
View Source
var CreateHomeHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("CreateHomeHandler") info := HomeInfo{} info.SetUp() info.Tables = table createWebSrcFile("pages/home.vue", "home.y", info) }
View Source
var CreateMainHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("CreateMainHandler") info := MainInfo{} info.SetUp() info.Tables = table createWebSrcFile("pages/main.vue", "main.y", info) }
View Source
var CreatePageHandler handler.HandlerOneTableFunc = func(table *common.Table, columns []*common.Column) { beego.Debug("CreatePageHandler") info := PageInfo{} info.SetUp() info.TableNameLow = strings.ToLower(table.Name) info.TableNameUpper = strings.ToUpper(table.Name) info.FirstColumnName = columns[0].Name if len(columns) > 1 { info.SecondColumnName = columns[1].Name } else { info.SecondColumnName = "y" + columns[0].Name } info.Columns = columns info.Table = table createWebSrcFile("pages/"+strings.ToLower(table.Name)+".vue", "page.y", info) }
View Source
var CreateRouterHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("CreateRouterHandler") info := RouterInfo{} info.SetUp() info.Tables = table createWebSrcFile("router/index.js", "router.y", info) }
View Source
var DownloadBaseProjectHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("DownloadHandler") filemode := os.ModePerm now := common.GetNowTimeYYYYMMDDhhmmss() tempdir := cfg.Cfg.GetWebTempPath() + now + "/" e := os.MkdirAll(tempdir, filemode) if e != nil { panic(e) } savefilepath := tempdir + "daminghu-web.zip" if common.CmdParam.Jsondata == "" { handler.DownloadFile(common.WebBasProZipUrl, savefilepath) } else { handler.DownloadFile(common.WebBasProNoChromeZipUrl, savefilepath) } handler.Unzip(savefilepath, tempdir) if _, err := os.Stat(cfg.Cfg.GetWebProjcetPath()); os.IsExist(err) { os.Rename(cfg.Cfg.GetWebProjcetPath(), cfg.Cfg.GetWebProjcetPath()+"bak") } os.Rename(tempdir+"daminghu-web", cfg.Cfg.GetWebProjcetPath()) }
View Source
var DownloadTemplateHandler handler.HandlerTablesFunc = func(table []*common.Table) { beego.Debug("DownloadTemplateHandler") filemode := os.ModePerm now := common.GetNowTimeYYYYMMDDhhmmss() tempdir := cfg.Cfg.GetWebTempPath() + now + "/" e := os.MkdirAll(tempdir, filemode) if e != nil { panic(e) } savefilepath := tempdir + "web.zip" handler.DownloadFile(common.WebTemplateZipUrl, savefilepath) handler.Unzip(savefilepath, tempdir) cfg.Cfg.WebTemplatePath = tempdir + "web/" }
Functions ¶
This section is empty.
Types ¶
type RouterInfo ¶
Click to show internal directories.
Click to hide internal directories.