feat(): 增加了forestHttp调用框架
parent
5865bdb97f
commit
f1ae4aa715
6
pom.xml
6
pom.xml
|
@ -161,6 +161,12 @@
|
||||||
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dtflys.forest</groupId>
|
||||||
|
<artifactId>forest-spring-boot3-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.muyu.common.core.validation.custom;
|
||||||
|
|
||||||
|
import jakarta.validation.Constraint;
|
||||||
|
import jakarta.validation.Payload;
|
||||||
|
|
||||||
|
import java.lang.annotation.Documented;
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:杨鹏
|
||||||
|
* @Package:com.muyu.common.core.validation.custom
|
||||||
|
* @Project:cloud-common-core
|
||||||
|
* @name:IsSystemPayType
|
||||||
|
* @Date:2024/8/9 16:57
|
||||||
|
*/
|
||||||
|
@Target({ElementType.FIELD})
|
||||||
|
@Retention(RUNTIME)
|
||||||
|
@Documented
|
||||||
|
@Constraint(validatedBy = {SystemPayTypeValidator.class})
|
||||||
|
public @interface IsSystemPayType {
|
||||||
|
String message () default "[支付渠道] - 参数不合法";
|
||||||
|
Class<?>[] groups () default { };
|
||||||
|
Class<? extends Payload>[] payload () default { };
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.common.core.validation.custom;
|
||||||
|
|
||||||
|
import com.muyu.common.core.enums.SysPayType;
|
||||||
|
import jakarta.validation.ConstraintValidator;
|
||||||
|
import jakarta.validation.ConstraintValidatorContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:杨鹏
|
||||||
|
* @Package:com.muyu.common.core.validation.custom
|
||||||
|
* @Project:cloud-common-core
|
||||||
|
* @name:SystemPayTypeValidator
|
||||||
|
* @Date:2024/8/9 16:58
|
||||||
|
*/
|
||||||
|
public class SystemPayTypeValidator implements ConstraintValidator<IsSystemPayType,String> {
|
||||||
|
@Override
|
||||||
|
public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
|
||||||
|
return SysPayType.isCode(value);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue