Files
PandaX/apps/system/router/tenant.go
2022-07-14 18:01:54 +08:00

47 lines
1.3 KiB
Go

package router
/**
* @Description
* @Author 熊猫
* @Date 2022/7/14 17:52
**/
import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
)
func InitSysTenantRouter(router *gin.RouterGroup) {
s := &api.SysTenantsApi{
SysTenantsApp: services.SysTenantModelDao,
}
routerGroup := router.Group("SysTenant")
SysTenantListLog := ctx.NewLogInfo("获取SysTenant分页列表")
routerGroup.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(SysTenantListLog).Handle(s.GetSysTenantsList)
})
SysTenantLog := ctx.NewLogInfo("获取SysTenant信息")
routerGroup.GET(":tenantId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(SysTenantLog).Handle(s.GetSysTenants)
})
insertSysTenantLog := ctx.NewLogInfo("添加SysTenant信息")
routerGroup.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertSysTenantLog).Handle(s.InsertSysTenants)
})
updateSysTenantLog := ctx.NewLogInfo("修改SysTenant信息")
routerGroup.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateSysTenantLog).Handle(s.UpdateSysTenants)
})
deleteSysTenantLog := ctx.NewLogInfo("删除SysTenant信息")
routerGroup.DELETE(":tenantId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteSysTenantLog).Handle(s.DeleteSysTenants)
})
}