210c8460 by chentao

no message

1 parent 036c0a2d
...@@ -12,7 +12,7 @@ import java.lang.annotation.Retention; ...@@ -12,7 +12,7 @@ import java.lang.annotation.Retention;
12 import java.lang.annotation.RetentionPolicy; 12 import java.lang.annotation.RetentionPolicy;
13 import java.lang.annotation.Target; 13 import java.lang.annotation.Target;
14 @Constraint(validatedBy = AtLeastOneNonNullValidator.class) 14 @Constraint(validatedBy = AtLeastOneNonNullValidator.class)
15 @Target({ElementType.TYPE}) 15 @Target({ElementType.METHOD,ElementType.FIELD,ElementType.TYPE})
16 @Retention(RetentionPolicy.RUNTIME) 16 @Retention(RetentionPolicy.RUNTIME)
17 public @interface AtLeastOneNonNull { 17 public @interface AtLeastOneNonNull {
18 String message() default "At least one field must be non-null"; 18 String message() default "At least one field must be non-null";
......
...@@ -13,7 +13,6 @@ import javax.validation.constraints.Size; ...@@ -13,7 +13,6 @@ import javax.validation.constraints.Size;
13 * @date 2024/9/8 16:29 13 * @date 2024/9/8 16:29
14 */ 14 */
15 @Data 15 @Data
16 @AtLeastOneNonNull(fields = {"twoDimensionalOssId", "threeDimensionalOssId"},message = "2D和3D不能都为空")
17 public class CourseBo extends BaseBO { 16 public class CourseBo extends BaseBO {
18 private static final long serialVersionUID = 1L; 17 private static final long serialVersionUID = 1L;
19 18
...@@ -53,6 +52,7 @@ public class CourseBo extends BaseBO { ...@@ -53,6 +52,7 @@ public class CourseBo extends BaseBO {
53 /** 52 /**
54 * 2D oss_id 53 * 2D oss_id
55 */ 54 */
55 @AtLeastOneNonNull(fields = {"twoDimensionalOssId", "threeDimensionalOssId"},message = "2D和3D不能都为空")
56 private String twoDimensionalOssId; 56 private String twoDimensionalOssId;
57 57
58 /** 58 /**
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!