Files
PandaX/apps/develop/router/table.go
XM-GO 332d7721c9 Merge branch 'iot'
# Conflicts:
#	apps/develop/api/gen.go
#	apps/develop/api/table.go
#	apps/develop/router/gen.go
#	apps/develop/router/table.go
#	apps/job/api/job.go
#	apps/job/entity/job.go
#	apps/job/entity/log_job.go
#	apps/job/jobs/jobbase.go
#	apps/job/router/job.go
#	apps/log/api/log_job.go
#	apps/log/api/log_login.go
#	apps/log/api/log_oper.go
#	apps/log/router/log.go
#	apps/log/services/log_job.go
#	apps/resource/api/email.go
#	apps/resource/api/oss.go
#	apps/resource/router/email.go
#	apps/resource/router/oss.go
#	apps/system/api/api.go
#	apps/system/api/config.go
#	apps/system/api/dept.go
#	apps/system/api/dict.go
#	apps/system/api/menu.go
#	apps/system/api/notice.go
#	apps/system/api/post.go
#	apps/system/api/role.go
#	apps/system/api/system.go
#	apps/system/api/tenant.go
#	apps/system/api/user.go
#	apps/system/router/api.go
#	apps/system/router/config.go
#	apps/system/router/dept.go
#	apps/system/router/dict.go
#	apps/system/router/menu.go
#	apps/system/router/notice.go
#	apps/system/router/post.go
#	apps/system/router/role.go
#	apps/system/router/tenant.go
#	apps/system/router/user.go
#	go.mod
#	go.sum
#	main.go
#	pkg/config/app.go
#	pkg/config/casbin.go
#	pkg/config/config.go
#	pkg/config/db.go
#	pkg/config/gen.go
#	pkg/config/jwt.go
#	pkg/config/log.go
#	pkg/config/redis.go
#	pkg/config/server.go
#	pkg/global/global.go
#	pkg/initialize/table.go
#	pkg/middleware/log.go
#	pkg/middleware/oper.go
#	pkg/middleware/permission.go
#	resource/template/go/api.template
#	resource/template/go/router.template
#	resource/template/go/service.template
2023-08-22 15:47:45 +08:00

49 lines
1.3 KiB
Go

package router
import (
"github.com/gin-gonic/gin"
"pandax/apps/develop/api"
"pandax/apps/develop/services"
"pandax/base/ginx"
)
func InitGenTableRouter(router *gin.RouterGroup) {
// 登录日志
genApi := &api.GenTableApi{
GenTableApp: services.DevGenTableModelDao,
}
gen := router.Group("table")
gen.GET("/db/list", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("获取数据库列表").Handle(genApi.GetDBTableList)
})
gen.GET("list", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("获取表列表").Handle(genApi.GetTablePage)
})
gen.GET("/info/tableName", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("获取表信息By tableName").Handle(genApi.GetTableInfoByName)
})
gen.GET("info/:tableId", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("获取表信息").Handle(genApi.GetTableInfo)
})
gen.GET("tableTree", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("获取表树").Handle(genApi.GetTableTree)
})
gen.POST("", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("新增表").Handle(genApi.Insert)
})
gen.PUT("", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("修改表").Handle(genApi.Update)
})
gen.DELETE(":tableId", func(c *gin.Context) {
ginx.NewReqCtx(c).WithLog("删除表").Handle(genApi.Delete)
})
}