|
@@ -165,7 +165,7 @@ func (s *{{$structName}}) GetList(req *dao.{{.table.ClassName}}SearchReq) (total
|
|
|
|
|
|
|
|
|
|
|
|
|
// GetInfoById 通过id获取
|
|
// GetInfoById 通过id获取
|
|
|
-func (s *{{$structName}}) GetInfoById(ctx context.Context,id int64) (info *dao.{{.table.ClassName}}InfoRes, err error) {
|
|
|
|
|
|
|
+func (s *{{$structName}}) GetInfoById(ctx context.Context,id {{$.table.PkColumn.GoType}}) (info *dao.{{.table.ClassName}}InfoRes, err error) {
|
|
|
if id == 0 {
|
|
if id == 0 {
|
|
|
err = gerror.New("参数错误")
|
|
err = gerror.New("参数错误")
|
|
|
return
|
|
return
|
|
@@ -218,7 +218,7 @@ func (s *{{$structName}}) Edit(ctx context.Context,req *dao.{{.table.ClassName}}
|
|
|
|
|
|
|
|
|
|
|
|
|
// DeleteByIds 删除
|
|
// DeleteByIds 删除
|
|
|
-func (s *{{$structName}}) DeleteByIds(ctx context.Context,ids []int) (err error) {
|
|
|
|
|
|
|
+func (s *{{$structName}}) DeleteByIds(ctx context.Context,ids []{{$.table.PkColumn.GoType}}) (err error) {
|
|
|
if len(ids) == 0 {
|
|
if len(ids) == 0 {
|
|
|
err = gerror.New("参数错误")
|
|
err = gerror.New("参数错误")
|
|
|
return
|
|
return
|
|
@@ -252,7 +252,7 @@ func (s *{{$structName}}) Change{{$column.GoField}}(ctx context.Context,req *dao
|
|
|
|
|
|
|
|
{{if eq .table.TplCategory "tree"}}
|
|
{{if eq .table.TplCategory "tree"}}
|
|
|
// GetChildrenIds 通过ID获取子级ID
|
|
// GetChildrenIds 通过ID获取子级ID
|
|
|
-func (s *{{$structName}})GetChildrenIds(ctx context.Context,ids []int) ([]int, error) {
|
|
|
|
|
|
|
+func (s *{{$structName}})GetChildrenIds(ctx context.Context,ids []{{$.table.PkColumn.GoType}}) ([]{{$.table.PkColumn.GoType}}, error) {
|
|
|
//获取所有
|
|
//获取所有
|
|
|
_,_,all, err := s.GetList(&dao.{{.table.ClassName}}SearchReq{PageReq:comModel.PageReq{Ctx: ctx}})
|
|
_,_,all, err := s.GetList(&dao.{{.table.ClassName}}SearchReq{PageReq:comModel.PageReq{Ctx: ctx}})
|
|
|
if err != nil {
|
|
if err != nil {
|