✨ Init
This commit is contained in:
		
							
								
								
									
										8
									
								
								router/app/enter.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								router/app/enter.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| package app | ||||
|  | ||||
| type RouterGroup struct { | ||||
| 	UserRouter | ||||
| 	LoginRouter | ||||
| 	FavoriteRouter | ||||
| 	VisionRouter | ||||
| } | ||||
							
								
								
									
										21
									
								
								router/app/favorite.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								router/app/favorite.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| package app | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type FavoriteRouter struct{} | ||||
|  | ||||
| func (s *FavoriteRouter) InitFavoriteRouter(Router *gin.RouterGroup) { | ||||
| 	favoriteRouter := Router.Group("favorite").Use(middleware.AuthorizeToken()) | ||||
| 	//publicRouter := Router.Group("user") | ||||
| 	baseApi := v1.ApiGroupApp.AppApiGroup.FavoriteApi | ||||
| 	{ | ||||
| 		favoriteRouter.POST("", baseApi.Create) | ||||
| 		favoriteRouter.DELETE("", baseApi.Delete) | ||||
| 		favoriteRouter.GET("list", baseApi.GetList) | ||||
| 	} | ||||
|  | ||||
| } | ||||
							
								
								
									
										20
									
								
								router/app/login.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								router/app/login.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| package app | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| type LoginRouter struct{} | ||||
|  | ||||
| func (s *LoginRouter) InitLoginRouter(Router *gin.RouterGroup) { | ||||
| 	loginRouter := Router.Group("login") | ||||
| 	baseApi := v1.ApiGroupApp.AppApiGroup.LoginApi | ||||
| 	{ | ||||
| 		loginRouter.GET("wechat/token", baseApi.GetWeChatToken) | ||||
| 		loginRouter.POST("token", baseApi.Login) | ||||
| 		loginRouter.POST("token/refresh", baseApi.Refresh) | ||||
| 		loginRouter.POST("token/logout", baseApi.Logout) | ||||
| 	} | ||||
|  | ||||
| } | ||||
							
								
								
									
										30
									
								
								router/app/user.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								router/app/user.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| package app | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type UserRouter struct { | ||||
| } | ||||
|  | ||||
| func (s *LoginRouter) InitUserRouter(Router *gin.RouterGroup) { | ||||
| 	userRouter := Router.Group("user").Use(middleware.AuthorizeToken()) | ||||
| 	//publicRouter := Router.Group("user") | ||||
| 	baseApi := v1.ApiGroupApp.AppApiGroup.UserApi | ||||
| 	filrApi := v1.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi | ||||
| 	todoApi := v1.ApiGroupApp.AppApiGroup.TodosApi | ||||
| 	{ | ||||
| 		userRouter.POST("upload", filrApi.UploadFile) | ||||
| 		userRouter.POST("binding/wechat", baseApi.BindingWeChat) | ||||
| 		userRouter.PUT("info", baseApi.UpdateUser) | ||||
| 		userRouter.GET("info", baseApi.GetInfo) | ||||
| 		userRouter.PUT("hospital", baseApi.UpdateUserHospital) | ||||
| 		userRouter.GET("", baseApi.GetUser) | ||||
| 		userRouter.GET("todo", todoApi.GetUserTodos) | ||||
| 		userRouter.PUT("todo", todoApi.UpdateTodo) | ||||
|  | ||||
| 	} | ||||
|  | ||||
| } | ||||
							
								
								
									
										21
									
								
								router/app/vision.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								router/app/vision.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| package app | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type VisionRouter struct{} | ||||
|  | ||||
| func (s *VisionRouter) InitVisionRouter(Router *gin.RouterGroup) { | ||||
| 	userRouter := Router.Group("vision").Use(middleware.AuthorizeToken()) | ||||
| 	//publicRouter := Router.Group("user") | ||||
| 	baseApi := v1.ApiGroupApp.AppApiGroup.VisionApi | ||||
| 	{ | ||||
| 		userRouter.GET("", baseApi.GetList) | ||||
| 		userRouter.POST("", baseApi.Create) | ||||
|  | ||||
| 	} | ||||
|  | ||||
| } | ||||
							
								
								
									
										15
									
								
								router/enter.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								router/enter.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| package router | ||||
