Merge branch 'test' of http://gitlab.fjmaimaimai.com/allied-creation/performance into test
正在显示
1 个修改的文件
包含
11 行增加
和
11 行删除
@@ -273,20 +273,20 @@ func (controller *ImportController) ZipImport() { | @@ -273,20 +273,20 @@ func (controller *ImportController) ZipImport() { | ||
273 | }) | 273 | }) |
274 | continue | 274 | continue |
275 | } | 275 | } |
276 | - if err := controller.parserAndInsert(f, fn); err != nil { | 276 | + if err = controller.parserAndInsert(f, fn); err != nil { |
277 | failure = append(failure, command.ErrorI{ | 277 | failure = append(failure, command.ErrorI{ |
278 | FileName: fn, | 278 | FileName: fn, |
279 | Message: err.Error(), | 279 | Message: err.Error(), |
280 | }) | 280 | }) |
281 | - continue | 281 | + } else { |
282 | + success = append(success, command.ErrorI{ | ||
283 | + FileName: fn, | ||
284 | + Message: "", | ||
285 | + }) | ||
282 | } | 286 | } |
283 | - | ||
284 | - success = append(success, command.ErrorI{ | ||
285 | - FileName: fn, | ||
286 | - Message: "", | ||
287 | - }) | ||
288 | } | 287 | } |
289 | 288 | ||
289 | + // 解析完成 | ||
290 | out = command.OutResult{ | 290 | out = command.OutResult{ |
291 | Status: "completed", | 291 | Status: "completed", |
292 | Success: success, | 292 | Success: success, |
@@ -409,9 +409,9 @@ func (controller *ImportController) parserAndInsert(file *os.File, fileName stri | @@ -409,9 +409,9 @@ func (controller *ImportController) parserAndInsert(file *os.File, fileName stri | ||
409 | return application.ThrowError(application.ARG_ERROR, "没有数据内容") | 409 | return application.ThrowError(application.ARG_ERROR, "没有数据内容") |
410 | } | 410 | } |
411 | 411 | ||
412 | - var filenameWithSuffix = path.Base(fileName) | ||
413 | - var fileSuffix = path.Ext(filenameWithSuffix) | ||
414 | - var filenameOnly = strings.TrimSuffix(filenameWithSuffix, fileSuffix) | 412 | + var nameWithSuffix = path.Base(fileName) |
413 | + var suffix = path.Ext(nameWithSuffix) | ||
414 | + var nameOnly = strings.TrimSuffix(nameWithSuffix, suffix) | ||
415 | 415 | ||
416 | ruService := service.NewEvaluationTemplateService() | 416 | ruService := service.NewEvaluationTemplateService() |
417 | in := &templateCommand.CreateTemplateCommand{} | 417 | in := &templateCommand.CreateTemplateCommand{} |
@@ -419,7 +419,7 @@ func (controller *ImportController) parserAndInsert(file *os.File, fileName stri | @@ -419,7 +419,7 @@ func (controller *ImportController) parserAndInsert(file *os.File, fileName stri | ||
419 | ua := middlewares.GetUser(controller.Ctx) | 419 | ua := middlewares.GetUser(controller.Ctx) |
420 | in.CompanyId = ua.CompanyId | 420 | in.CompanyId = ua.CompanyId |
421 | in.CreatorId = ua.UserId | 421 | in.CreatorId = ua.UserId |
422 | - in.Name = filenameOnly | 422 | + in.Name = nameOnly |
423 | in.Describe = "" | 423 | in.Describe = "" |
424 | in.NodeContents = list | 424 | in.NodeContents = list |
425 | 425 |
-
请 注册 或 登录 后发表评论