From 4182bac3a2206e0b232e48a3d6d9b2624acee94d Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Wed, 24 Mar 2021 22:20:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E7=89=88=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=9F=E6=88=90=E7=9A=84swagger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/no_actions/apis.go.template | 11 +++++------ template/v4/no_actions/router_check_role.go.template | 4 ++-- .../v4/no_actions/router_no_check_role.go.template | 4 ++-- template/v4/no_actions/service.go.template | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/template/v4/no_actions/apis.go.template b/template/v4/no_actions/apis.go.template index 71848762..ae09942d 100644 --- a/template/v4/no_actions/apis.go.template +++ b/template/v4/no_actions/apis.go.template @@ -7,9 +7,9 @@ import ( "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user" _ "github.com/go-admin-team/go-admin-core/sdk/pkg/response" - "go-admin/app/admin/models" - "go-admin/app/admin/service" - "go-admin/app/admin/service/dto" + "go-admin/app/{{.PackageName}}/models" + "go-admin/app/{{.PackageName}}/service" + "go-admin/app/{{.PackageName}}/service/dto" "go-admin/common/actions" "go-admin/common/apis" ) @@ -209,10 +209,9 @@ func (e *{{.ClassName}}) Update{{.ClassName}}(c *gin.Context) { // @Summary 删除{{.TableComment}} // @Description 删除{{.TableComment}} // @Tags {{.TableComment}} -// @Param id path int false "id" -// @Param ids body string false "ids" +// @Param ids body []int false "ids" // @Success 200 {object} response.Response "{"code": 200, "message": "删除成功"}" -// @Router /api/v1/{{.ModuleName}}/{id} [delete] +// @Router /api/v1/{{.ModuleName}} [delete] // Delete{{.ClassName}} 删除{{.TableComment}} func (e *{{.ClassName}}) Delete{{.ClassName}}(c *gin.Context) { log := e.GetLogger(c) diff --git a/template/v4/no_actions/router_check_role.go.template b/template/v4/no_actions/router_check_role.go.template index 1ffd2663..d8066c17 100644 --- a/template/v4/no_actions/router_check_role.go.template +++ b/template/v4/no_actions/router_check_role.go.template @@ -4,7 +4,7 @@ import ( "github.com/gin-gonic/gin" jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" - "go-admin/app/admin/apis/{{.ModuleName}}" + "go-admin/app/{{.PackageName}}/apis/{{.ModuleName}}" "go-admin/common/middleware" ) @@ -23,4 +23,4 @@ func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJW r.PUT("/:id", api.Update{{.ClassName}}) r.DELETE("", api.Delete{{.ClassName}}) } -} \ No newline at end of file +} diff --git a/template/v4/no_actions/router_no_check_role.go.template b/template/v4/no_actions/router_no_check_role.go.template index 20e02ec4..46f09aa8 100644 --- a/template/v4/no_actions/router_no_check_role.go.template +++ b/template/v4/no_actions/router_no_check_role.go.template @@ -4,7 +4,7 @@ import ( "github.com/gin-gonic/gin" jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" - "go-admin/app/admin/apis/{{.ModuleName}}" + "go-admin/app/{{.PackageName}}/apis/{{.ModuleName}}" ) func init() { @@ -22,4 +22,4 @@ func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJW r.PUT("/:id", api.Update{{.ClassName}}) r.DELETE("", api.Delete{{.ClassName}}) } -} \ No newline at end of file +} diff --git a/template/v4/no_actions/service.go.template b/template/v4/no_actions/service.go.template index 7ed5ca8e..943a3ea7 100644 --- a/template/v4/no_actions/service.go.template +++ b/template/v4/no_actions/service.go.template @@ -5,10 +5,10 @@ import ( "gorm.io/gorm" - "go-admin/app/admin/models" + "go-admin/app/{{.PackageName}}/models" "go-admin/common/actions" cDto "go-admin/common/dto" - "go-admin/app/admin/service/dto" + "go-admin/app/{{.PackageName}}/service/dto" "go-admin/common/service" )