|  | ||||
| import ( | ||||
| 	"miniapp/router/app" | ||||
| 	"miniapp/router/example" | ||||
| 	"miniapp/router/system" | ||||
| ) | ||||
|  | ||||
| type RouterGroup struct { | ||||
| 	System  system.RouterGroup | ||||
| 	Example example.RouterGroup | ||||
| 	App     app.RouterGroup | ||||
| } | ||||
|  | ||||
| var RouterGroupApp = new(RouterGroup) | ||||
							
								
								
									
										6
									
								
								router/example/enter.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								router/example/enter.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| package example | ||||
|  | ||||
| type RouterGroup struct { | ||||
| 	CustomerRouter | ||||
| 	FileUploadAndDownloadRouter | ||||
| } | ||||
							
								
								
									
										24
									
								
								router/example/exa_customer.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								router/example/exa_customer.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| package example | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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)    // 更新客户 | ||||
| 		customerRouter.DELETE("customer", exaCustomerApi.DeleteExaCustomer) // 删除客户 | ||||
| 	} | ||||
| 	{ | ||||
| 		customerRouterWithoutRecord.GET("customer", exaCustomerApi.GetExaCustomer)         // 获取单一客户信息 | ||||
| 		customerRouterWithoutRecord.GET("customerList", exaCustomerApi.GetExaCustomerList) // 获取客户列表 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										23
									
								
								router/example/exa_file_upload_and_download.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								router/example/exa_file_upload_and_download.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| package example | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| 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)                           // 获取上传文件列表 | ||||
