diff --git a/cloud-common-plugin/src/test/AnnotationTest.java b/cloud-common-plugin/src/test/AnnotationTest.java new file mode 100644 index 0000000..c7ba930 --- /dev/null +++ b/cloud-common-plugin/src/test/AnnotationTest.java @@ -0,0 +1,35 @@ +import com.cm.common.exception.ParamsException; +import com.cm.common.exception.base.SystemException; +import com.cm.common.plugin.pojo.vos.database.table.TableVO; +import com.cm.common.utils.annotation.AnnotationUtil; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: AnnotationTest + * @Description: TODO + * @Author: WangGeng + * @Date: 2019/11/14 13:30 + * @Version: 1.0 + **/ +public class AnnotationTest { + + public static void main(String[] args) { + TableVO tableVO = new TableVO(); + tableVO.setTableName("二狗"); + tableVO.setFieldName("1"); + tableVO.setFieldComment("备注"); + tableVO.setFieldType("t1234"); + tableVO.setFieldLength(1); + tableVO.setFieldFloatLength(0); + tableVO.setNull(true); + tableVO.setDefaultValue("123"); + try { + AnnotationUtil.checkField(tableVO); + } catch (SystemException e) { + e.printStackTrace(); + } + } + +} diff --git a/cloud-common/src/main/java/com/cm/common/annotation/CheckBooleanAnnotation.java b/cloud-common/src/main/java/com/cm/common/annotation/CheckBooleanAnnotation.java new file mode 100644 index 0000000..8ec2f38 --- /dev/null +++ b/cloud-common/src/main/java/com/cm/common/annotation/CheckBooleanAnnotation.java @@ -0,0 +1,18 @@ +package com.cm.common.annotation; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: CheckBooleanAnnotation + * @Description: TODO + * @Author: WangGeng + * @Date: 2019/11/14 14:50 + * @Version: 1.0 + **/ +public @interface CheckBooleanAnnotation { + + String name(); + + String[] types() default {}; +}