Merge pull request #188 from jiang4869/master

完善分页开关
master
xxj 3 years ago committed by GitHub
commit 8a133e0318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -258,6 +258,7 @@ func (obj *_{{$obj.StructName}}Mgr) GetByOptions(opts ...Option) (results []*{{$
return return
} }
{{if $obj.IsOutPage}}
// SelectPage 分页查询 // SelectPage 分页查询
func (obj *_{{$obj.StructName}}Mgr) SelectPage(page IPage,opts ...Option) (resultPage IPage, err error) { func (obj *_{{$obj.StructName}}Mgr) SelectPage(page IPage,opts ...Option) (resultPage IPage, err error) {
options := options{ options := options{
@ -280,6 +281,7 @@ func (obj *_{{$obj.StructName}}Mgr) SelectPage(page IPage,opts ...Option) (resul
resultPage.SetRecords(results) resultPage.SetRecords(results)
return return
} }
{{end}}
//////////////////////////enume case //////////////////////////////////////////// //////////////////////////enume case ////////////////////////////////////////////
@ -350,7 +352,7 @@ func (obj *_{{$obj.StructName}}Mgr) GetBatchFrom{{$oem.ColStructName}}({{CapLowe
} {{end}} {{end}} } {{end}} {{end}}
} }
}` }`
genPage = `package {{.PackageName}} genPage = `package {{.PackageName}}
import ( import (
"fmt" "fmt"

@ -117,6 +117,7 @@ type funDef struct {
Em []EmInfo // index 列表 Em []EmInfo // index 列表
Primary []FList // primary unique Primary []FList // primary unique
Index []FList // index Index []FList // index
IsOutPage bool // 是否开启分页
} }
// //

@ -349,6 +349,7 @@ func (m *_Model) generateFunc() (genOut []GenOutInfo) {
// wxw 2021.2.26 17:17 // wxw 2021.2.26 17:17
var data funDef var data funDef
data.TableName = tab.Name data.TableName = tab.Name
data.IsOutPage = config.GetIsOutPage() // 添加分页开关
tab.Name = getTableNameWithPrefix(tab.Name) tab.Name = getTableNameWithPrefix(tab.Name)
data.StructName = getCamelName(tab.Name) data.StructName = getCamelName(tab.Name)

Loading…
Cancel
Save