Browse Source

文本标注和文件上传version1

fuyou 7 months ago
parent
commit
a3081b1b24

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblApprovalsController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblApprovalsController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblApprovals tblApprovals)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblApprovals.setApprovalId(shortUUID);
         return toAjax(tblApprovalsService.insertTblApprovals(tblApprovals));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblDataController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblDataController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblData tblData)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblData.setDataId(shortUUID);
         return toAjax(tblDataService.insertTblData(tblData));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblEntityController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblEntityController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblEntity tblEntity)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblEntity.setEntityId(shortUUID);
         return toAjax(tblEntityService.insertTblEntity(tblEntity));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblEntityTypeController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblEntityTypeController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblEntityType tblEntityType)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblEntityType.setTypeId(shortUUID);
         return toAjax(tblEntityTypeService.insertTblEntityType(tblEntityType));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblOptLogsController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblOptLogsController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblOptLogs tblOptLogs)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblOptLogs.setLogId(shortUUID);
         return toAjax(tblOptLogsService.insertTblOptLogs(tblOptLogs));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblRelationController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblRelationController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblRelation tblRelation)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblRelation.setRelationId(shortUUID);
         return toAjax(tblRelationService.insertTblRelation(tblRelation));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblRelationTypeController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblRelationTypeController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblRelationType tblRelationType)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblRelationType.setTypeId(shortUUID);
         return toAjax(tblRelationTypeService.insertTblRelationType(tblRelationType));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblResultController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblResultController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblResult tblResult)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblResult.setResultId(shortUUID);
         return toAjax(tblResultService.insertTblResult(tblResult));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblTaskAssignmentController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblTaskAssignmentController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblTaskAssignment tblTaskAssignment)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblTaskAssignment.setAssignmentId(shortUUID);
         return toAjax(tblTaskAssignmentService.insertTblTaskAssignment(tblTaskAssignment));
     }
 

+ 6 - 0
autoremark-business/src/main/java/com/autoremark/business/controller/TblTrainingModelController.java

@@ -2,6 +2,8 @@ package com.autoremark.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.autoremark.common.utils.uuid.UUID;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,10 @@ public class TblTrainingModelController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TblTrainingModel tblTrainingModel)
     {
+        String uuid = UUID.randomUUID().toString().replace("-", "");  // 去掉 UUID 中的短横线
+        // 截取前 20 个字符
+        String shortUUID = uuid.substring(0, 25);
+        tblTrainingModel.setTrainingId(shortUUID);
         return toAjax(tblTrainingModelService.insertTblTrainingModel(tblTrainingModel));
     }