From 1f192aca352616f5194e495468c6afe93216a71c Mon Sep 17 00:00:00 2001 From: yxh Date: Thu, 23 Sep 2021 17:33:43 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/vm/go/controller.template | 2 +- template/vm/go/service.template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/template/vm/go/controller.template b/template/vm/go/controller.template index ddc04c1..903d07c 100644 --- a/template/vm/go/controller.template +++ b/template/vm/go/controller.template @@ -151,7 +151,7 @@ func (c *{{$structName}}) Edit(r *ghttp.Request) { // Delete 删除 func (c *{{$structName}}) Delete(r *ghttp.Request) { - ids := r.Get{{$.table.PkColumn.GoType | CaseCamel}}s("ids") + ids := r.GetInts("ids") err := service.{{.table.ClassName}}.DeleteByIds(r.GetCtx(),ids) if err != nil { c.FailJsonExit(r, err.Error()) diff --git a/template/vm/go/service.template b/template/vm/go/service.template index 7780ff9..705cfc2 100644 --- a/template/vm/go/service.template +++ b/template/vm/go/service.template @@ -219,7 +219,7 @@ func (s *{{$structName}}) Edit(ctx context.Context,req *dao.{{.table.ClassName}} // DeleteByIds 删除 -func (s *{{$structName}}) DeleteByIds(ctx context.Context,ids []{{$.table.PkColumn.GoType}}) (err error) { +func (s *{{$structName}}) DeleteByIds(ctx context.Context,ids []int) (err error) { if len(ids) == 0 { err = gerror.New("参数错误") return @@ -253,7 +253,7 @@ func (s *{{$structName}}) Change{{$column.GoField}}(ctx context.Context,req *dao {{if eq .table.TplCategory "tree"}} // GetChildrenIds 通过ID获取子级ID -func (s *{{$structName}})GetChildrenIds(ctx context.Context,ids []{{$.table.PkColumn.GoType}}) ([]{{$.table.PkColumn.GoType}}, error) { +func (s *{{$structName}})GetChildrenIds(ctx context.Context,ids []int) ([]int, error) { //获取所有 _,_,all, err := s.GetList(&dao.{{.table.ClassName}}SearchReq{PageReq:comModel.PageReq{Ctx: ctx}}) if err != nil {