文件结构调整,支持插件自动化 (#1824)
* Update index.vue 多个详情页之间切换tab,页面没有重新渲染 * feature:新增同步API功能 * feature: 同步表数据 * feature:新增同步API功能 * feature: 增加V2插件注册 * feature:给Enter的依赖结构增加单独的New 方便引用 * feature: 调整关联属性的选择模式 * feature: 增加component组件和name的映射插件,防止keepalive的懒加载失效。 * update: PluginInitializeRouter && 修复TypePluginInitializeMenu ast 类型错误 * update: 测试文件的astType 类型错误 * feature: 文件变更自动同步componentName.json。 * feature: 文件变更自动同步componentName.json。 * feat: UI美化 * feat: 自动化页面顺序调整 * feature:修改404页面 * update: PluginInitializeMenu * update: Plugin template * fixed systemApi 重复声明 * api.vue:update:修改API分组为下拉列表 * update: import添加注释 * update: plugin_enter_test.go 增加测试用例 * update: ast 预览文件路径 * update: config Autocode 新增Module字段以及如果为空的情况下自动获取运行目录下的go.mod文件 * update: auto_code_package.go 完善调用ast工具类的封装使用 * update: auto_code_template.go Create方法和修正SysAutoCodeHistory * feat:调整自动化package为模板,增加初始化配置信息,调整页面信息。 * update: ast PreviewPath MkdirAll * update: ast type错误, PluginEnter and PackageModuleEnter add TemplatePath模版路径 * update: autoCodePackage and autoCodeTemplate bug修正 * update: PackageInitializeRouter 传入两个路由组 * update: PackageModuleEnter 处理空变量时与type冲突注入 * update: Package 模版更新 * update: utils/ast 优化统一 * update: 注入内容修复错误 * fix: 修复注释错误 * update: plugin 模版 完成 * feature: 文件watch功能只在development下开启 * update: viper.go.template 因为viper不区分配置的key的大小写所以用package * update: ast 测试代码规范化 * update: package 删除api和router多余导包 * update: plugin template * update: auto_code_package 问题修复 * update: ast 测试插件的预览功能 * update: gorm_biz 更新注册方式 * update: go.mod tidy * remove: plugin template gen main.go.template * update: ast 重构, 分离读取和写入步骤支持 * update: AutoCodePackageApi 传入参数错误修复 * rename: sys_autocode_history.go => sys_auto_code_history.go * update: 预览无需落盘, 创建落盘,抽离公共参数 * update: api.go.tpl 导包位置fmt 和package js位置存放错误 * update: 测试用例修复 and PackageInitializeGorm 重构 * update: ast 新增相对路径, 代码生成器历史回滚功能 * update: ast 工具类回滚失败修复以及测试文件 * update: 代码生成器历史 回滚问题修复 * update: 代码生成器模版忽略.DS_Store * featute: 自动化GORM结构的注入和剔除 * feature: 插件模板调整 * feature: 增加公告插件示例,调整代码模板。 * feature: 自动注册插件V2。 --------- Co-authored-by: zayn <972858472@qq.com> Co-authored-by: SliverHorn <sliver_horn@qq.com> Co-authored-by: krank <emosick@qq.com> Co-authored-by: cjk <wlicjk@126.com> Co-authored-by: piexlMax(奇淼 <qimiaojiangjizhao@gmail.com> Co-authored-by: maxwell <zhong.maxwell@gmail.com>
This commit is contained in:
@@ -5,9 +5,9 @@ import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/router/system"
|
||||
)
|
||||
|
||||
var RouterGroupApp = new(RouterGroup)
|
||||
|
||||
type RouterGroup struct {
|
||||
System system.RouterGroup
|
||||
Example example.RouterGroup
|
||||
}
|
||||
|
||||
var RouterGroupApp = new(RouterGroup)
|
||||
|
@@ -1,6 +1,15 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
api "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
)
|
||||
|
||||
type RouterGroup struct {
|
||||
CustomerRouter
|
||||
FileUploadAndDownloadRouter
|
||||
}
|
||||
|
||||
var (
|
||||
exaCustomerApi = api.ApiGroupApp.ExampleApiGroup.CustomerApi
|
||||
exaFileUploadAndDownloadApi = api.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi
|
||||
)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -11,7 +10,6 @@ type CustomerRouter struct{}
|
||||
func (e *CustomerRouter) InitCustomerRouter(Router *gin.RouterGroup) {
|
||||
customerRouter := Router.Group("customer").Use(middleware.OperationRecord())
|
||||
customerRouterWithoutRecord := Router.Group("customer")
|
||||
exaCustomerApi := v1.ApiGroupApp.ExampleApiGroup.CustomerApi
|
||||
{
|
||||
customerRouter.POST("customer", exaCustomerApi.CreateExaCustomer) // 创建客户
|
||||
customerRouter.PUT("customer", exaCustomerApi.UpdateExaCustomer) // 更新客户
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,7 +8,6 @@ type FileUploadAndDownloadRouter struct{}
|
||||
|
||||
func (e *FileUploadAndDownloadRouter) InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) {
|
||||
fileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload")
|
||||
exaFileUploadAndDownloadApi := v1.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi
|
||||
{
|
||||
fileUploadAndDownloadRouter.POST("upload", exaFileUploadAndDownloadApi.UploadFile) // 上传文件
|
||||
fileUploadAndDownloadRouter.POST("getFileList", exaFileUploadAndDownloadApi.GetFileList) // 获取上传文件列表
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package system
|
||||
|
||||
import api "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
|
||||
type RouterGroup struct {
|
||||
ApiRouter
|
||||
JwtRouter
|
||||
@@ -17,3 +19,24 @@ type RouterGroup struct {
|
||||
AuthorityBtnRouter
|
||||
SysExportTemplateRouter
|
||||
}
|
||||
|
||||
var (
|
||||
dbApi = api.ApiGroupApp.SystemApiGroup.DBApi
|
||||
jwtApi = api.ApiGroupApp.SystemApiGroup.JwtApi
|
||||
baseApi = api.ApiGroupApp.SystemApiGroup.BaseApi
|
||||
casbinApi = api.ApiGroupApp.SystemApiGroup.CasbinApi
|
||||
systemApi = api.ApiGroupApp.SystemApiGroup.SystemApi
|
||||
autoCodeApi = api.ApiGroupApp.SystemApiGroup.AutoCodeApi
|
||||
authorityApi = api.ApiGroupApp.SystemApiGroup.AuthorityApi
|
||||
apiRouterApi = api.ApiGroupApp.SystemApiGroup.SystemApiApi
|
||||
dictionaryApi = api.ApiGroupApp.SystemApiGroup.DictionaryApi
|
||||
authorityBtnApi = api.ApiGroupApp.SystemApiGroup.AuthorityBtnApi
|
||||
authorityMenuApi = api.ApiGroupApp.SystemApiGroup.AuthorityMenuApi
|
||||
autoCodePluginApi = api.ApiGroupApp.SystemApiGroup.AutoCodePluginApi
|
||||
autocodeHistoryApi = api.ApiGroupApp.SystemApiGroup.AutoCodeHistoryApi
|
||||
operationRecordApi = api.ApiGroupApp.SystemApiGroup.OperationRecordApi
|
||||
autoCodePackageApi = api.ApiGroupApp.SystemApiGroup.AutoCodePackageApi
|
||||
dictionaryDetailApi = api.ApiGroupApp.SystemApiGroup.DictionaryDetailApi
|
||||
autoCodeTemplateApi = api.ApiGroupApp.SystemApiGroup.AutoCodeTemplateApi
|
||||
exportTemplateApi = api.ApiGroupApp.SystemApiGroup.SysExportTemplateApi
|
||||
)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -13,7 +12,6 @@ func (s *ApiRouter) InitApiRouter(Router *gin.RouterGroup, RouterPub *gin.Router
|
||||
apiRouterWithoutRecord := Router.Group("api")
|
||||
|
||||
apiPublicRouterWithoutRecord := RouterPub.Group("api")
|
||||
apiRouterApi := v1.ApiGroupApp.SystemApiGroup.SystemApiApi
|
||||
{
|
||||
apiRouter.GET("getApiGroups", apiRouterApi.GetApiGroups) // 获取路由组
|
||||
apiRouter.GET("syncApi", apiRouterApi.SyncApi) // 同步Api
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -11,7 +10,6 @@ type AuthorityRouter struct{}
|
||||
func (s *AuthorityRouter) InitAuthorityRouter(Router *gin.RouterGroup) {
|
||||
authorityRouter := Router.Group("authority").Use(middleware.OperationRecord())
|
||||
authorityRouterWithoutRecord := Router.Group("authority")
|
||||
authorityApi := v1.ApiGroupApp.SystemApiGroup.AuthorityApi
|
||||
{
|
||||
authorityRouter.POST("createAuthority", authorityApi.CreateAuthority) // 创建角色
|
||||
authorityRouter.POST("deleteAuthority", authorityApi.DeleteAuthority) // 删除角色
|
||||
|
@@ -1,16 +1,16 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type AuthorityBtnRouter struct{}
|
||||
|
||||
var AuthorityBtnRouterApp = new(AuthorityBtnRouter)
|
||||
|
||||
func (s *AuthorityBtnRouter) InitAuthorityBtnRouterRouter(Router *gin.RouterGroup) {
|
||||
//authorityRouter := Router.Group("authorityBtn").Use(middleware.OperationRecord())
|
||||
// authorityRouter := Router.Group("authorityBtn").Use(middleware.OperationRecord())
|
||||
authorityRouterWithoutRecord := Router.Group("authorityBtn")
|
||||
authorityBtnApi := v1.ApiGroupApp.SystemApiGroup.AuthorityBtnApi
|
||||
{
|
||||
authorityRouterWithoutRecord.POST("getAuthorityBtn", authorityBtnApi.GetAuthorityBtn)
|
||||
authorityRouterWithoutRecord.POST("setAuthorityBtn", authorityBtnApi.SetAuthorityBtn)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -10,19 +9,26 @@ type AutoCodeRouter struct{}
|
||||
func (s *AutoCodeRouter) InitAutoCodeRouter(Router *gin.RouterGroup, RouterPublic *gin.RouterGroup) {
|
||||
autoCodeRouter := Router.Group("autoCode")
|
||||
publicAutoCodeRouter := RouterPublic.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("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) // 打包插件
|
||||
autoCodeRouter.GET("getDB", autoCodeApi.GetDB) // 获取数据库
|
||||
autoCodeRouter.GET("getTables", autoCodeApi.GetTables) // 获取对应数据库的表
|
||||
autoCodeRouter.GET("getColumn", autoCodeApi.GetColumn) // 获取指定表所有字段信息
|
||||
}
|
||||
{
|
||||
autoCodeRouter.POST("preview", autoCodeTemplateApi.Preview) // 获取自动创建代码预览
|
||||
autoCodeRouter.POST("createTemp", autoCodeTemplateApi.Create) // 创建自动化代码
|
||||
}
|
||||
{
|
||||
autoCodeRouter.POST("getPackage", autoCodePackageApi.All) // 获取package包
|
||||
autoCodeRouter.POST("delPackage", autoCodePackageApi.Delete) // 删除package包
|
||||
autoCodeRouter.POST("createPackage", autoCodePackageApi.Create) // 创建package包
|
||||
}
|
||||
{
|
||||
autoCodeRouter.GET("getTemplates", autoCodePackageApi.Templates) // 创建package包
|
||||
}
|
||||
{
|
||||
autoCodeRouter.POST("pubPlug", autoCodePluginApi.Packaged) // 打包插件
|
||||
autoCodeRouter.POST("installPlugin", autoCodePluginApi.Install) // 自动安装插件
|
||||
}
|
||||
{
|
||||
publicAutoCodeRouter.POST("llmAuto", autoCodeApi.LLMAuto)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,11 +8,10 @@ type AutoCodeHistoryRouter struct{}
|
||||
|
||||
func (s *AutoCodeRouter) InitAutoCodeHistoryRouter(Router *gin.RouterGroup) {
|
||||
autoCodeHistoryRouter := Router.Group("autoCode")
|
||||
autoCodeHistoryApi := v1.ApiGroupApp.SystemApiGroup.AutoCodeHistoryApi
|
||||
{
|
||||
autoCodeHistoryRouter.POST("getMeta", autoCodeHistoryApi.First) // 根据id获取meta信息
|
||||
autoCodeHistoryRouter.POST("rollback", autoCodeHistoryApi.RollBack) // 回滚
|
||||
autoCodeHistoryRouter.POST("delSysHistory", autoCodeHistoryApi.Delete) // 删除回滚记录
|
||||
autoCodeHistoryRouter.POST("getSysHistory", autoCodeHistoryApi.GetList) // 获取回滚记录分页
|
||||
autoCodeHistoryRouter.POST("getMeta", autocodeHistoryApi.First) // 根据id获取meta信息
|
||||
autoCodeHistoryRouter.POST("rollback", autocodeHistoryApi.RollBack) // 回滚
|
||||
autoCodeHistoryRouter.POST("delSysHistory", autocodeHistoryApi.Delete) // 删除回滚记录
|
||||
autoCodeHistoryRouter.POST("getSysHistory", autocodeHistoryApi.GetList) // 获取回滚记录分页
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,7 +8,6 @@ type BaseRouter struct{}
|
||||
|
||||
func (s *BaseRouter) InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
|
||||
baseRouter := Router.Group("base")
|
||||
baseApi := v1.ApiGroupApp.SystemApiGroup.BaseApi
|
||||
{
|
||||
baseRouter.POST("login", baseApi.Login)
|
||||
baseRouter.POST("captcha", baseApi.Captcha)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -11,7 +10,6 @@ type CasbinRouter struct{}
|
||||
func (s *CasbinRouter) InitCasbinRouter(Router *gin.RouterGroup) {
|
||||
casbinRouter := Router.Group("casbin").Use(middleware.OperationRecord())
|
||||
casbinRouterWithoutRecord := Router.Group("casbin")
|
||||
casbinApi := v1.ApiGroupApp.SystemApiGroup.CasbinApi
|
||||
{
|
||||
casbinRouter.POST("updateCasbin", casbinApi.UpdateCasbin)
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -11,14 +10,13 @@ type DictionaryRouter struct{}
|
||||
func (s *DictionaryRouter) InitSysDictionaryRouter(Router *gin.RouterGroup) {
|
||||
sysDictionaryRouter := Router.Group("sysDictionary").Use(middleware.OperationRecord())
|
||||
sysDictionaryRouterWithoutRecord := Router.Group("sysDictionary")
|
||||
sysDictionaryApi := v1.ApiGroupApp.SystemApiGroup.DictionaryApi
|
||||
{
|
||||
sysDictionaryRouter.POST("createSysDictionary", sysDictionaryApi.CreateSysDictionary) // 新建SysDictionary
|
||||
sysDictionaryRouter.DELETE("deleteSysDictionary", sysDictionaryApi.DeleteSysDictionary) // 删除SysDictionary
|
||||
sysDictionaryRouter.PUT("updateSysDictionary", sysDictionaryApi.UpdateSysDictionary) // 更新SysDictionary
|
||||
sysDictionaryRouter.POST("createSysDictionary", dictionaryApi.CreateSysDictionary) // 新建SysDictionary
|
||||
sysDictionaryRouter.DELETE("deleteSysDictionary", dictionaryApi.DeleteSysDictionary) // 删除SysDictionary
|
||||
sysDictionaryRouter.PUT("updateSysDictionary", dictionaryApi.UpdateSysDictionary) // 更新SysDictionary
|
||||
}
|
||||
{
|
||||
sysDictionaryRouterWithoutRecord.GET("findSysDictionary", sysDictionaryApi.FindSysDictionary) // 根据ID获取SysDictionary
|
||||
sysDictionaryRouterWithoutRecord.GET("getSysDictionaryList", sysDictionaryApi.GetSysDictionaryList) // 获取SysDictionary列表
|
||||
sysDictionaryRouterWithoutRecord.GET("findSysDictionary", dictionaryApi.FindSysDictionary) // 根据ID获取SysDictionary
|
||||
sysDictionaryRouterWithoutRecord.GET("getSysDictionaryList", dictionaryApi.GetSysDictionaryList) // 获取SysDictionary列表
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -11,14 +10,13 @@ type DictionaryDetailRouter struct{}
|
||||
func (s *DictionaryDetailRouter) InitSysDictionaryDetailRouter(Router *gin.RouterGroup) {
|
||||
dictionaryDetailRouter := Router.Group("sysDictionaryDetail").Use(middleware.OperationRecord())
|
||||
dictionaryDetailRouterWithoutRecord := Router.Group("sysDictionaryDetail")
|
||||
sysDictionaryDetailApi := v1.ApiGroupApp.SystemApiGroup.DictionaryDetailApi
|
||||
{
|
||||
dictionaryDetailRouter.POST("createSysDictionaryDetail", sysDictionaryDetailApi.CreateSysDictionaryDetail) // 新建SysDictionaryDetail
|
||||
dictionaryDetailRouter.DELETE("deleteSysDictionaryDetail", sysDictionaryDetailApi.DeleteSysDictionaryDetail) // 删除SysDictionaryDetail
|
||||
dictionaryDetailRouter.PUT("updateSysDictionaryDetail", sysDictionaryDetailApi.UpdateSysDictionaryDetail) // 更新SysDictionaryDetail
|
||||
dictionaryDetailRouter.POST("createSysDictionaryDetail", dictionaryDetailApi.CreateSysDictionaryDetail) // 新建SysDictionaryDetail
|
||||
dictionaryDetailRouter.DELETE("deleteSysDictionaryDetail", dictionaryDetailApi.DeleteSysDictionaryDetail) // 删除SysDictionaryDetail
|
||||
dictionaryDetailRouter.PUT("updateSysDictionaryDetail", dictionaryDetailApi.UpdateSysDictionaryDetail) // 更新SysDictionaryDetail
|
||||
}
|
||||
{
|
||||
dictionaryDetailRouterWithoutRecord.GET("findSysDictionaryDetail", sysDictionaryDetailApi.FindSysDictionaryDetail) // 根据ID获取SysDictionaryDetail
|
||||
dictionaryDetailRouterWithoutRecord.GET("getSysDictionaryDetailList", sysDictionaryDetailApi.GetSysDictionaryDetailList) // 获取SysDictionaryDetail列表
|
||||
dictionaryDetailRouterWithoutRecord.GET("findSysDictionaryDetail", dictionaryDetailApi.FindSysDictionaryDetail) // 根据ID获取SysDictionaryDetail
|
||||
dictionaryDetailRouterWithoutRecord.GET("getSysDictionaryDetailList", dictionaryDetailApi.GetSysDictionaryDetailList) // 获取SysDictionaryDetail列表
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -13,18 +12,17 @@ type SysExportTemplateRouter struct {
|
||||
func (s *SysExportTemplateRouter) InitSysExportTemplateRouter(Router *gin.RouterGroup) {
|
||||
sysExportTemplateRouter := Router.Group("sysExportTemplate").Use(middleware.OperationRecord())
|
||||
sysExportTemplateRouterWithoutRecord := Router.Group("sysExportTemplate")
|
||||
var sysExportTemplateApi = v1.ApiGroupApp.SystemApiGroup.SysExportTemplateApi
|
||||
{
|
||||
sysExportTemplateRouter.POST("createSysExportTemplate", sysExportTemplateApi.CreateSysExportTemplate) // 新建导出模板
|
||||
sysExportTemplateRouter.DELETE("deleteSysExportTemplate", sysExportTemplateApi.DeleteSysExportTemplate) // 删除导出模板
|
||||
sysExportTemplateRouter.DELETE("deleteSysExportTemplateByIds", sysExportTemplateApi.DeleteSysExportTemplateByIds) // 批量删除导出模板
|
||||
sysExportTemplateRouter.PUT("updateSysExportTemplate", sysExportTemplateApi.UpdateSysExportTemplate) // 更新导出模板
|
||||
sysExportTemplateRouter.POST("importExcel", sysExportTemplateApi.ImportExcel) // 更新导出模板
|
||||
sysExportTemplateRouter.POST("createSysExportTemplate", exportTemplateApi.CreateSysExportTemplate) // 新建导出模板
|
||||
sysExportTemplateRouter.DELETE("deleteSysExportTemplate", exportTemplateApi.DeleteSysExportTemplate) // 删除导出模板
|
||||
sysExportTemplateRouter.DELETE("deleteSysExportTemplateByIds", exportTemplateApi.DeleteSysExportTemplateByIds) // 批量删除导出模板
|
||||
sysExportTemplateRouter.PUT("updateSysExportTemplate", exportTemplateApi.UpdateSysExportTemplate) // 更新导出模板
|
||||
sysExportTemplateRouter.POST("importExcel", exportTemplateApi.ImportExcel) // 更新导出模板
|
||||
}
|
||||
{
|
||||
sysExportTemplateRouterWithoutRecord.GET("findSysExportTemplate", sysExportTemplateApi.FindSysExportTemplate) // 根据ID获取导出模板
|
||||
sysExportTemplateRouterWithoutRecord.GET("getSysExportTemplateList", sysExportTemplateApi.GetSysExportTemplateList) // 获取导出模板列表
|
||||
sysExportTemplateRouterWithoutRecord.GET("exportExcel", sysExportTemplateApi.ExportExcel) // 导出表格
|
||||
sysExportTemplateRouterWithoutRecord.GET("exportTemplate", sysExportTemplateApi.ExportTemplate) // 导出表格模板
|
||||
sysExportTemplateRouterWithoutRecord.GET("findSysExportTemplate", exportTemplateApi.FindSysExportTemplate) // 根据ID获取导出模板
|
||||
sysExportTemplateRouterWithoutRecord.GET("getSysExportTemplateList", exportTemplateApi.GetSysExportTemplateList) // 获取导出模板列表
|
||||
sysExportTemplateRouterWithoutRecord.GET("exportExcel", exportTemplateApi.ExportExcel) // 导出表格
|
||||
sysExportTemplateRouterWithoutRecord.GET("exportTemplate", exportTemplateApi.ExportTemplate) // 导出表格模板
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,7 +8,6 @@ type InitRouter struct{}
|
||||
|
||||
func (s *InitRouter) InitInitRouter(Router *gin.RouterGroup) {
|
||||
initRouter := Router.Group("init")
|
||||
dbApi := v1.ApiGroupApp.SystemApiGroup.DBApi
|
||||
{
|
||||
initRouter.POST("initdb", dbApi.InitDB) // 初始化数据库
|
||||
initRouter.POST("checkdb", dbApi.CheckDB) // 检测是否需要初始化数据库
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,7 +8,6 @@ type JwtRouter struct{}
|
||||
|
||||
func (s *JwtRouter) InitJwtRouter(Router *gin.RouterGroup) {
|
||||
jwtRouter := Router.Group("jwt")
|
||||
jwtApi := v1.ApiGroupApp.SystemApiGroup.JwtApi
|
||||
{
|
||||
jwtRouter.POST("jsonInBlacklist", jwtApi.JsonInBlacklist) // jwt加入黑名单
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -11,7 +10,6 @@ type MenuRouter struct{}
|
||||
func (s *MenuRouter) InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
|
||||
menuRouter := Router.Group("menu").Use(middleware.OperationRecord())
|
||||
menuRouterWithoutRecord := Router.Group("menu")
|
||||
authorityMenuApi := v1.ApiGroupApp.SystemApiGroup.AuthorityMenuApi
|
||||
{
|
||||
menuRouter.POST("addBaseMenu", authorityMenuApi.AddBaseMenu) // 新增菜单
|
||||
menuRouter.POST("addMenuAuthority", authorityMenuApi.AddMenuAuthority) // 增加menu和角色关联关系
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,13 +8,12 @@ type OperationRecordRouter struct{}
|
||||
|
||||
func (s *OperationRecordRouter) InitSysOperationRecordRouter(Router *gin.RouterGroup) {
|
||||
operationRecordRouter := Router.Group("sysOperationRecord")
|
||||
authorityMenuApi := v1.ApiGroupApp.SystemApiGroup.OperationRecordApi
|
||||
{
|
||||
operationRecordRouter.POST("createSysOperationRecord", authorityMenuApi.CreateSysOperationRecord) // 新建SysOperationRecord
|
||||
operationRecordRouter.DELETE("deleteSysOperationRecord", authorityMenuApi.DeleteSysOperationRecord) // 删除SysOperationRecord
|
||||
operationRecordRouter.DELETE("deleteSysOperationRecordByIds", authorityMenuApi.DeleteSysOperationRecordByIds) // 批量删除SysOperationRecord
|
||||
operationRecordRouter.GET("findSysOperationRecord", authorityMenuApi.FindSysOperationRecord) // 根据ID获取SysOperationRecord
|
||||
operationRecordRouter.GET("getSysOperationRecordList", authorityMenuApi.GetSysOperationRecordList) // 获取SysOperationRecord列表
|
||||
operationRecordRouter.POST("createSysOperationRecord", operationRecordApi.CreateSysOperationRecord) // 新建SysOperationRecord
|
||||
operationRecordRouter.DELETE("deleteSysOperationRecord", operationRecordApi.DeleteSysOperationRecord) // 删除SysOperationRecord
|
||||
operationRecordRouter.DELETE("deleteSysOperationRecordByIds", operationRecordApi.DeleteSysOperationRecordByIds) // 批量删除SysOperationRecord
|
||||
operationRecordRouter.GET("findSysOperationRecord", operationRecordApi.FindSysOperationRecord) // 根据ID获取SysOperationRecord
|
||||
operationRecordRouter.GET("getSysOperationRecordList", operationRecordApi.GetSysOperationRecordList) // 获取SysOperationRecord列表
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -10,11 +9,14 @@ type SysRouter struct{}
|
||||
|
||||
func (s *SysRouter) InitSystemRouter(Router *gin.RouterGroup) {
|
||||
sysRouter := Router.Group("system").Use(middleware.OperationRecord())
|
||||
systemApi := v1.ApiGroupApp.SystemApiGroup.SystemApi
|
||||
sysRouterWithoutRecord := Router.Group("system")
|
||||
|
||||
{
|
||||
sysRouter.POST("getSystemConfig", systemApi.GetSystemConfig) // 获取配置文件内容
|
||||
sysRouter.POST("setSystemConfig", systemApi.SetSystemConfig) // 设置配置文件内容
|
||||
sysRouter.POST("getServerInfo", systemApi.GetServerInfo) // 获取服务器信息
|
||||
sysRouter.POST("reloadSystem", systemApi.ReloadSystem) // 重启服务
|
||||
}
|
||||
{
|
||||
sysRouterWithoutRecord.POST("getSystemConfig", systemApi.GetSystemConfig) // 获取配置文件内容
|
||||
sysRouterWithoutRecord.POST("getServerInfo", systemApi.GetServerInfo) // 获取服务器信息
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -11,7 +10,6 @@ type UserRouter struct{}
|
||||
func (s *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
|
||||
userRouter := Router.Group("user").Use(middleware.OperationRecord())
|
||||
userRouterWithoutRecord := Router.Group("user")
|
||||
baseApi := v1.ApiGroupApp.SystemApiGroup.BaseApi
|
||||
{
|
||||
userRouter.POST("admin_register", baseApi.Register) // 管理员注册账号
|
||||
userRouter.POST("changePassword", baseApi.ChangePassword) // 用户修改密码
|
||||
|
Reference in New Issue
Block a user