From 9d7af74009e90138f6ea2d363a69ff927cf66b65 Mon Sep 17 00:00:00 2001 From: GoblinsWang <806586736@qq.com> Date: Thu, 23 Mar 2023 16:18:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E8=84=B8=E5=BA=93=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/ResourcesController.java | 3 ++- .../server/mappers/FaceLibraryMapper.java | 2 ++ .../services/impl/FaceLibraryServiceImpl.java | 20 +++++++++---------- .../src/main/resources/application-dev.yml | 2 +- .../mybatis/mapper/FaceLibraryMapper.xml | 12 +++++++++++ 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/face-server/src/main/java/com/dkha/server/controllers/ResourcesController.java b/face-server/src/main/java/com/dkha/server/controllers/ResourcesController.java index 218e0a3..ea3d20e 100644 --- a/face-server/src/main/java/com/dkha/server/controllers/ResourcesController.java +++ b/face-server/src/main/java/com/dkha/server/controllers/ResourcesController.java @@ -68,12 +68,13 @@ public class ResourcesController extends CommonResult { @NoRepeatSubmitAnnotation(prefix = "Resources/faceLib") public CommonResult addFaceLibrary(@ApiParam(required = true, name = "faceLibrary", value = "{\n" + " \"factoryName\": \"库名称\",\n" + - " \"factoryType\": \"库类型\",\n" + " \"remarks\": \"备注\"\n" + "}")@RequestBody FaceLibrary faceLibrary){ if (UtilValidate.isEmpty(faceLibrary.getFactoryName())){ throw new DkException("库名称不能为空"); } + faceLibrary.setIdFactory(System.currentTimeMillis()); + faceLibrary.setFactoryType("0"); faceLibrary.setIsValid(YNEnums.YES.code); faceLibrary.setCreateTime(new Date()); faceLibrary.setUpdateTime(new Date()); diff --git a/face-server/src/main/java/com/dkha/server/mappers/FaceLibraryMapper.java b/face-server/src/main/java/com/dkha/server/mappers/FaceLibraryMapper.java index 945c4cc..20e4cd0 100644 --- a/face-server/src/main/java/com/dkha/server/mappers/FaceLibraryMapper.java +++ b/face-server/src/main/java/com/dkha/server/mappers/FaceLibraryMapper.java @@ -32,4 +32,6 @@ public interface FaceLibraryMapper extends BaseMapper { * @return */ Integer getLibraryCount(@Param("idFactory") Long idFactory); + + FaceLibrary getLibrary(@Param("factoryName") String factoryName); } diff --git a/face-server/src/main/java/com/dkha/server/services/impl/FaceLibraryServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/FaceLibraryServiceImpl.java index 71085db..8748909 100644 --- a/face-server/src/main/java/com/dkha/server/services/impl/FaceLibraryServiceImpl.java +++ b/face-server/src/main/java/com/dkha/server/services/impl/FaceLibraryServiceImpl.java @@ -67,19 +67,19 @@ public class FaceLibraryServiceImpl extends ServiceImpl select COUNT(*) from portrait p where p.is_valid='Y'and p.id_factory= #{idFactory} +