浏览代码

修复读取Next图像接口

zhuoning 4 年之前
父节点
当前提交
aec4113f6d

+ 29 - 11
huimv-video/huimv-video-manager/src/main/java/com/huimv/manager/dao/entity/ImagePathEntity.java

@@ -203,19 +203,37 @@ public class ImagePathEntity implements Serializable {
         return createDate;
     }
 
+//    @Override
+//    public String toString() {
+//        return "ImagePathEntity{" +
+//                "id=" + id + '\'' +
+//                "name=" + name + '\'' +
+//                "imgPath=" + imgPath + '\'' +
+//                "relativePath=" + relativePath + '\'' +
+//                "fileName=" + fileName + '\'' +
+//                "effective=" + effective + '\'' +
+//                "aiResult=" + aiResult + '\'' +
+//                "aiTimeUsed=" + aiTimeUsed + '\'' +
+//                "aiData=" + aiData + '\'' +
+//                "createDate=" + createDate + '\'' +
+//                '}';
+//    }
+
+
     @Override
     public String toString() {
-        return "ImagePathEntity{" +
-                "id=" + id + '\'' +
-                "name=" + name + '\'' +
-                "imgPath=" + imgPath + '\'' +
-                "relativePath=" + relativePath + '\'' +
-                "fileName=" + fileName + '\'' +
-                "effective=" + effective + '\'' +
-                "aiResult=" + aiResult + '\'' +
-                "aiTimeUsed=" + aiTimeUsed + '\'' +
-                "aiData=" + aiData + '\'' +
-                "createDate=" + createDate + '\'' +
+//        return "ImagePathEntity{" +
+        return "{" +
+                "id=" + id +
+                ", name='" + name + '\'' +
+                ", imgPath='" + imgPath + '\'' +
+                ", relativePath='" + relativePath + '\'' +
+                ", fileName='" + fileName + '\'' +
+                ", effective=" + effective +
+                ", aiResult='" + aiResult + '\'' +
+                ", aiTimeUsed=" + aiTimeUsed +
+                ", aiData='" + aiData + '\'' +
+                ", createDate=" + createDate +
                 '}';
     }
 }

+ 8 - 4
huimv-video/huimv-video-manager/src/main/java/com/huimv/manager/service/impl/ImageServiceImpl.java

@@ -50,9 +50,13 @@ public class ImageServiceImpl implements IImageService {
     public String getNextImage() {
         // 读取下一副图像
         ImagePathEntity imagePathEntity = imagePathRepo.getNextImage();
-        // 更改记录
-        imagePathEntity.setEffective(0);
-        imagePathRepo.saveAndFlush(imagePathEntity);
-        return imagePathEntity.toString();
+        if(imagePathEntity!=null){
+            // 更改记录
+            imagePathEntity.setEffective(0);
+            imagePathRepo.saveAndFlush(imagePathEntity);
+            return imagePathEntity.toString();
+        }else{
+            return imagePathRepo.getLastImage().toString();
+        }
     }
 }