添加js模板,页面模板,去掉数据库数据初始化,去掉sql文件中没用语句
This commit is contained in:
1 parent
ba1c7f6193
commit
8faff5384f
29 files changed
+1364
-771
No files matched your search
@@ -14,7 +14,7 @@ import (
|
||||
// @Param tableName query string false "tableName / 数据表名称"
|
||||
// @Param pageSize query int false "pageSize / 页条数"
|
||||
// @Param pageIndex query int false "pageIndex / 页码"
|
||||
// @Success 200 {object} models.Response "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /api/v1/db/columns/page [get]
|
||||
func GetDBColumnList(c *gin.Context) {
|
||||
var data tools.DBColumns
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
// @Param tableName query string false "tableName / 数据表名称"
|
||||
// @Param pageSize query int false "pageSize / 页条数"
|
||||
// @Param pageIndex query int false "pageIndex / 页码"
|
||||
// @Success 200 {object} models.Response "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /api/v1/db/tables/page [get]
|
||||
func GetDBTableList(c *gin.Context) {
|
||||
var res app.Response
|
||||
|
||||
@@ -19,15 +19,25 @@ func Preview(c *gin.Context) {
|
||||
tools2.HasError(err, "", -1)
|
||||
t2, err := template.ParseFiles("template/api.go.template")
|
||||
tools2.HasError(err, "", -1)
|
||||
t3, err := template.ParseFiles("template/js.go.template")
|
||||
tools2.HasError(err, "", -1)
|
||||
t4, err := template.ParseFiles("template/vue.go.template")
|
||||
tools2.HasError(err, "", -1)
|
||||
tab, _ := table.Get()
|
||||
var b1 bytes.Buffer
|
||||
err = t1.Execute(&b1, tab)
|
||||
var b2 bytes.Buffer
|
||||
err = t2.Execute(&b2, tab)
|
||||
var b3 bytes.Buffer
|
||||
err = t3.Execute(&b3, tab)
|
||||
var b4 bytes.Buffer
|
||||
err = t4.Execute(&b4, tab)
|
||||
|
||||
mp := make(map[string]interface{})
|
||||
mp["template/model.go.template"] = b1.String()
|
||||
mp["template/api.go.template"] = b2.String()
|
||||
mp["template/js.go.template"] = b3.String()
|
||||
mp["template/vue.go.template"] = b4.String()
|
||||
var res app.Response
|
||||
res.Data = mp
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
// @Param tableName query string false "tableName / 数据表名称"
|
||||
// @Param pageSize query int false "pageSize / 页条数"
|
||||
// @Param pageIndex query int false "pageIndex / 页码"
|
||||
// @Success 200 {object} models.Response "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /api/v1/sys/tables/page [get]
|
||||
func GetSysTableList(c *gin.Context) {
|
||||
var data tools.SysTables
|
||||
@@ -52,7 +52,7 @@ func GetSysTableList(c *gin.Context) {
|
||||
// @Description 获取JSON
|
||||
// @Tags 工具 - 生成表
|
||||
// @Param configKey path int true "configKey"
|
||||
// @Success 200 {object} models.Response "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /api/v1/sys/tables/info/{tableId} [get]
|
||||
// @Security
|
||||
func GetSysTables(c *gin.Context) {
|
||||
|
||||
Reference in new issue
Block a user