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} +