Skip to content

Commit

Permalink
fix localTcc anno
Browse files Browse the repository at this point in the history
  • Loading branch information
wt-better committed Nov 26, 2024
1 parent 63eb2da commit 9e14500
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.apache.seata.saga.annotation;

import org.apache.seata.rm.tcc.api.BusinessActionContext;
import org.apache.seata.rm.tcc.api.BusinessActionContextParameter;

import java.util.List;

Expand All @@ -27,16 +26,13 @@
public interface NormalSagaAnnotationAction {


boolean commit(BusinessActionContext actionContext,
@BusinessActionContextParameter("a") int a,
@BusinessActionContextParameter(paramName = "b", index = 0) List b,
@BusinessActionContextParameter(isParamInProperty = true) SagaParam sagaParam);
boolean commit(BusinessActionContext actionContext, int a, List b, SagaParam sagaParam);

/**
* Rollback boolean.
*
* @param actionContext the action context
* @return the boolean
*/
boolean compensation(BusinessActionContext actionContext, @BusinessActionContextParameter("sagaParam") SagaParam param);
boolean compensation(BusinessActionContext actionContext, SagaParam param);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
*/
package org.apache.seata.saga.annotation;

import java.util.List;
import org.apache.seata.rm.tcc.api.BusinessActionContext;
import org.apache.seata.rm.tcc.api.BusinessActionContextParameter;
import org.apache.seata.saga.rm.api.CompensationBusinessAction;

import java.util.List;

/**
*
*/
Expand All @@ -30,13 +32,13 @@ public class NormalSagaAnnotationActionImpl implements NormalSagaAnnotationActio

@Override
@CompensationBusinessAction(name = "sagaActionForTest", compensationMethod = "compensation", compensationArgsClasses = {BusinessActionContext.class, SagaParam.class})
public boolean commit(BusinessActionContext actionContext, int a, List b, SagaParam sagaParam) {
public boolean commit(BusinessActionContext actionContext, @BusinessActionContextParameter("a") int a, @BusinessActionContextParameter(paramName = "b", index = 0) List b, @BusinessActionContextParameter(isParamInProperty = true) SagaParam sagaParam) {
isCommit = true;
return a > 1;
}

@Override
public boolean compensation(BusinessActionContext actionContext, SagaParam param) {
public boolean compensation(BusinessActionContext actionContext, @BusinessActionContextParameter("sagaParam") SagaParam param) {
isCommit = false;
return true;
}
Expand Down

0 comments on commit 9e14500

Please sign in to comment.