事务补偿控制

This commit is contained in:
ChaosCoffee 2018-06-29 16:25:26 +08:00
parent 39fc963336
commit c2f25c0a9b
2 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,7 @@
package com.raincat.common.bean.adapter;
import com.raincat.common.enums.CompensationOperationTypeEnum;
import com.raincat.common.enums.TransactionStatusEnum;
import lombok.Data;
@ -85,5 +86,14 @@ public class TransactionRecoverAdapter {
*/
private String targetMethod;
/***
* 任务完成标志
*/
private String completeFlag;
/**
* 日志更新操作 {@link CompensationOperationTypeEnum }
*/
private int operation;
}

View File

@ -26,6 +26,7 @@ import com.raincat.common.serializer.ObjectSerializer;
/**
* TransactionRecoverUtils.
*
* @author xiaoyu(Myth)
*/
public class TransactionRecoverUtils {
@ -44,6 +45,8 @@ public class TransactionRecoverUtils {
adapter.setCreateTime(transactionRecover.getCreateTime());
adapter.setContents(objectSerializer.serialize(transactionInvocation));
adapter.setVersion(transactionRecover.getVersion());
adapter.setCompleteFlag(transactionRecover.getCompleteFlag());
adapter.setOperation(transactionRecover.getOperation());
return objectSerializer.serialize(adapter);
}
@ -58,6 +61,8 @@ public class TransactionRecoverUtils {
transactionRecover.setTaskId(adapter.getTaskId());
transactionRecover.setStatus(adapter.getStatus());
transactionRecover.setVersion(adapter.getVersion());
transactionRecover.setCompleteFlag(adapter.getCompleteFlag());
transactionRecover.setOperation(adapter.getOperation());
return transactionRecover;
}
@ -74,6 +79,8 @@ public class TransactionRecoverUtils {
transactionRecover.setStatus(adapter.getStatus());
transactionRecover.setTransactionInvocation(transactionInvocation);
transactionRecover.setVersion(adapter.getVersion());
transactionRecover.setCompleteFlag(adapter.getCompleteFlag());
transactionRecover.setOperation(adapter.getOperation());
return transactionRecover;
}
}