chore🔧: remove the code generator's unused actions templates

template/v4/actions held router templates for an actions mode the
generator never had: gen.go only ever loads the no_actions templates,
nothing reads sys_tables.is_actions, and the two files referenced
XxxSearch, XxxControl and XxxById request types that the DTO template
does not generate, so their output could not have compiled.
This commit is contained in:
zhangwenjian
2026-09-27 20:49:58 +08:00
parent f8cbb3a5b3
commit 01535f49b6
2 changed files with 0 additions and 61 deletions
@@ -1,31 +0,0 @@
package router
import (
"github.com/gin-gonic/gin"
jwt "github.com/go-admin-team/go-admin-core/v2/jwtauth"
"go-admin/app/{{.PackageName}}/models"
"go-admin/app/{{.PackageName}}/service/dto"
"go-admin/common/actions"
"go-admin/common/middleware"
)
func init() {
routerCheckRole = append(routerCheckRole, register{{.ClassName}}Router)
}
// 需认证的路由代码
func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
r := v1.Group("/{{.ModuleName}}").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
{
model := &models.{{.ClassName}}{}
r.GET("", actions.PermissionAction(), actions.IndexAction(model, new(dto.{{.ClassName}}Search), func() interface{} {
list := make([]models.{{.ClassName}}, 0)
return &list
}))
r.GET("/:id", actions.PermissionAction(), actions.ViewAction(new(dto.{{.ClassName}}ById), nil))
r.POST("", actions.CreateAction(new(dto.{{.ClassName}}Control)))
r.PUT("/:id", actions.PermissionAction(), actions.UpdateAction(new(dto.{{.ClassName}}Control)))
r.DELETE("", actions.PermissionAction(), actions.DeleteAction(new(dto.{{.ClassName}}ById)))
}
}
@@ -1,30 +0,0 @@
package router
import (
"github.com/gin-gonic/gin"
"go-admin/app/{{.PackageName}}/middleware"
"go-admin/app/{{.PackageName}}/models"
"go-admin/app/{{.PackageName}}/service/dto"
"go-admin/common/actions"
)
func init() {
routerNoCheckRole = append(routerNoCheckRole, register{{.ClassName}}Router)
}
// 无需认证的路由代码
func register{{.ClassName}}Router(v1 *gin.RouterGroup) {
r := v1.Group("/{{.ModuleName}}")
{
model := &models.{{.ClassName}}{}
r.GET("", actions.IndexAction(model, new(dto.{{.ClassName}}Search), func() interface{} {
list := make([]models.{{.ClassName}}, 0)
return &list
}))
r.GET("/:id", actions.ViewAction(new(dto.{{.ClassName}}ById), nil))
r.POST("", actions.CreateAction(new(dto.{{.ClassName}}Control)))
r.PUT("/:id", actions.UpdateAction(new(dto.{{.ClassName}}Control)))
r.DELETE("", actions.DeleteAction(new(dto.{{.ClassName}}ById)))
}
}