Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
81d7873c
Commit
81d7873c
authored
1 year ago
by
ko_oler
Browse files
Options
Downloads
Patches
Plain Diff
- правка в условие в MergePaginationOptions
- правка в BatchProcessor
parent
f4d2c83d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/items/pagination.go
+5
-5
5 additions, 5 deletions
pkg/items/pagination.go
pkg/options/options.go
+1
-1
1 addition, 1 deletion
pkg/options/options.go
with
6 additions
and
6 deletions
pkg/items/pagination.go
+
5
−
5
View file @
81d7873c
...
@@ -16,7 +16,7 @@ type BatchProcessor struct {
...
@@ -16,7 +16,7 @@ type BatchProcessor struct {
FindPublishedOptions
*
FindPublishedOptions
FindPublishedOptions
*
FindPublishedOptions
Filter
*
Filter
Filter
*
Filter
pageSize
,
pageNum
int
pageSize
,
pageNum
,
offset
,
limit
int
sort
[]
string
sort
[]
string
processed
int
processed
int
}
}
...
@@ -37,7 +37,7 @@ func (b *BatchProcessor) getBatch(ctx context.Context) ([]*Item, bool, error) {
...
@@ -37,7 +37,7 @@ func (b *BatchProcessor) getBatch(ctx context.Context) ([]*Item, bool, error) {
Regular
:
b
.
FindPublishedOptions
.
Regular
,
Regular
:
b
.
FindPublishedOptions
.
Regular
,
Hidden
:
b
.
FindPublishedOptions
.
Hidden
,
Hidden
:
b
.
FindPublishedOptions
.
Hidden
,
Templates
:
b
.
FindPublishedOptions
.
Templates
,
Templates
:
b
.
FindPublishedOptions
.
Templates
,
FindOptions
:
*
options
.
NewFindOptions
(
b
.
pageNum
,
b
.
pageSize
,
b
.
sort
...
),
FindOptions
:
*
options
.
NewFindOptions
(
b
.
pageNum
,
b
.
pageSize
,
b
.
offset
,
b
.
limit
,
b
.
sort
...
),
},
},
)
)
}
else
{
}
else
{
...
@@ -52,7 +52,7 @@ func (b *BatchProcessor) getBatch(ctx context.Context) ([]*Item, bool, error) {
...
@@ -52,7 +52,7 @@ func (b *BatchProcessor) getBatch(ctx context.Context) ([]*Item, bool, error) {
Regular
:
b
.
FindOptions
.
Regular
,
Regular
:
b
.
FindOptions
.
Regular
,
Hidden
:
b
.
FindOptions
.
Hidden
,
Hidden
:
b
.
FindOptions
.
Hidden
,
Templates
:
b
.
FindOptions
.
Templates
,
Templates
:
b
.
FindOptions
.
Templates
,
FindOptions
:
*
options
.
NewFindOptions
(
b
.
pageNum
,
b
.
pageSize
,
b
.
sort
...
),
FindOptions
:
*
options
.
NewFindOptions
(
b
.
pageNum
,
b
.
pageSize
,
b
.
offset
,
b
.
limit
,
b
.
sort
...
),
},
},
)
)
}
}
...
...
This diff is collapsed.
Click to expand it.
pkg/options/options.go
+
1
−
1
View file @
81d7873c
...
@@ -102,7 +102,7 @@ func MergeSortOptions(options ...SortOptions) SortOptions {
...
@@ -102,7 +102,7 @@ func MergeSortOptions(options ...SortOptions) SortOptions {
func
MergePaginationOptions
(
options
...
PaginationOptions
)
PaginationOptions
{
func
MergePaginationOptions
(
options
...
PaginationOptions
)
PaginationOptions
{
fo
:=
PaginationOptions
{}
fo
:=
PaginationOptions
{}
for
_
,
opt
:=
range
options
{
for
_
,
opt
:=
range
options
{
if
opt
.
PageSize
==
0
&&
opt
.
PageNum
==
0
||
opt
.
Offset
==
0
&&
opt
.
Limit
==
0
{
if
opt
.
PageSize
==
0
&&
opt
.
PageNum
==
0
&&
opt
.
Offset
==
0
&&
opt
.
Limit
==
0
{
continue
continue
}
}
fo
.
PageNum
=
opt
.
PageNum
fo
.
PageNum
=
opt
.
PageNum
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment