Merge remote-tracking branch 'origin/master'
commit
e66fa844d2
|
@ -39,6 +39,10 @@ public enum SysDBType {
|
|||
.anyMatch(c -> c.equals(code));
|
||||
}
|
||||
|
||||
public static SysDBType[] getValues(){
|
||||
return values();
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数转换,从编码转换为名称
|
||||
* @param code 编码
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.common.core.validation;
|
||||
|
||||
|
||||
import com.muyu.common.core.enums.*;
|
||||
import com.muyu.common.core.validation.custom.*;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @Author: 胡杨
|
||||
* @Name: SysFieldsType
|
||||
* @Description: 判断语句
|
||||
* @CreatedDate: 2024/8/29 下午1:54
|
||||
* @FilePath: com.muyu.common.core.validation
|
||||
*/
|
||||
|
||||
public class IsSysFieldsTypeValidator implements ConstraintValidator<IsSysFieldsType, String> {
|
||||
@Override
|
||||
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
|
||||
return SysFieldsType.isCode(s);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.common.core.validation;
|
||||
|
||||
|
||||
import com.muyu.common.core.enums.*;
|
||||
import com.muyu.common.core.validation.custom.*;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @Author: 胡杨
|
||||
* @Name: SysNodeType
|
||||
* @Description: 节点类型字典
|
||||
* @CreatedDate: 2024/8/29 下午4:47
|
||||
* @FilePath: com.muyu.common.core.validation
|
||||
*/
|
||||
|
||||
public class IsSysNodeTypeValidator implements ConstraintValidator<IsSysNodeType, String> {
|
||||
@Override
|
||||
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
|
||||
return SysNodeType.isCode(s);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.common.core.validation.custom;
|
||||
|
||||
import com.muyu.common.core.validation.*;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* @Author: 胡杨
|
||||
* @Name: SysFieldsType
|
||||
* @Description: 字段类型字典判断注释
|
||||
* @CreatedDate: 2024/8/29 下午1:53
|
||||
* @FilePath: com.muyu.common.core.validation.custom
|
||||
*/
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RUNTIME)
|
||||
@Documented
|
||||
@Constraint(validatedBy = IsSysFieldsTypeValidator.class)
|
||||
public @interface IsSysFieldsType {
|
||||
String message() default "数据字典:[字段类型字典] - 参数不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.common.core.validation.custom;
|
||||
|
||||
import com.muyu.common.core.validation.*;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* @Author: 胡杨
|
||||
* @Name: SysNodeType
|
||||
* @Description: 节点类型字典
|
||||
* @CreatedDate: 2024/8/29 下午4:47
|
||||
* @FilePath: com.muyu.common.core.validation.custom
|
||||
*/
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RUNTIME)
|
||||
@Documented
|
||||
@Constraint(validatedBy = IsSysNodeTypeValidator.class)
|
||||
public @interface IsSysNodeType {
|
||||
String message() default "数据字典:[节点类型字典] - 参数不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
Loading…
Reference in New Issue