gtsoft-snail-job-demo/src/main/java/com/example/easy/retry/customized/OrderIdempotentIdGenerate.java

22 lines
646 B
Java
Raw Normal View History

2023-09-02 17:24:47 +08:00
package com.example.easy.retry.customized;
import org.apache.catalina.security.SecurityUtil;
import com.aizuda.easy.retry.client.core.IdempotentIdGenerate;
import com.aizuda.easy.retry.common.core.model.IdempotentIdContext;
import com.example.easy.retry.vo.OrderVo;
import cn.hutool.crypto.SecureUtil;
public class OrderIdempotentIdGenerate implements IdempotentIdGenerate {
@Override
public String idGenerate(IdempotentIdContext idempotentIdContext) throws Exception {
Object[] args = idempotentIdContext.getArgs();
OrderVo orderVo = (OrderVo) args[0];
return SecureUtil.md5(orderVo.getOrderId());
}
}