新增字段校验注解和切点校验功能
This commit is contained in:
parent
4ff4d396d6
commit
6856e98885
35
cloud-common-plugin/src/test/AnnotationTest.java
Normal file
35
cloud-common-plugin/src/test/AnnotationTest.java
Normal file
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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 {};
|
||||
}
|
Loading…
Reference in New Issue
Block a user