Browse Source

Merge branch 'fix-1591' of https://git.openi.org.cn/OpenI/aiforge into fix-1591

tags/v1.22.3.2^2
zhoupzh 4 years ago
parent
commit
96b6a2bb3a
3 changed files with 41 additions and 27 deletions
  1. +9
    -0
      models/attachment.go
  2. +1
    -1
      modules/templates/helper.go
  3. +31
    -26
      routers/repo/dataset.go

+ 9
- 0
models/attachment.go View File

@@ -73,6 +73,7 @@ type AttachmentsOptions struct {
NeedDatasetIDs bool
NeedIsPrivate bool
IsPrivate bool
JustNeedZipFile bool
NeedRepoInfo bool
Keyword string
}
@@ -568,6 +569,14 @@ func Attachments(opts *AttachmentsOptions) ([]*AttachmentInfo, int64, error) {
)
}

if opts.JustNeedZipFile {
var DecompressState []int
DecompressState = append(DecompressState, 1, 2, 3)
cond = cond.And(
builder.In("attachment.decompress_state", DecompressState),
)
}

var count int64
var err error
if len(opts.Keyword) == 0 {


+ 1
- 1
modules/templates/helper.go View File

@@ -752,5 +752,5 @@ func licenses() []string {

// Dataset tasks
func tasks() []string {
return []string{"machine_translation", "question_answering_system", "information_retrieval", "knowledge_graph", "text_annotation", "text_categorization", "emotion_analysis", "language_modeling", "speech_recognition", "automatic_digest", "information_extraction", "description_generation", "image_classification", "face_recognition", "image_search", "target_detection", "image_description_generation", "vehicle_license_plate_recognition", "medical_image_analysis", "unmanned", "unmanned_security", "drone", "vr_ar", "2_d_vision", "2.5_d_vision", "3_d_reconstruction", "image_processing", "video_processing", "visual_input_system", "speech_coding", "speech_enhancement", "speech_recognition", "speech_synthesis"}
return []string{"machine_translation", "question_answering_system", "information_retrieval", "knowledge_graph", "text_annotation", "text_categorization", "emotion_analysis", "language_modeling", "speech_recognition", "automatic_digest", "information_extraction", "description_generation", "image_classification", "face_recognition", "image_search", "target_detection", "image_description_generation", "vehicle_license_plate_recognition", "medical_image_analysis", "unmanned", "unmanned_security", "drone", "vr_ar", "2_d_vision", "2.5_d_vision", "3_d_reconstruction", "image_processing", "video_processing", "visual_input_system", "speech_coding", "speech_enhancement", "speech_synthesis"}
}

+ 31
- 26
routers/repo/dataset.go View File

@@ -301,6 +301,7 @@ func CurrentRepoDataset(ctx *context.Context) {
dataset, err := models.GetDatasetByRepo(repo)
if err != nil {
ctx.JSON(http.StatusOK, models.BaseErrorMessage(ctx.Tr("GetDatasetByRepo failed", err)))
return
}
datasetIDs = append(datasetIDs, dataset.ID)
uploaderID := ctx.User.ID
@@ -309,13 +310,14 @@ func CurrentRepoDataset(ctx *context.Context) {
Page: page,
PageSize: setting.UI.DatasetPagingNum,
},
Keyword: keyword,
NeedDatasetIDs: true,
DatasetIDs: datasetIDs,
UploaderID: uploaderID,
Type: cloudbrainType,
NeedIsPrivate: false,
NeedRepoInfo: true,
Keyword: keyword,
NeedDatasetIDs: true,
DatasetIDs: datasetIDs,
UploaderID: uploaderID,
Type: cloudbrainType,
NeedIsPrivate: false,
JustNeedZipFile: true,
NeedRepoInfo: true,
})
if err != nil {
ctx.ServerError("datasets", err)
@@ -350,12 +352,13 @@ func MyDatasets(ctx *context.Context) {
Page: page,
PageSize: setting.UI.DatasetPagingNum,
},
Keyword: keyword,
NeedDatasetIDs: false,
UploaderID: uploaderID,
Type: cloudbrainType,
NeedIsPrivate: false,
NeedRepoInfo: true,
Keyword: keyword,
NeedDatasetIDs: false,
UploaderID: uploaderID,
Type: cloudbrainType,
NeedIsPrivate: false,
JustNeedZipFile: true,
NeedRepoInfo: true,
})
if err != nil {
ctx.ServerError("datasets", err)
@@ -389,12 +392,13 @@ func PublicDataset(ctx *context.Context) {
Page: page,
PageSize: setting.UI.DatasetPagingNum,
},
Keyword: keyword,
NeedDatasetIDs: false,
NeedIsPrivate: true,
IsPrivate: false,
Type: cloudbrainType,
NeedRepoInfo: true,
Keyword: keyword,
NeedDatasetIDs: false,
NeedIsPrivate: true,
IsPrivate: false,
Type: cloudbrainType,
JustNeedZipFile: true,
NeedRepoInfo: true,
})
if err != nil {
ctx.ServerError("datasets", err)
@@ -443,13 +447,14 @@ func MyFavoriteDataset(ctx *context.Context) {
Page: page,
PageSize: setting.UI.DatasetPagingNum,
},
Keyword: keyword,
NeedDatasetIDs: true,
DatasetIDs: datasetIDs,
NeedIsPrivate: true,
IsPrivate: false,
Type: cloudbrainType,
NeedRepoInfo: true,
Keyword: keyword,
NeedDatasetIDs: true,
DatasetIDs: datasetIDs,
NeedIsPrivate: true,
IsPrivate: false,
Type: cloudbrainType,
JustNeedZipFile: true,
NeedRepoInfo: true,
})
if err != nil {
ctx.ServerError("datasets", err)


Loading…
Cancel
Save