提交 89438fb3 authored 作者: yangqi's avatar yangqi

1

上级 8c952484
......@@ -4,9 +4,16 @@ package cn.lefull.common.utils;
* @author 杨奇
*/
public class Utils {
public static void checkStringNotEmpty(String str, String name) throws Exception {
public static void checkParamsNotEmpty(String str, String name) throws Exception {
if(str == null || str.isEmpty()){
throw new Exception(name + "为空");
throw new Exception(name + "未设置");
}
}
public static void checkParamsNotEmpty(int i, String name) throws Exception {
if(i == 0){
throw new Exception(name + "未设置");
}
}
}
......@@ -24,9 +24,9 @@ public class FaceService {
}
public void addFace(String dbName, String entityId, String labels) throws Exception {
Utils.checkStringNotEmpty(dbName, "dbName");
Utils.checkStringNotEmpty(entityId, "entityId");
Utils.checkStringNotEmpty(labels, "labels");
Utils.checkParamsNotEmpty(dbName, "dbName");
Utils.checkParamsNotEmpty(entityId, "entityId");
Utils.checkParamsNotEmpty(labels, "labels");
face.addFace(dbName, entityId, labels);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论