Skip to content

Commit

Permalink
完善分页开关
Browse files Browse the repository at this point in the history
  • Loading branch information
jiang4869 committed Jan 4, 2022
1 parent 1278831 commit dbd29c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data/view/genfunc/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ func (obj *_{{$obj.StructName}}Mgr) GetByOptions(opts ...Option) (results []*{{$
return
}
{{if $obj.IsOutPage}}
// SelectPage 分页查询
func (obj *_{{$obj.StructName}}Mgr) SelectPage(page IPage,opts ...Option) (resultPage IPage, err error) {
options := options{
Expand All @@ -280,6 +281,7 @@ func (obj *_{{$obj.StructName}}Mgr) SelectPage(page IPage,opts ...Option) (resul
resultPage.SetRecords(results)
return
}
{{end}}
//////////////////////////enume case ////////////////////////////////////////////
Expand Down Expand Up @@ -350,7 +352,7 @@ func (obj *_{{$obj.StructName}}Mgr) GetBatchFrom{{$oem.ColStructName}}({{CapLowe
} {{end}} {{end}}
}
}`
genPage = `package {{.PackageName}}
genPage = `package {{.PackageName}}
import (
"fmt"
Expand Down
1 change: 1 addition & 0 deletions data/view/model/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ type funDef struct {
Em []EmInfo // index 列表
Primary []FList // primary unique
Index []FList // index
IsOutPage bool // 是否开启分页
}

//
1 change: 1 addition & 0 deletions data/view/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ func (m *_Model) generateFunc() (genOut []GenOutInfo) {
// wxw 2021.2.26 17:17
var data funDef
data.TableName = tab.Name
data.IsOutPage = config.GetIsOutPage() // 添加分页开关
tab.Name = getTableNameWithPrefix(tab.Name)

data.StructName = getCamelName(tab.Name)
Expand Down

0 comments on commit dbd29c8

Please sign in to comment.