|
@@ -171,16 +171,17 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
type SearchDatasetOptions struct { |
|
|
type SearchDatasetOptions struct { |
|
|
Keyword string |
|
|
|
|
|
OwnerID int64 |
|
|
|
|
|
User *User |
|
|
|
|
|
RepoID int64 |
|
|
|
|
|
IncludePublic bool |
|
|
|
|
|
RecommendOnly bool |
|
|
|
|
|
Category string |
|
|
|
|
|
Task string |
|
|
|
|
|
License string |
|
|
|
|
|
DatasetIDs []int64 |
|
|
|
|
|
|
|
|
Keyword string |
|
|
|
|
|
OwnerID int64 |
|
|
|
|
|
User *User |
|
|
|
|
|
RepoID int64 |
|
|
|
|
|
IncludePublic bool |
|
|
|
|
|
RecommendOnly bool |
|
|
|
|
|
Category string |
|
|
|
|
|
Task string |
|
|
|
|
|
License string |
|
|
|
|
|
DatasetIDs []int64 |
|
|
|
|
|
ExcludeDatasetId int64 |
|
|
ListOptions |
|
|
ListOptions |
|
|
SearchOrderBy |
|
|
SearchOrderBy |
|
|
IsOwner bool |
|
|
IsOwner bool |
|
@@ -240,6 +241,10 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { |
|
|
cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID}) |
|
|
cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if opts.ExcludeDatasetId > 0 { |
|
|
|
|
|
cond = cond.And(builder.Neq{"dataset.id": opts.ExcludeDatasetId}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if opts.PublicOnly { |
|
|
if opts.PublicOnly { |
|
|
cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic}) |
|
|
cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic}) |
|
|
cond = cond.And(builder.Eq{"attachment.is_private": false}) |
|
|
cond = cond.And(builder.Eq{"attachment.is_private": false}) |
|
|