From 1ecfcdcdd2f43dae6e30ea8d54785a74126910c8 Mon Sep 17 00:00:00 2001 From: xuedinge <781408517@qq.com> Date: Sun, 14 Apr 2024 21:15:03 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=92=E4=BB=B6=E4=BF=AE=E5=A4=8Dwebsotrm?= =?UTF-8?q?=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/vitePlugin/codeServer/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/vitePlugin/codeServer/index.js b/web/vitePlugin/codeServer/index.js index 390310e87d..d919abac28 100644 --- a/web/vitePlugin/codeServer/index.js +++ b/web/vitePlugin/codeServer/index.js @@ -11,8 +11,9 @@ export default function GvaPositionServer() { req._parsedUrl.query && req._parsedUrl.query.split('=')[1] if (path && path !== 'null') { if (process.env.VITE_EDITOR === 'webstorm') { - const linePath = path.split(':')[1] - const filePath = path.split(':')[0] + const lastColonIndex = path.lastIndexOf(':') + const linePath = path.substring(lastColonIndex + 1) + const filePath = path.substring(0, lastColonIndex) const platform = os() if (platform === 'win32') { child_process.exec( From 5b905c9a1e343134d9c1bc36c65ecbc78f00899c Mon Sep 17 00:00:00 2001 From: xuedinge <781408517@qq.com> Date: Thu, 9 May 2024 19:44:26 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BB=A3=E7=A0=81=E5=A2=9E=E5=8A=A0int64=E5=92=8Cuint?= =?UTF-8?q?(=E9=BB=98=E8=AE=A4id=E7=B1=BB=E5=9E=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/view/systemTools/autoCode/index.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/src/view/systemTools/autoCode/index.vue b/web/src/view/systemTools/autoCode/index.vue index aedaf240db..2cc42057eb 100644 --- a/web/src/view/systemTools/autoCode/index.vue +++ b/web/src/view/systemTools/autoCode/index.vue @@ -628,6 +628,14 @@ const typeOptions = ref([ label: '整型', value: 'int' }, + { + label: '整型64', + value: 'int64' + }, + { + label: 'uint(默认id类型)', + value: 'uint' + }, { label: '布尔值', value: 'bool' From 08f8e85536490d17e0e7d7b91c04d56b3fefa853 Mon Sep 17 00:00:00 2001 From: xuedinge <781408517@qq.com> Date: Fri, 24 May 2024 23:46:54 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E5=88=A0=E9=99=A4selectImage.vue?= =?UTF-8?q?=E4=B8=ADchooseImg=E4=B8=8B=E5=A4=9A=E4=BD=99=E7=9A=84console.l?= =?UTF-8?q?og(url)=20=E5=A2=9E=E5=8A=A0emit('getChooseImgUrl',=20url)?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=BB=99=E7=88=B6=E7=BB=84=E4=BB=B6=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=80=89=E4=B8=AD=E7=9A=84=E5=9B=BE=E7=89=87url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/selectImage/selectImage.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/selectImage/selectImage.vue b/web/src/components/selectImage/selectImage.vue index 3a8ff67d40..78daa8a51b 100644 --- a/web/src/components/selectImage/selectImage.vue +++ b/web/src/components/selectImage/selectImage.vue @@ -123,7 +123,7 @@ + From 7912b06463e9e560759580971093671ef500242d Mon Sep 17 00:00:00 2001 From: xuedinge <781408517@qq.com> Date: Thu, 13 Jun 2024 00:18:16 +0800 Subject: [PATCH 09/15] =?UTF-8?q?Revert=20"=E5=A2=9E=E5=8A=A0package?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B9=E5=B1=95=E7=A4=BA=E5=90=8D?= =?UTF-8?q?=E5=AD=97/=E6=8F=8F=E8=BF=B0=E5=86=85=E5=AE=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 055f11c3b6a76f928f485e7aa82c0cdb9f2566ff. --- server/api/v1/system/sys_auto_code.go | 58 ----------- server/model/system/request/sys_auto_code.go | 7 -- server/router/system/sys_auto_code.go | 24 ++--- server/source/system/api.go | 2 - web/src/api/autoCode.js | 16 --- web/src/view/systemTools/autoPkg/autoPkg.vue | 102 ++++--------------- 6 files changed, 32 insertions(+), 177 deletions(-) delete mode 100644 server/model/system/request/sys_auto_code.go diff --git a/server/api/v1/system/sys_auto_code.go b/server/api/v1/system/sys_auto_code.go index 791bd40b61..7f2d365e0c 100644 --- a/server/api/v1/system/sys_auto_code.go +++ b/server/api/v1/system/sys_auto_code.go @@ -6,10 +6,8 @@ import ( "strings" "github.com/flipped-aurora/gin-vue-admin/server/global" - "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" "github.com/flipped-aurora/gin-vue-admin/server/model/common/response" "github.com/flipped-aurora/gin-vue-admin/server/model/system" - sysReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request" "github.com/flipped-aurora/gin-vue-admin/server/utils" "github.com/gin-gonic/gin" @@ -195,34 +193,6 @@ func (autoApi *AutoCodeApi) CreatePackage(c *gin.Context) { } } -// UpdatePackage -// @Tags AutoCode -// @Summary 更新package展示名字/描述 -// @Security ApiKeyAuth -// @accept application/json -// @Produce application/json -// @Param data body system.SysAutoCode true "更新package" -// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "更新package成功" -// @Router /autoCode/updatePackageDetail [post] -func (autoApi *AutoCodeApi) UpdatePackageDetail(c *gin.Context) { - var a sysReq.SysAutoCode - var autoCode system.SysAutoCode - _ = c.ShouldBindJSON(&a) - if err := global.GVA_DB.Where("id = ?", a.ID).First(&autoCode).Error; err != nil { - response.FailWithMessage("获取package失败", c) - return - } - // 更新展示名字/描述 - autoCode.Label = a.Label - autoCode.Desc = a.Desc - if err := global.GVA_DB.Save(&autoCode).Error; err != nil { - global.GVA_LOG.Error("更新失败!", zap.Error(err)) - response.FailWithMessage("更新失败", c) - } else { - response.OkWithMessage("更新成功", c) - } -} - // GetPackage // @Tags AutoCode // @Summary 获取package @@ -241,34 +211,6 @@ func (autoApi *AutoCodeApi) GetPackage(c *gin.Context) { } } -// auto_code_api.go - -// GetPackageByID -// @Tags AutoCode -// @Summary 根据ID获取package -// @Security ApiKeyAuth -// @accept application/json -// @Produce application/json -// @Param id body int true "package ID" -// @Success 200 {object} response.Response{data=system.SysAutoCode,msg=string} "根据ID获取package成功" -// @Router /autoCode/getPackageByID/ POST -func (autoApi *AutoCodeApi) GetPackageById(c *gin.Context) { - var pkgId request.GetById - err := c.ShouldBindJSON(&pkgId) - if err != nil { - response.FailWithMessage(err.Error(), c) - return - } - var autoCode system.SysAutoCode - fmt.Printf("pkgId%+v", pkgId) - if err := global.GVA_DB.First(&autoCode, pkgId).Error; err != nil { - global.GVA_LOG.Error("获取失败!", zap.Error(err)) - response.FailWithMessage("获取失败", c) - } else { - response.OkWithDetailed(gin.H{"pkg": autoCode}, "获取成功", c) - } -} - // DelPackage // @Tags AutoCode // @Summary 删除package diff --git a/server/model/system/request/sys_auto_code.go b/server/model/system/request/sys_auto_code.go deleted file mode 100644 index f20a65893d..0000000000 --- a/server/model/system/request/sys_auto_code.go +++ /dev/null @@ -1,7 +0,0 @@ -package request - -type SysAutoCode struct { - ID uint `gorm:"primarykey" json:"ID"` // 主键ID - Label string `json:"label" gorm:"comment:展示名"` - Desc string `json:"desc" gorm:"comment:描述"` -} diff --git a/server/router/system/sys_auto_code.go b/server/router/system/sys_auto_code.go index f39c235391..4f23a1d132 100644 --- a/server/router/system/sys_auto_code.go +++ b/server/router/system/sys_auto_code.go @@ -11,18 +11,16 @@ func (s *AutoCodeRouter) InitAutoCodeRouter(Router *gin.RouterGroup) { autoCodeRouter := Router.Group("autoCode") autoCodeApi := v1.ApiGroupApp.SystemApiGroup.AutoCodeApi { - autoCodeRouter.GET("getDB", autoCodeApi.GetDB) // 获取数据库 - autoCodeRouter.GET("getTables", autoCodeApi.GetTables) // 获取对应数据库的表 - autoCodeRouter.GET("getColumn", autoCodeApi.GetColumn) // 获取指定表所有字段信息 - autoCodeRouter.POST("preview", autoCodeApi.PreviewTemp) // 获取自动创建代码预览 - autoCodeRouter.POST("createTemp", autoCodeApi.CreateTemp) // 创建自动化代码 - autoCodeRouter.POST("createPackage", autoCodeApi.CreatePackage) // 创建package包 - autoCodeRouter.POST("updatePackageDetail", autoCodeApi.UpdatePackageDetail) // 修改package包展示名/描述 - autoCodeRouter.POST("getPackage", autoCodeApi.GetPackage) // 获取package包 - autoCodeRouter.POST("getPackageById", autoCodeApi.GetPackageById) // 获取package包 - autoCodeRouter.POST("delPackage", autoCodeApi.DelPackage) // 删除package包 - autoCodeRouter.POST("createPlug", autoCodeApi.AutoPlug) // 自动插件包模板 - autoCodeRouter.POST("installPlugin", autoCodeApi.InstallPlugin) // 自动安装插件 - autoCodeRouter.POST("pubPlug", autoCodeApi.PubPlug) // 打包插件 + autoCodeRouter.GET("getDB", autoCodeApi.GetDB) // 获取数据库 + autoCodeRouter.GET("getTables", autoCodeApi.GetTables) // 获取对应数据库的表 + autoCodeRouter.GET("getColumn", autoCodeApi.GetColumn) // 获取指定表所有字段信息 + autoCodeRouter.POST("preview", autoCodeApi.PreviewTemp) // 获取自动创建代码预览 + autoCodeRouter.POST("createTemp", autoCodeApi.CreateTemp) // 创建自动化代码 + autoCodeRouter.POST("createPackage", autoCodeApi.CreatePackage) // 创建package包 + autoCodeRouter.POST("getPackage", autoCodeApi.GetPackage) // 获取package包 + autoCodeRouter.POST("delPackage", autoCodeApi.DelPackage) // 删除package包 + autoCodeRouter.POST("createPlug", autoCodeApi.AutoPlug) // 自动插件包模板 + autoCodeRouter.POST("installPlugin", autoCodeApi.InstallPlugin) // 自动安装插件 + autoCodeRouter.POST("pubPlug", autoCodeApi.PubPlug) // 打包插件 } } diff --git a/server/source/system/api.go b/server/source/system/api.go index c94d86e9d5..6a1b1e1014 100644 --- a/server/source/system/api.go +++ b/server/source/system/api.go @@ -115,9 +115,7 @@ func (i *initApi) InitializeData(ctx context.Context) (context.Context, error) { {ApiGroup: "包(pkg)生成器", Method: "POST", Path: "/autoCode/createPackage", Description: "生成包(package)"}, {ApiGroup: "包(pkg)生成器", Method: "POST", Path: "/autoCode/getPackage", Description: "获取所有包(package)"}, - {ApiGroup: "包(pkg)生成器", Method: "POST", Path: "/autoCode/getPackageById", Description: "获取包详情(package)"}, {ApiGroup: "包(pkg)生成器", Method: "POST", Path: "/autoCode/delPackage", Description: "删除包(package)"}, - {ApiGroup: "包(pkg)生成器", Method: "POST", Path: "/autoCode/updatePackageDetail", Description: "更新包展示名/描述(package)"}, {ApiGroup: "代码生成器历史", Method: "POST", Path: "/autoCode/getMeta", Description: "获取meta信息"}, {ApiGroup: "代码生成器历史", Method: "POST", Path: "/autoCode/rollback", Description: "回滚自动生成代码"}, diff --git a/web/src/api/autoCode.js b/web/src/api/autoCode.js index 8ad0c3b166..abf1924e0e 100644 --- a/web/src/api/autoCode.js +++ b/web/src/api/autoCode.js @@ -116,22 +116,6 @@ export const deletePackageApi = (data) => { data }) } -export const getPackageById = (data) => { - return service({ - url: '/autoCode/getPackageById', - method: 'post', - data - }) -} - - -export const updatePackageDetail = (data) => { - return service({ - url: '/autoCode/updatePackageDetail', - method: 'post', - data - }) -} export const createPlugApi = (data) => { return service({ diff --git a/web/src/view/systemTools/autoPkg/autoPkg.vue b/web/src/view/systemTools/autoPkg/autoPkg.vue index dab98efb8c..cf4485384e 100644 --- a/web/src/view/systemTools/autoPkg/autoPkg.vue +++ b/web/src/view/systemTools/autoPkg/autoPkg.vue @@ -49,12 +49,7 @@ >