fix(sj_1.1.1): 修复重试回调校验器异常

This commit is contained in:
opensnail 2024-07-18 16:28:28 +08:00
parent fcfa3be688
commit dbf031f4cb

View File

@ -39,7 +39,6 @@ import org.springframework.validation.annotation.Validated;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Objects; import java.util.Objects;
import java.util.Set;
import static com.aizuda.snailjob.common.core.constant.SystemConstants.HTTP_PATH.*; import static com.aizuda.snailjob.common.core.constant.SystemConstants.HTTP_PATH.*;
@ -141,14 +140,6 @@ public class SnailRetryEndPoint {
@Mapping(path = RETRY_CALLBACK, method = RequestMethod.POST) @Mapping(path = RETRY_CALLBACK, method = RequestMethod.POST)
public Result callback(@Valid RetryCallbackDTO callbackDTO) { public Result callback(@Valid RetryCallbackDTO callbackDTO) {
ValidatorFactory vf = Validation.buildDefaultValidatorFactory();
Validator validator = vf.getValidator();
Set<ConstraintViolation<RetryCallbackDTO>> set = validator.validate(callbackDTO);
for (final ConstraintViolation<RetryCallbackDTO> violation : set) {
return new Result<>(violation.getMessage(), null);
}
RetryerInfo retryerInfo = null; RetryerInfo retryerInfo = null;
Object[] deSerialize = null; Object[] deSerialize = null;
try { try {
@ -261,13 +252,6 @@ public class SnailRetryEndPoint {
public Result<String> idempotentIdGenerate(@Valid public Result<String> idempotentIdGenerate(@Valid
GenerateRetryIdempotentIdDTO generateRetryIdempotentIdDTO) { GenerateRetryIdempotentIdDTO generateRetryIdempotentIdDTO) {
ValidatorFactory vf = Validation.buildDefaultValidatorFactory();
Validator validator = vf.getValidator();
Set<ConstraintViolation<GenerateRetryIdempotentIdDTO>> set = validator.validate(generateRetryIdempotentIdDTO);
for (final ConstraintViolation<GenerateRetryIdempotentIdDTO> violation : set) {
return new Result<>(violation.getMessage(), null);
}
String scene = generateRetryIdempotentIdDTO.getScene(); String scene = generateRetryIdempotentIdDTO.getScene();
String executorName = generateRetryIdempotentIdDTO.getExecutorName(); String executorName = generateRetryIdempotentIdDTO.getExecutorName();
String argsStr = generateRetryIdempotentIdDTO.getArgsStr(); String argsStr = generateRetryIdempotentIdDTO.getArgsStr();