✨ init project
This commit is contained in:
13
router/enter.go
Normal file
13
router/enter.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/router/example"
|
||||
"git.echol.cn/loser/xiecheng_server/router/system"
|
||||
)
|
||||
|
||||
var RouterGroupApp = new(RouterGroup)
|
||||
|
||||
type RouterGroup struct {
|
||||
System system.RouterGroup
|
||||
Example example.RouterGroup
|
||||
}
|
17
router/example/enter.go
Normal file
17
router/example/enter.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
api "git.echol.cn/loser/xiecheng_server/api/v1"
|
||||
)
|
||||
|
||||
type RouterGroup struct {
|
||||
CustomerRouter
|
||||
FileUploadAndDownloadRouter
|
||||
AttachmentCategoryRouter
|
||||
}
|
||||
|
||||
var (
|
||||
exaCustomerApi = api.ApiGroupApp.ExampleApiGroup.CustomerApi
|
||||
exaFileUploadAndDownloadApi = api.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi
|
||||
attachmentCategoryApi = api.ApiGroupApp.ExampleApiGroup.AttachmentCategoryApi
|
||||
)
|
16
router/example/exa_attachment_category.go
Normal file
16
router/example/exa_attachment_category.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type AttachmentCategoryRouter struct{}
|
||||
|
||||
func (r *AttachmentCategoryRouter) InitAttachmentCategoryRouterRouter(Router *gin.RouterGroup) {
|
||||
router := Router.Group("attachmentCategory")
|
||||
{
|
||||
router.GET("getCategoryList", attachmentCategoryApi.GetCategoryList) // 分类列表
|
||||
router.POST("addCategory", attachmentCategoryApi.AddCategory) // 添加/编辑分类
|
||||
router.POST("deleteCategory", attachmentCategoryApi.DeleteCategory) // 删除分类
|
||||
}
|
||||
}
|
22
router/example/exa_customer.go
Normal file
22
router/example/exa_customer.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type CustomerRouter struct{}
|
||||
|
||||
func (e *CustomerRouter) InitCustomerRouter(Router *gin.RouterGroup) {
|
||||
customerRouter := Router.Group("customer").Use(middleware.OperationRecord())
|
||||
customerRouterWithoutRecord := Router.Group("customer")
|
||||
{
|
||||
customerRouter.POST("customer", exaCustomerApi.CreateExaCustomer) // 创建客户
|
||||
customerRouter.PUT("customer", exaCustomerApi.UpdateExaCustomer) // 更新客户
|
||||
customerRouter.DELETE("customer", exaCustomerApi.DeleteExaCustomer) // 删除客户
|
||||
}
|
||||
{
|
||||
customerRouterWithoutRecord.GET("customer", exaCustomerApi.GetExaCustomer) // 获取单一客户信息
|
||||
customerRouterWithoutRecord.GET("customerList", exaCustomerApi.GetExaCustomerList) // 获取客户列表
|
||||
}
|
||||
}
|
22
router/example/exa_file_upload_and_download.go
Normal file
22
router/example/exa_file_upload_and_download.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type FileUploadAndDownloadRouter struct{}
|
||||
|
||||
func (e *FileUploadAndDownloadRouter) InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) {
|
||||
fileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload")
|
||||
{
|
||||
fileUploadAndDownloadRouter.POST("upload", exaFileUploadAndDownloadApi.UploadFile) // 上传文件
|
||||
fileUploadAndDownloadRouter.POST("getFileList", exaFileUploadAndDownloadApi.GetFileList) // 获取上传文件列表
|
||||
fileUploadAndDownloadRouter.POST("deleteFile", exaFileUploadAndDownloadApi.DeleteFile) // 删除指定文件
|
||||
fileUploadAndDownloadRouter.POST("editFileName", exaFileUploadAndDownloadApi.EditFileName) // 编辑文件名或者备注
|
||||
fileUploadAndDownloadRouter.POST("breakpointContinue", exaFileUploadAndDownloadApi.BreakpointContinue) // 断点续传
|
||||
fileUploadAndDownloadRouter.GET("findFile", exaFileUploadAndDownloadApi.FindFile) // 查询当前文件成功的切片
|
||||
fileUploadAndDownloadRouter.POST("breakpointContinueFinish", exaFileUploadAndDownloadApi.BreakpointContinueFinish) // 切片传输完成
|
||||
fileUploadAndDownloadRouter.POST("removeChunk", exaFileUploadAndDownloadApi.RemoveChunk) // 删除切片
|
||||
fileUploadAndDownloadRouter.POST("importURL", exaFileUploadAndDownloadApi.ImportURL) // 导入URL
|
||||
}
|
||||
}
|
44
router/system/enter.go
Normal file
44
router/system/enter.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package system
|
||||
|
||||
import api "git.echol.cn/loser/xiecheng_server/api/v1"
|
||||
|
||||
type RouterGroup struct {
|
||||
ApiRouter
|
||||
JwtRouter
|
||||
SysRouter
|
||||
BaseRouter
|
||||
InitRouter
|
||||
MenuRouter
|
||||
UserRouter
|
||||
CasbinRouter
|
||||
AutoCodeRouter
|
||||
AuthorityRouter
|
||||
DictionaryRouter
|
||||
OperationRecordRouter
|
||||
DictionaryDetailRouter
|
||||
AuthorityBtnRouter
|
||||
SysExportTemplateRouter
|
||||
SysParamsRouter
|
||||
}
|
||||
|
||||
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
|
||||
sysParamsApi = api.ApiGroupApp.SystemApiGroup.SysParamsApi
|
||||
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
|
||||
)
|
33
router/system/sys_api.go
Normal file
33
router/system/sys_api.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ApiRouter struct{}
|
||||
|
||||
func (s *ApiRouter) InitApiRouter(Router *gin.RouterGroup, RouterPub *gin.RouterGroup) {
|
||||
apiRouter := Router.Group("api").Use(middleware.OperationRecord())
|
||||
apiRouterWithoutRecord := Router.Group("api")
|
||||
|
||||
apiPublicRouterWithoutRecord := RouterPub.Group("api")
|
||||
{
|
||||
apiRouter.GET("getApiGroups", apiRouterApi.GetApiGroups) // 获取路由组
|
||||
apiRouter.GET("syncApi", apiRouterApi.SyncApi) // 同步Api
|
||||
apiRouter.POST("ignoreApi", apiRouterApi.IgnoreApi) // 忽略Api
|
||||
apiRouter.POST("enterSyncApi", apiRouterApi.EnterSyncApi) // 确认同步Api
|
||||
apiRouter.POST("createApi", apiRouterApi.CreateApi) // 创建Api
|
||||
apiRouter.POST("deleteApi", apiRouterApi.DeleteApi) // 删除Api
|
||||
apiRouter.POST("getApiById", apiRouterApi.GetApiById) // 获取单条Api消息
|
||||
apiRouter.POST("updateApi", apiRouterApi.UpdateApi) // 更新api
|
||||
apiRouter.DELETE("deleteApisByIds", apiRouterApi.DeleteApisByIds) // 删除选中api
|
||||
}
|
||||
{
|
||||
apiRouterWithoutRecord.POST("getAllApis", apiRouterApi.GetAllApis) // 获取所有api
|
||||
apiRouterWithoutRecord.POST("getApiList", apiRouterApi.GetApiList) // 获取Api列表
|
||||
}
|
||||
{
|
||||
apiPublicRouterWithoutRecord.GET("freshCasbin", apiRouterApi.FreshCasbin) // 刷新casbin权限
|
||||
}
|
||||
}
|
23
router/system/sys_authority.go
Normal file
23
router/system/sys_authority.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type AuthorityRouter struct{}
|
||||
|
||||
func (s *AuthorityRouter) InitAuthorityRouter(Router *gin.RouterGroup) {
|
||||
authorityRouter := Router.Group("authority").Use(middleware.OperationRecord())
|
||||
authorityRouterWithoutRecord := Router.Group("authority")
|
||||
{
|
||||
authorityRouter.POST("createAuthority", authorityApi.CreateAuthority) // 创建角色
|
||||
authorityRouter.POST("deleteAuthority", authorityApi.DeleteAuthority) // 删除角色
|
||||
authorityRouter.PUT("updateAuthority", authorityApi.UpdateAuthority) // 更新角色
|
||||
authorityRouter.POST("copyAuthority", authorityApi.CopyAuthority) // 拷贝角色
|
||||
authorityRouter.POST("setDataAuthority", authorityApi.SetDataAuthority) // 设置角色资源权限
|
||||
}
|
||||
{
|
||||
authorityRouterWithoutRecord.POST("getAuthorityList", authorityApi.GetAuthorityList) // 获取角色列表
|
||||
}
|
||||
}
|
19
router/system/sys_authority_btn.go
Normal file
19
router/system/sys_authority_btn.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"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())
|
||||
authorityRouterWithoutRecord := Router.Group("authorityBtn")
|
||||
{
|
||||
authorityRouterWithoutRecord.POST("getAuthorityBtn", authorityBtnApi.GetAuthorityBtn)
|
||||
authorityRouterWithoutRecord.POST("setAuthorityBtn", authorityBtnApi.SetAuthorityBtn)
|
||||
authorityRouterWithoutRecord.POST("canRemoveAuthorityBtn", authorityBtnApi.CanRemoveAuthorityBtn)
|
||||
}
|
||||
}
|
40
router/system/sys_auto_code.go
Normal file
40
router/system/sys_auto_code.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type AutoCodeRouter struct{}
|
||||
|
||||
func (s *AutoCodeRouter) InitAutoCodeRouter(Router *gin.RouterGroup, RouterPublic *gin.RouterGroup) {
|
||||
autoCodeRouter := Router.Group("autoCode")
|
||||
publicAutoCodeRouter := RouterPublic.Group("autoCode")
|
||||
{
|
||||
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("addFunc", autoCodeTemplateApi.AddFunc) // 为代码插入方法
|
||||
}
|
||||
{
|
||||
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)
|
||||
publicAutoCodeRouter.POST("initMenu", autoCodePluginApi.InitMenu) // 同步插件菜单
|
||||
publicAutoCodeRouter.POST("initAPI", autoCodePluginApi.InitAPI) // 同步插件API
|
||||
}
|
||||
}
|
17
router/system/sys_auto_code_history.go
Normal file
17
router/system/sys_auto_code_history.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type AutoCodeHistoryRouter struct{}
|
||||
|
||||
func (s *AutoCodeRouter) InitAutoCodeHistoryRouter(Router *gin.RouterGroup) {
|
||||
autoCodeHistoryRouter := Router.Group("autoCode")
|
||||
{
|
||||
autoCodeHistoryRouter.POST("getMeta", autocodeHistoryApi.First) // 根据id获取meta信息
|
||||
autoCodeHistoryRouter.POST("rollback", autocodeHistoryApi.RollBack) // 回滚
|
||||
autoCodeHistoryRouter.POST("delSysHistory", autocodeHistoryApi.Delete) // 删除回滚记录
|
||||
autoCodeHistoryRouter.POST("getSysHistory", autocodeHistoryApi.GetList) // 获取回滚记录分页
|
||||
}
|
||||
}
|
16
router/system/sys_base.go
Normal file
16
router/system/sys_base.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type BaseRouter struct{}
|
||||
|
||||
func (s *BaseRouter) InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
|
||||
baseRouter := Router.Group("base")
|
||||
{
|
||||
baseRouter.POST("login", baseApi.Login)
|
||||
baseRouter.POST("captcha", baseApi.Captcha)
|
||||
}
|
||||
return baseRouter
|
||||
}
|
19
router/system/sys_casbin.go
Normal file
19
router/system/sys_casbin.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type CasbinRouter struct{}
|
||||
|
||||
func (s *CasbinRouter) InitCasbinRouter(Router *gin.RouterGroup) {
|
||||
casbinRouter := Router.Group("casbin").Use(middleware.OperationRecord())
|
||||
casbinRouterWithoutRecord := Router.Group("casbin")
|
||||
{
|
||||
casbinRouter.POST("updateCasbin", casbinApi.UpdateCasbin)
|
||||
}
|
||||
{
|
||||
casbinRouterWithoutRecord.POST("getPolicyPathByAuthorityId", casbinApi.GetPolicyPathByAuthorityId)
|
||||
}
|
||||
}
|
22
router/system/sys_dictionary.go
Normal file
22
router/system/sys_dictionary.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type DictionaryRouter struct{}
|
||||
|
||||
func (s *DictionaryRouter) InitSysDictionaryRouter(Router *gin.RouterGroup) {
|
||||
sysDictionaryRouter := Router.Group("sysDictionary").Use(middleware.OperationRecord())
|
||||
sysDictionaryRouterWithoutRecord := Router.Group("sysDictionary")
|
||||
{
|
||||
sysDictionaryRouter.POST("createSysDictionary", dictionaryApi.CreateSysDictionary) // 新建SysDictionary
|
||||
sysDictionaryRouter.DELETE("deleteSysDictionary", dictionaryApi.DeleteSysDictionary) // 删除SysDictionary
|
||||
sysDictionaryRouter.PUT("updateSysDictionary", dictionaryApi.UpdateSysDictionary) // 更新SysDictionary
|
||||
}
|
||||
{
|
||||
sysDictionaryRouterWithoutRecord.GET("findSysDictionary", dictionaryApi.FindSysDictionary) // 根据ID获取SysDictionary
|
||||
sysDictionaryRouterWithoutRecord.GET("getSysDictionaryList", dictionaryApi.GetSysDictionaryList) // 获取SysDictionary列表
|
||||
}
|
||||
}
|
22
router/system/sys_dictionary_detail.go
Normal file
22
router/system/sys_dictionary_detail.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type DictionaryDetailRouter struct{}
|
||||
|
||||
func (s *DictionaryDetailRouter) InitSysDictionaryDetailRouter(Router *gin.RouterGroup) {
|
||||
dictionaryDetailRouter := Router.Group("sysDictionaryDetail").Use(middleware.OperationRecord())
|
||||
dictionaryDetailRouterWithoutRecord := Router.Group("sysDictionaryDetail")
|
||||
{
|
||||
dictionaryDetailRouter.POST("createSysDictionaryDetail", dictionaryDetailApi.CreateSysDictionaryDetail) // 新建SysDictionaryDetail
|
||||
dictionaryDetailRouter.DELETE("deleteSysDictionaryDetail", dictionaryDetailApi.DeleteSysDictionaryDetail) // 删除SysDictionaryDetail
|
||||
dictionaryDetailRouter.PUT("updateSysDictionaryDetail", dictionaryDetailApi.UpdateSysDictionaryDetail) // 更新SysDictionaryDetail
|
||||
}
|
||||
{
|
||||
dictionaryDetailRouterWithoutRecord.GET("findSysDictionaryDetail", dictionaryDetailApi.FindSysDictionaryDetail) // 根据ID获取SysDictionaryDetail
|
||||
dictionaryDetailRouterWithoutRecord.GET("getSysDictionaryDetailList", dictionaryDetailApi.GetSysDictionaryDetailList) // 获取SysDictionaryDetail列表
|
||||
}
|
||||
}
|
34
router/system/sys_export_template.go
Normal file
34
router/system/sys_export_template.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type SysExportTemplateRouter struct {
|
||||
}
|
||||
|
||||
// InitSysExportTemplateRouter 初始化 导出模板 路由信息
|
||||
func (s *SysExportTemplateRouter) InitSysExportTemplateRouter(Router *gin.RouterGroup, pubRouter *gin.RouterGroup) {
|
||||
sysExportTemplateRouter := Router.Group("sysExportTemplate").Use(middleware.OperationRecord())
|
||||
sysExportTemplateRouterWithoutRecord := Router.Group("sysExportTemplate")
|
||||
sysExportTemplateRouterWithoutAuth := pubRouter.Group("sysExportTemplate")
|
||||
|
||||
{
|
||||
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) // 导入excel模板数据
|
||||
}
|
||||
{
|
||||
sysExportTemplateRouterWithoutRecord.GET("findSysExportTemplate", exportTemplateApi.FindSysExportTemplate) // 根据ID获取导出模板
|
||||
sysExportTemplateRouterWithoutRecord.GET("getSysExportTemplateList", exportTemplateApi.GetSysExportTemplateList) // 获取导出模板列表
|
||||
sysExportTemplateRouterWithoutRecord.GET("exportExcel", exportTemplateApi.ExportExcel) // 获取导出token
|
||||
sysExportTemplateRouterWithoutRecord.GET("exportTemplate", exportTemplateApi.ExportTemplate) // 导出表格模板
|
||||
}
|
||||
{
|
||||
sysExportTemplateRouterWithoutAuth.GET("exportExcelByToken", exportTemplateApi.ExportExcelByToken) // 通过token导出表格
|
||||
sysExportTemplateRouterWithoutAuth.GET("exportTemplateByToken", exportTemplateApi.ExportTemplateByToken) // 通过token导出模板
|
||||
}
|
||||
}
|
15
router/system/sys_initdb.go
Normal file
15
router/system/sys_initdb.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type InitRouter struct{}
|
||||
|
||||
func (s *InitRouter) InitInitRouter(Router *gin.RouterGroup) {
|
||||
initRouter := Router.Group("init")
|
||||
{
|
||||
initRouter.POST("initdb", dbApi.InitDB) // 初始化数据库
|
||||
initRouter.POST("checkdb", dbApi.CheckDB) // 检测是否需要初始化数据库
|
||||
}
|
||||
}
|
14
router/system/sys_jwt.go
Normal file
14
router/system/sys_jwt.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type JwtRouter struct{}
|
||||
|
||||
func (s *JwtRouter) InitJwtRouter(Router *gin.RouterGroup) {
|
||||
jwtRouter := Router.Group("jwt")
|
||||
{
|
||||
jwtRouter.POST("jsonInBlacklist", jwtApi.JsonInBlacklist) // jwt加入黑名单
|
||||
}
|
||||
}
|
27
router/system/sys_menu.go
Normal file
27
router/system/sys_menu.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type MenuRouter struct{}
|
||||
|
||||
func (s *MenuRouter) InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
|
||||
menuRouter := Router.Group("menu").Use(middleware.OperationRecord())
|
||||
menuRouterWithoutRecord := Router.Group("menu")
|
||||
{
|
||||
menuRouter.POST("addBaseMenu", authorityMenuApi.AddBaseMenu) // 新增菜单
|
||||
menuRouter.POST("addMenuAuthority", authorityMenuApi.AddMenuAuthority) // 增加menu和角色关联关系
|
||||
menuRouter.POST("deleteBaseMenu", authorityMenuApi.DeleteBaseMenu) // 删除菜单
|
||||
menuRouter.POST("updateBaseMenu", authorityMenuApi.UpdateBaseMenu) // 更新菜单
|
||||
}
|
||||
{
|
||||
menuRouterWithoutRecord.POST("getMenu", authorityMenuApi.GetMenu) // 获取菜单树
|
||||
menuRouterWithoutRecord.POST("getMenuList", authorityMenuApi.GetMenuList) // 分页获取基础menu列表
|
||||
menuRouterWithoutRecord.POST("getBaseMenuTree", authorityMenuApi.GetBaseMenuTree) // 获取用户动态路由
|
||||
menuRouterWithoutRecord.POST("getMenuAuthority", authorityMenuApi.GetMenuAuthority) // 获取指定角色menu
|
||||
menuRouterWithoutRecord.POST("getBaseMenuById", authorityMenuApi.GetBaseMenuById) // 根据id获取菜单
|
||||
}
|
||||
return menuRouter
|
||||
}
|
19
router/system/sys_operation_record.go
Normal file
19
router/system/sys_operation_record.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type OperationRecordRouter struct{}
|
||||
|
||||
func (s *OperationRecordRouter) InitSysOperationRecordRouter(Router *gin.RouterGroup) {
|
||||
operationRecordRouter := Router.Group("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列表
|
||||
|
||||
}
|
||||
}
|
25
router/system/sys_params.go
Normal file
25
router/system/sys_params.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type SysParamsRouter struct{}
|
||||
|
||||
// InitSysParamsRouter 初始化 参数 路由信息
|
||||
func (s *SysParamsRouter) InitSysParamsRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
|
||||
sysParamsRouter := Router.Group("sysParams").Use(middleware.OperationRecord())
|
||||
sysParamsRouterWithoutRecord := Router.Group("sysParams")
|
||||
{
|
||||
sysParamsRouter.POST("createSysParams", sysParamsApi.CreateSysParams) // 新建参数
|
||||
sysParamsRouter.DELETE("deleteSysParams", sysParamsApi.DeleteSysParams) // 删除参数
|
||||
sysParamsRouter.DELETE("deleteSysParamsByIds", sysParamsApi.DeleteSysParamsByIds) // 批量删除参数
|
||||
sysParamsRouter.PUT("updateSysParams", sysParamsApi.UpdateSysParams) // 更新参数
|
||||
}
|
||||
{
|
||||
sysParamsRouterWithoutRecord.GET("findSysParams", sysParamsApi.FindSysParams) // 根据ID获取参数
|
||||
sysParamsRouterWithoutRecord.GET("getSysParamsList", sysParamsApi.GetSysParamsList) // 获取参数列表
|
||||
sysParamsRouterWithoutRecord.GET("getSysParam", sysParamsApi.GetSysParam) // 根据Key获取参数
|
||||
}
|
||||
}
|
22
router/system/sys_system.go
Normal file
22
router/system/sys_system.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type SysRouter struct{}
|
||||
|
||||
func (s *SysRouter) InitSystemRouter(Router *gin.RouterGroup) {
|
||||
sysRouter := Router.Group("system").Use(middleware.OperationRecord())
|
||||
sysRouterWithoutRecord := Router.Group("system")
|
||||
|
||||
{
|
||||
sysRouter.POST("setSystemConfig", systemApi.SetSystemConfig) // 设置配置文件内容
|
||||
sysRouter.POST("reloadSystem", systemApi.ReloadSystem) // 重启服务
|
||||
}
|
||||
{
|
||||
sysRouterWithoutRecord.POST("getSystemConfig", systemApi.GetSystemConfig) // 获取配置文件内容
|
||||
sysRouterWithoutRecord.POST("getServerInfo", systemApi.GetServerInfo) // 获取服务器信息
|
||||
}
|
||||
}
|
28
router/system/sys_user.go
Normal file
28
router/system/sys_user.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type UserRouter struct{}
|
||||
|
||||
func (s *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
|
||||
userRouter := Router.Group("user").Use(middleware.OperationRecord())
|
||||
userRouterWithoutRecord := Router.Group("user")
|
||||
{
|
||||
userRouter.POST("admin_register", baseApi.Register) // 管理员注册账号
|
||||
userRouter.POST("changePassword", baseApi.ChangePassword) // 用户修改密码
|
||||
userRouter.POST("setUserAuthority", baseApi.SetUserAuthority) // 设置用户权限
|
||||
userRouter.DELETE("deleteUser", baseApi.DeleteUser) // 删除用户
|
||||
userRouter.PUT("setUserInfo", baseApi.SetUserInfo) // 设置用户信息
|
||||
userRouter.PUT("setSelfInfo", baseApi.SetSelfInfo) // 设置自身信息
|
||||
userRouter.POST("setUserAuthorities", baseApi.SetUserAuthorities) // 设置用户权限组
|
||||
userRouter.POST("resetPassword", baseApi.ResetPassword) // 设置用户权限组
|
||||
userRouter.PUT("setSelfSetting", baseApi.SetSelfSetting) // 用户界面配置
|
||||
}
|
||||
{
|
||||
userRouterWithoutRecord.POST("getUserList", baseApi.GetUserList) // 分页获取用户列表
|
||||
userRouterWithoutRecord.GET("getUserInfo", baseApi.GetUserInfo) // 获取自身信息
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user