Parcourir la source

fix: fileupload

unknown il y a 8 mois
Parent
commit
7c47bd035b

+ 5 - 5
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/DataAugmentationController.java

@@ -149,11 +149,11 @@ public class DataAugmentationController extends BaseController {
     @RepeatSubmit()
     @PostMapping
     public CommonResult<Void> add(@Validated @RequestBody DataAugmentationBo dataAugmentationBo) {
-        QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.eq("file_name", dataAugmentationBo.getUploadPath());
-        List<SysOss> list = ossService.list(queryWrapper);
-        SysOss oneByEntityId = list.get(0);
-        dataAugmentationBo.setInputOssId(oneByEntityId.getOssId());
+//        QueryWrapper queryWrapper = new QueryWrapper();
+//        queryWrapper.eq("file_name", dataAugmentationBo.getUploadPath());
+//        List<SysOss> list = ossService.list(queryWrapper);
+//        SysOss oneByEntityId = list.get(0);
+//        dataAugmentationBo.setInputOssId(oneByEntityId.getOssId());
         boolean inserted = dataAugmentationService.insert(dataAugmentationBo);
         if (!inserted) {
             return CommonResult.fail("新增数据增强记录失败!");

+ 1 - 1
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/DataAugmentation.java

@@ -23,7 +23,7 @@ import lombok.Data;
 @Builder
 @Data
 @EqualsAndHashCode(callSuper = true)
-@Table(value = "video_stable")
+@Table(value = "data_augmentation")
 @AllArgsConstructor
 @NoArgsConstructor
 public class DataAugmentation extends BaseEntity {

+ 5 - 4
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/bo/DataAugmentationBo.java

@@ -1,6 +1,7 @@
 package com.taais.biz.domain.bo;
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.taais.biz.domain.DataAugmentation;
 import com.taais.biz.domain.VideoStable;
 import io.github.linpeilie.annotations.AutoMapper;
 import jakarta.validation.constraints.NotBlank;
@@ -19,7 +20,7 @@ import com.taais.common.orm.core.domain.BaseEntity;
 @Builder
 @Data
 @EqualsAndHashCode(callSuper = true)
-@AutoMapper(target = VideoStable.class, reverseConvertGenerate = false)
+@AutoMapper(target = DataAugmentation.class, reverseConvertGenerate = false)
 @AllArgsConstructor
 @NoArgsConstructor
 public class DataAugmentationBo extends BaseEntity{
@@ -42,10 +43,10 @@ public class DataAugmentationBo extends BaseEntity{
     /**
      * 输入图片集ossId
      */
-
+    @NotNull(message = "输入图片集不能为空")
     private Long inputOssId;
-    @NotNull(message = "输入图片集路径不能为空")
-    private String uploadPath;
+
+
 
     private String inputPath;
     private String outputPath;

+ 2 - 1
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/vo/DataAugmentationVo.java

@@ -3,6 +3,7 @@ package com.taais.biz.domain.vo;
 import java.util.Date;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.taais.biz.domain.DataAugmentation;
 import com.taais.biz.domain.VideoStable;
 import io.github.linpeilie.annotations.AutoMapper;
 import lombok.Builder;
@@ -21,7 +22,7 @@ import com.taais.common.orm.core.domain.BaseEntity;
 @Data
 @ExcelIgnoreUnannotated
 @EqualsAndHashCode(callSuper = true)
-@AutoMapper(target = VideoStable.class)
+@AutoMapper(target = DataAugmentation.class)
 public class DataAugmentationVo extends BaseEntity implements Serializable {
 
     @Serial

+ 0 - 1
taais-modules/taais-biz/src/main/java/com/taais/biz/mapper/DataAugmentationMapper.java

@@ -2,7 +2,6 @@ package com.taais.biz.mapper;
 
 import com.mybatisflex.core.BaseMapper;
 import com.taais.biz.domain.DataAugmentation;
-import com.taais.biz.domain.VideoStable;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 29 - 26
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/DataAugmentationServiceImpl.java

@@ -21,6 +21,7 @@ import com.taais.common.core.utils.StringUtils;
 import com.taais.common.json.utils.JsonUtils;
 import com.taais.common.orm.core.page.PageQuery;
 import com.taais.common.orm.core.service.impl.BaseServiceImpl;
+import com.taais.system.domain.SysOss;
 import com.taais.system.domain.vo.SysOssVo;
 import com.taais.system.service.ISysOssService;
 import jakarta.annotation.Resource;
@@ -46,8 +47,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
-import static com.taais.biz.domain.table.VideoStableTableDef.VIDEO_STABLE;
-
+import static com.taais.biz.domain.table.DataAugmentationTableDef.DATA_AUGMENTATION;
 /**
  * 数据增强Service业务层处理
  *
@@ -71,27 +71,31 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
 
     @Override
     public QueryWrapper query() {
-        return super.query().from(VIDEO_STABLE);
+        return super.query().from(DATA_AUGMENTATION);
     }
 
     private QueryWrapper buildQueryWrapper(DataAugmentationBo dataAugmentationBo) {
         QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        queryWrapper.and(VIDEO_STABLE.NAME.like
+        queryWrapper.and(DATA_AUGMENTATION.NAME.like
             (dataAugmentationBo.getName()));
-        queryWrapper.and(VIDEO_STABLE.STATUS.like
+        queryWrapper.and(DATA_AUGMENTATION.STATUS.like
             (dataAugmentationBo.getStatus()));
-        queryWrapper.and(VIDEO_STABLE.INPUT_OSS_ID.eq
+        queryWrapper.and(DATA_AUGMENTATION.INPUT_OSS_ID.eq
             (dataAugmentationBo.getInputOssId()));
-        queryWrapper.and(VIDEO_STABLE.START_TIME.eq
+        queryWrapper.and(DATA_AUGMENTATION.START_TIME.eq
             (dataAugmentationBo.getStartTime()));
-        queryWrapper.and(VIDEO_STABLE.END_TIME.eq
+        queryWrapper.and(DATA_AUGMENTATION.END_TIME.eq
             (dataAugmentationBo.getEndTime()));
-        queryWrapper.and(VIDEO_STABLE.COST_SECOND.eq
+        queryWrapper.and(DATA_AUGMENTATION.COST_SECOND.eq
             (dataAugmentationBo.getCostSecond()));
-        queryWrapper.and(VIDEO_STABLE.LOG.like
+        queryWrapper.and(DATA_AUGMENTATION.LOG.like
             (dataAugmentationBo.getLog()));
-        queryWrapper.and(VIDEO_STABLE.REMARKS.like
+        queryWrapper.and(DATA_AUGMENTATION.REMARKS.like
             (dataAugmentationBo.getRemarks()));
+        queryWrapper.and(DATA_AUGMENTATION.ALGORITHM_PATH.eq
+            (dataAugmentationBo.getAlgorithmPath()));
+        queryWrapper.and(DATA_AUGMENTATION.HYPERPARAMETER_CONFIGURATION.like
+            (dataAugmentationBo.getHyperparameterConfiguration()));
 
         return queryWrapper;
     }
@@ -104,7 +108,7 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
      */
     @Override
     public DataAugmentationVo selectById(Long id) {
-        return this.getOneAs(query().where(VIDEO_STABLE.ID.eq(id)), DataAugmentationVo.class);
+        return this.getOneAs(query().where(DATA_AUGMENTATION.ID.eq(id)), DataAugmentationVo.class);
 
     }
 
@@ -141,7 +145,6 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
      */
     @Override
     public boolean insert(DataAugmentationBo dataAugmentationBo) {
-        // 检查input_oss_id是否存在
         if (ObjectUtil.isNull(dataAugmentationBo.getInputOssId())) {
             return false;
         }
@@ -151,19 +154,19 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
             return false;
         }
 
-        //DataAugmentation dataAugmentation = MapstructUtils.convert(dataAugmentationBo, DataAugmentation.class);
-        DataAugmentation dataAugmentation = new DataAugmentation();
-        dataAugmentation.setId(dataAugmentationBo.getId());
-        dataAugmentation.setOutputPath(dataAugmentationBo.getOutputPath());
-        dataAugmentation.setLog(dataAugmentationBo.getLog());
-        dataAugmentation.setCostSecond(dataAugmentationBo.getCostSecond());
-        dataAugmentation.setInputPath(dataAugmentationBo.getInputPath());
-        dataAugmentation.setEndTime(dataAugmentationBo.getEndTime());
-        dataAugmentation.setAlgorithmPath(dataAugmentationBo.getAlgorithmPath());
-        dataAugmentation.setHyperparameterConfiguration(dataAugmentationBo.getHyperparameterConfiguration());
-        dataAugmentation.setInputOssId(dataAugmentationBo.getInputOssId());
-        dataAugmentation.setRemarks(dataAugmentationBo.getRemarks());
-        dataAugmentation.setStartTime(dataAugmentationBo.getStartTime());
+        DataAugmentation dataAugmentation = MapstructUtils.convert(dataAugmentationBo, DataAugmentation.class);
+//        DataAugmentation dataAugmentation = new DataAugmentation();
+//        dataAugmentation.setId(dataAugmentationBo.getId());
+//        dataAugmentation.setOutputPath(dataAugmentationBo.getOutputPath());
+//        dataAugmentation.setLog(dataAugmentationBo.getLog());
+//        dataAugmentation.setCostSecond(dataAugmentationBo.getCostSecond());
+//        dataAugmentation.setInputPath(dataAugmentationBo.getInputPath());
+//        dataAugmentation.setEndTime(dataAugmentationBo.getEndTime());
+//        dataAugmentation.setAlgorithmPath(dataAugmentationBo.getAlgorithmPath());
+//        dataAugmentation.setHyperparameterConfiguration(dataAugmentationBo.getHyperparameterConfiguration());
+//        dataAugmentation.setInputOssId(dataAugmentationBo.getInputOssId());
+//        dataAugmentation.setRemarks(dataAugmentationBo.getRemarks());
+//        dataAugmentation.setStartTime(dataAugmentationBo.getStartTime());
         dataAugmentation.setStatus(BizConstant.VideoStatus.NOT_START);
 
         return this.save(dataAugmentation);// 使用全局配置的雪花算法主键生成器生成ID值