| 		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)                           // 删除切片 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										28
									
								
								router/system/article.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								router/system/article.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type ArticleRouter struct { | ||||
| } | ||||
|  | ||||
| // InitArticleRouter 注册Banner路由 | ||||
| func (s *BannerRouter) InitArticleRouter(Router *gin.RouterGroup) { | ||||
| 	articleRouter := Router.Group("article").Use(middleware.OperationRecord()).Use(middleware.JWTAuth()) | ||||
| 	publicRouter := Router.Group("article") | ||||
| 	bannerApi := v1.ApiGroupApp.SystemApiGroup.ArticleApi | ||||
|  | ||||
| 	{ | ||||
| 		articleRouter.POST("", bannerApi.CreateArticle)   // 新建文章 | ||||
| 		articleRouter.DELETE("", bannerApi.DeleteArticle) // 删除文章 | ||||
| 		articleRouter.PUT("", bannerApi.UpdateArticle)    // 更新文章 | ||||
|  | ||||
| 	} | ||||
| 	{ | ||||
| 		publicRouter.GET("list", bannerApi.GetArticleList) // 获取医院列表 | ||||
| 		publicRouter.GET(":id", bannerApi.GetArticleById)  // 获取单条医院消息 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										28
									
								
								router/system/banner.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								router/system/banner.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type BannerRouter struct { | ||||
| } | ||||
|  | ||||
| // InitBannerRouter 注册Banner路由 | ||||
| func (s *BannerRouter) InitBannerRouter(Router *gin.RouterGroup) { | ||||
| 	hospitalRouter := Router.Group("banner").Use(middleware.OperationRecord()).Use(middleware.JWTAuth()) | ||||
| 	publicRouter := Router.Group("banner") | ||||
| 	bannerApi := v1.ApiGroupApp.SystemApiGroup.BannerApi | ||||
|  | ||||
| 	{ | ||||
| 		hospitalRouter.POST("", bannerApi.CreateBanner)   // 创建医院 | ||||
| 		hospitalRouter.DELETE("", bannerApi.DeleteBanner) // 删除医院 | ||||
| 		hospitalRouter.PUT("", bannerApi.UpdateBanner)    // 更新医院 | ||||
|  | ||||
| 	} | ||||
| 	{ | ||||
| 		publicRouter.GET("list", bannerApi.GetBannerList) // 获取医院列表 | ||||
| 		publicRouter.GET(":id", bannerApi.GetBannerById)  // 获取单条医院消息 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										22
									
								
								router/system/enter.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								router/system/enter.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| package system | ||||
|  | ||||
| type RouterGroup struct { | ||||
| 	ApiRouter | ||||
| 	JwtRouter | ||||
| 	SysRouter | ||||
| 	BaseRouter | ||||
| 	InitRouter | ||||
| 	MenuRouter | ||||
| 	UserRouter | ||||
| 	CasbinRouter | ||||
| 	AutoCodeRouter | ||||
| 	AuthorityRouter | ||||
| 	DictionaryRouter | ||||
| 	OperationRecordRouter | ||||
| 	DictionaryDetailRouter | ||||
| 	AuthorityBtnRouter | ||||
| 	ChatGptRouter | ||||
| 	HospitalRouter | ||||
| 	BannerRouter | ||||
| 	ArticleRouter | ||||
| } | ||||
							
								
								
									
										28
									
								
								router/system/hospital.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								router/system/hospital.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type HospitalRouter struct { | ||||
| } | ||||
|  | ||||
| // InitHospitalRouter 注册医院路由 | ||||
| func (s *RouterGroup) InitHospitalRouter(Router *gin.RouterGroup) { | ||||
| 	hospitalRouter := Router.Group("hospital").Use(middleware.OperationRecord()).Use(middleware.JWTAuth()) | ||||
| 	publicRouter := Router.Group("hospital") | ||||
| 	hospitalApi := v1.ApiGroupApp.SystemApiGroup.HospitalApi | ||||
|  | ||||
| 	{ | ||||
| 		hospitalRouter.POST("", hospitalApi.CreateHospital)   // 创建医院 | ||||
| 		hospitalRouter.DELETE("", hospitalApi.DeleteHospital) // 删除医院 | ||||
| 		hospitalRouter.PUT("", hospitalApi.UpdateHospital)    // 更新医院 | ||||
|  | ||||
| 	} | ||||
| 	{ | ||||
| 		publicRouter.GET("list", hospitalApi.GetHospitalList) // 获取医院列表 | ||||
| 		publicRouter.GET(":id", hospitalApi.GetHospitalById)  // 获取单条医院消息 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										31
									
								
								router/system/sys_api.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								router/system/sys_api.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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") | ||||
| 	apiRouterApi := v1.ApiGroupApp.SystemApiGroup.SystemApiApi | ||||
| 	{ | ||||
| 		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权限 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										25
									
								
								router/system/sys_authority.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								router/system/sys_authority.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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)   // 删除角色 | ||||
| 		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" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| type AuthorityBtnRouter struct{} | ||||
|  | ||||
| func (s *AuthorityBtnRouter) InitAuthorityBtnRouterRouter(Router *gin.RouterGroup) { | ||||
| 	//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) | ||||
| 		authorityRouterWithoutRecord.POST("canRemoveAuthorityBtn", authorityBtnApi.CanRemoveAuthorityBtn) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										26
									
								
								router/system/sys_auto_code.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								router/system/sys_auto_code.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| type AutoCodeRouter struct{} | ||||
|  | ||||
| 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("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)             // 打包插件 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										19
									
								
								router/system/sys_auto_code_history.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								router/system/sys_auto_code_history.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| 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) // 获取回滚记录分页 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										18
									
								
								router/system/sys_base.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								router/system/sys_base.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| 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) | ||||
| 	} | ||||
| 	return baseRouter | ||||
| } | ||||
							
								
								
									
										21
									
								
								router/system/sys_casbin.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								router/system/sys_casbin.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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) | ||||
| 	} | ||||
| 	{ | ||||
| 		casbinRouterWithoutRecord.POST("getPolicyPathByAuthorityId", casbinApi.GetPolicyPathByAuthorityId) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										20
									
								
								router/system/sys_chatgpt.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								router/system/sys_chatgpt.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type ChatGptRouter struct{} | ||||
|  | ||||
| func (s *ChatGptRouter) InitChatGptRouter(Router *gin.RouterGroup) { | ||||
| 	chatGptRouter := Router.Group("chatGpt").Use(middleware.OperationRecord()) | ||||
| 	chatGptApi := v1.ApiGroupApp.SystemApiGroup.ChatGptApi | ||||
| 	{ | ||||
| 		chatGptRouter.POST("createSK", chatGptApi.CreateSK) | ||||
| 		chatGptRouter.GET("getSK", chatGptApi.GetSK) | ||||
| 		chatGptRouter.DELETE("deleteSK", chatGptApi.DeleteSK) | ||||
| 		chatGptRouter.POST("getTable", chatGptApi.GetTable) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										24
									
								
								router/system/sys_dictionary.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								router/system/sys_dictionary.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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 | ||||
| 	} | ||||
| 	{ | ||||
| 		sysDictionaryRouterWithoutRecord.GET("findSysDictionary", sysDictionaryApi.FindSysDictionary)       // 根据ID获取SysDictionary | ||||
| 		sysDictionaryRouterWithoutRecord.GET("getSysDictionaryList", sysDictionaryApi.GetSysDictionaryList) // 获取SysDictionary列表 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										24
									
								
								router/system/sys_dictionary_detail.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								router/system/sys_dictionary_detail.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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 | ||||
| 	} | ||||
| 	{ | ||||
| 		dictionaryDetailRouterWithoutRecord.GET("findSysDictionaryDetail", sysDictionaryDetailApi.FindSysDictionaryDetail)       // 根据ID获取SysDictionaryDetail | ||||
| 		dictionaryDetailRouterWithoutRecord.GET("getSysDictionaryDetailList", sysDictionaryDetailApi.GetSysDictionaryDetailList) // 获取SysDictionaryDetail列表 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										17
									
								
								router/system/sys_initdb.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								router/system/sys_initdb.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| 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) // 检测是否需要初始化数据库 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										16
									
								
								router/system/sys_jwt.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								router/system/sys_jwt.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| 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加入黑名单 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										29
									
								
								router/system/sys_menu.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								router/system/sys_menu.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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和角色关联关系 | ||||
| 		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 | ||||
| } | ||||
							
								
								
									
										21
									
								
								router/system/sys_operation_record.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								router/system/sys_operation_record.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| 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列表 | ||||
|  | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										20
									
								
								router/system/sys_system.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								router/system/sys_system.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type SysRouter struct{} | ||||
|  | ||||
| func (s *SysRouter) InitSystemRouter(Router *gin.RouterGroup) { | ||||
| 	sysRouter := Router.Group("system").Use(middleware.OperationRecord()) | ||||
| 	systemApi := v1.ApiGroupApp.SystemApiGroup.SystemApi | ||||
| 	{ | ||||
| 		sysRouter.POST("getSystemConfig", systemApi.GetSystemConfig) // 获取配置文件内容 | ||||
| 		sysRouter.POST("setSystemConfig", systemApi.SetSystemConfig) // 设置配置文件内容 | ||||
| 		sysRouter.POST("getServerInfo", systemApi.GetServerInfo)     // 获取服务器信息 | ||||
| 		sysRouter.POST("reloadSystem", systemApi.ReloadSystem)       // 重启服务 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										29
									
								
								router/system/sys_user.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								router/system/sys_user.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| package system | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| 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)         // 用户修改密码 | ||||
| 		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)           // 设置用户权限组 | ||||
| 	} | ||||
| 	{ | ||||
| 		userRouterWithoutRecord.POST("getUserList", baseApi.GetUserList) // 分页获取用户列表 | ||||
| 		userRouterWithoutRecord.GET("getUserInfo", baseApi.GetUserInfo)  // 获取自身信息 | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user