dd6d264b by chentao

no message

1 parent 01f96122
...@@ -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.METHOD,ElementType.FIELD,ElementType.TYPE}) 15 @Target({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,6 +13,7 @@ import javax.validation.constraints.Size; ...@@ -13,6 +13,7 @@ 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不能都为空")
16 public class CourseBo extends BaseBO { 17 public class CourseBo extends BaseBO {
17 private static final long serialVersionUID = 1L; 18 private static final long serialVersionUID = 1L;
18 19
...@@ -52,7 +53,6 @@ public class CourseBo extends BaseBO { ...@@ -52,7 +53,6 @@ public class CourseBo extends BaseBO {
52 /** 53 /**
53 * 2D oss_id 54 * 2D oss_id
54 */ 55 */
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!