diff --git a/cloud-common/src/main/java/com/cm/common/result/SuccessResultLayImData.java b/cloud-common/src/main/java/com/cm/common/result/SuccessResultLayImData.java index 2e236de..a6fbc1e 100644 --- a/cloud-common/src/main/java/com/cm/common/result/SuccessResultLayImData.java +++ b/cloud-common/src/main/java/com/cm/common/result/SuccessResultLayImData.java @@ -3,6 +3,7 @@ package com.cm.common.result; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; import java.util.List; /** @@ -216,4 +217,18 @@ public class SuccessResultLayImData extends SuccessResult { this.avatar = avatar; } } + + @ApiModel + public static class MemberData { + @ApiModelProperty(name = "list", value = "组员列表") + private List list; + + public List getList() { + return list == null ? new ArrayList<>() : list; + } + + public void setList(List list) { + this.list = list; + } + } } diff --git a/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java b/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java index 123fd7c..763d35d 100644 --- a/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java +++ b/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java @@ -83,6 +83,9 @@ public class AnnotationUtil { } if (fieldValue instanceof List) { List fieldValueList = (List) fieldValue; + if (fieldValueList.isEmpty()) { + throw new ParamsException(String.format("%s不能为空", checkListAnnotation.name())); + } for (Object obj : fieldValueList) { checkField(obj); }