diff --git a/apis/tools/gen.go b/apis/tools/gen.go index d90de2eb..4d8bb216 100644 --- a/apis/tools/gen.go +++ b/apis/tools/gen.go @@ -178,9 +178,9 @@ func GenMenuAndApi(c *gin.Context) { Cmenu.MenuId, err = Cmenu.Create() MList := models.Menu{} - MList.MenuName = tab.TBName + MList.MenuName = "" MList.Title = "分页获取" + tab.TableComment - MList.Icon = "pass" + MList.Icon = "" MList.Path = tab.TBName MList.MenuType = "F" MList.Action = "无" @@ -197,9 +197,9 @@ func GenMenuAndApi(c *gin.Context) { MList.MenuId, err = MList.Create() MCreate := models.Menu{} - MCreate.MenuName = tab.TBName + MCreate.MenuName = "" MCreate.Title = "创建" + tab.TableComment - MCreate.Icon = "pass" + MCreate.Icon = "" MCreate.Path = tab.TBName MCreate.MenuType = "F" MCreate.Action = "无" @@ -216,9 +216,9 @@ func GenMenuAndApi(c *gin.Context) { MCreate.MenuId, err = MCreate.Create() MUpdate := models.Menu{} - MUpdate.MenuName = tab.TBName + MUpdate.MenuName = "" MUpdate.Title = "修改" + tab.TableComment - MUpdate.Icon = "pass" + MUpdate.Icon = "" MUpdate.Path = tab.TBName MUpdate.MenuType = "F" MUpdate.Action = "无" @@ -235,9 +235,9 @@ func GenMenuAndApi(c *gin.Context) { MUpdate.MenuId, err = MUpdate.Create() MDelete := models.Menu{} - MDelete.MenuName = tab.TBName + MDelete.MenuName = "" MDelete.Title = "删除" + tab.TableComment - MDelete.Icon = "pass" + MDelete.Icon = "" MDelete.Path = tab.TBName MDelete.MenuType = "F" MDelete.Action = "无" @@ -273,7 +273,7 @@ func GenMenuAndApi(c *gin.Context) { Amenu.MenuId, err = Amenu.Create() AList := models.Menu{} - AList.MenuName = tab.TBName + AList.MenuName = "" AList.Title = "分页获取" + tab.TableComment AList.Icon = "bug" AList.Path = "/api/v1/" + tab.ModuleName + "List" @@ -291,7 +291,7 @@ func GenMenuAndApi(c *gin.Context) { AList.MenuId, err = AList.Create() AGet := models.Menu{} - AGet.MenuName = tab.TBName + AGet.MenuName = "" AGet.Title = "根据id获取" + tab.TableComment AGet.Icon = "bug" AGet.Path = "/api/v1/" + tab.ModuleName + "/:id" @@ -309,7 +309,7 @@ func GenMenuAndApi(c *gin.Context) { AGet.MenuId, err = AGet.Create() ACreate := models.Menu{} - ACreate.MenuName = tab.TBName + ACreate.MenuName = "" ACreate.Title = "创建" + tab.TableComment ACreate.Icon = "bug" ACreate.Path = "/api/v1/" + tab.ModuleName @@ -327,7 +327,7 @@ func GenMenuAndApi(c *gin.Context) { ACreate.MenuId, err = ACreate.Create() AUpdate := models.Menu{} - AUpdate.MenuName = tab.TBName + AUpdate.MenuName = "" AUpdate.Title = "修改" + tab.TableComment AUpdate.Icon = "bug" AUpdate.Path = "/api/v1/" + tab.ModuleName @@ -345,7 +345,7 @@ func GenMenuAndApi(c *gin.Context) { AUpdate.MenuId, err = AUpdate.Create() ADelete := models.Menu{} - ADelete.MenuName = tab.TBName + ADelete.MenuName = "" ADelete.Title = "删除" + tab.TableComment ADelete.Icon = "bug" ADelete.Path = "/api/v1/" + tab.ModuleName + "/:id" diff --git a/cmd/migrate/server.go b/cmd/migrate/server.go index dba76758..02e51cbc 100644 --- a/cmd/migrate/server.go +++ b/cmd/migrate/server.go @@ -16,8 +16,8 @@ var ( configYml string mode string StartCmd = &cobra.Command{ - Use: "init", - Short: "Initialize the database", + Use: "init", + Short: "Initialize the database", Example: "go-admin init -c config/settings.yml", Run: func(cmd *cobra.Command, args []string) { run() @@ -44,7 +44,7 @@ func run() { fmt.Println("数据库结构初始化成功!") //5. 数据初始化完成 if err := models.InitDb(); err != nil { - global.Logger.Fatal("数据库基础数据初始化失败!") + global.Logger.Fatal("数据库基础数据初始化失败!error: %v ", err) } usage = `数据库基础数据初始化成功` fmt.Println(usage) diff --git a/config/db.sql b/config/db.sql index ca98399e..a09dd2f1 100644 --- a/config/db.sql +++ b/config/db.sql @@ -452,8 +452,8 @@ INSERT INTO sys_user VALUES (2, 'zhangwj', '13211111111', 3, NULL, NULL, '0', 'q INSERT INTO sys_setting VALUES (1, 'go-admin管理系统', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', '2020-08-05 14:27:34', '2020-08-07 10:13:31' ,NULL); -INSERT INTO sys_job VALUES (1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ?', 'http://localhost:8000', 1, 1, 2, 0, '', '', '2020-08-03 14:54:03', '2020-08-11 21:48:47', NULL); -INSERT INTO sys_job VALUES (2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ?', 'ExamplesOne', 1, 1, 2, 0, '', '', '2020-08-11 21:41:23', '2020-08-11 21:41:31', NULL); +INSERT INTO sys_job VALUES (1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ?', 'http://localhost:8000', NULL, 1, 1, 2, 1, '', '', '2020-08-03 14:54:03', '2020-08-25 16:49:46', NULL); +INSERT INTO sys_job VALUES (2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ?', 'ExamplesOne', '参数', 1, 1, 2, 2, '', '', '2020-08-11 21:41:23', '2020-08-25 16:49:46', NULL); COMMIT; -- 数据完成 ; \ No newline at end of file