This is an automated email from the ASF dual-hosted git repository.

jianbin pushed a commit to branch docusaurus
in repository https://gitbox.apache.org/repos/asf/incubator-seata-website.git


The following commit(s) were added to refs/heads/docusaurus by this push:
     new 6152782e23 tcc samples update (#873)
6152782e23 is described below

commit 6152782e23c3431a781e0cdd747bc8fd5b382e9c
Author: sunrui1225 <srs_1...@163.com>
AuthorDate: Mon Jul 15 23:17:49 2024 +0800

    tcc samples update (#873)
---
 .../current/ops/upgrade.md                         |  17 +--
 .../current/user/api.md                            | 145 ++++++++++++++++++++-
 .../version-v2.0/ops/upgrade.md                    |   1 +
 .../version-v2.0/user/api.md                       | 144 +++++++++++++++++++-
 .../current/ops/upgrade.md                         |  53 ++++----
 .../current/user/api.md                            |  26 ++--
 .../version-v2.0/ops/upgrade.md                    |   1 +
 .../version-v2.0/user/api.md                       |  26 ++--
 8 files changed, 351 insertions(+), 62 deletions(-)

diff --git a/i18n/en/docusaurus-plugin-content-docs/current/ops/upgrade.md 
b/i18n/en/docusaurus-plugin-content-docs/current/ops/upgrade.md
index 1bb75e668f..e44917a24c 100644
--- a/i18n/en/docusaurus-plugin-content-docs/current/ops/upgrade.md
+++ b/i18n/en/docusaurus-plugin-content-docs/current/ops/upgrade.md
@@ -38,7 +38,7 @@ description: Seata upgrade.
 <h3 id='9'>9. What compatibility matters need to be paid attention to when 
upgrading to seata 2.1?</h3>
 <details>
    <summary><mark>Notes</mark></summary>
-  
+
   1. After using the Seata 2.0 Raft storage mode, upgrading to 2.1 requires 
logging in to obtain a token, carrying a token to request 
/metadata/v1/cluster?group= in the value of seata.server.raft.group in 
application.yml, and querying the cluster metadata Later. Upgrade the follower 
node first, and then upgrade the leader node. Note: After this upgrade is 
completed, the Raft storage mode is not allowed to be downgraded to 2.0. Please 
fully verify it in the offline environment before upgr [...]
   2.When users upgrade to Seata 2.1, they need to configure the Seata Raft 
authentication information. First, on the Seata server side, add 
/metadata/v1/** to ignore.url to temporarily disable the authentication 
function. Then, on the Seata client side, configure username, password, and 
tokenValidityInMilliseconds in seata.registry.raft in application.yaml or 
registry.conf (note that the username and password on the client side should 
match those configured on the server side, and the to [...]
 </details>
@@ -51,6 +51,7 @@ description: Seata upgrade.
    <summary><mark>Notes</mark></summary>
    If you upgrade from 1.8.x to 2.0.x, if you configure the Undolog or 
communication codec to FST, you need to change the serialization mode to 
something other than FST on the client before you can upgrade it on the server.
    Note: In version 2.0.0 of the server, there is a resource reentry issue in 
AT mode. For example, in a global transaction, if multiple local transactions 
make repeated data modifications that are not the same, registering multiple 
branches can lead to abnormal ordering of the two-phase commit. Therefore, if 
you encounter such scenarios, please refrain from upgrading to version 2.0.0 
and consider upgrading to the latest snapshot or a higher version.
+   The annotation @LocalTCC should be modified on the implementation class, 
and the annotation @TwoPhaseBusinessAction should be modified on the 
implementation class method prepare.
 </details>
 
 ------
@@ -74,9 +75,9 @@ description: Seata upgrade.
   - `lock_table` adds `status` field, and adds `idx_status`, 
`idx_xid_and_branch_id` index.
   - Add `distributed_lock` table for seata-server asynchronous task scheduling.
    Before upgrading to 1.5.0, please pay attention to the table structure 
changes. For details on the table structure, please [click 
here](https://github.com/apache/incubator-seata/tree/1.5.0/script/server/db).
-   
-2. TCC transaction mode adds anti-hanging function in 1.5.0. If you need to 
enable anti-hanging by Seata framework, you need to add [this 
table](https://github.com/apache/incubator-seata/tree/1.5.0/script/client/tcc/db)
 to the client business library in advance. 
-   
+
+2. TCC transaction mode adds anti-hanging function in 1.5.0. If you need to 
enable anti-hanging by Seata framework, you need to add [this 
table](https://github.com/apache/incubator-seata/tree/1.5.0/script/client/tcc/db)
 to the client business library in advance.
+
 3. The first-stage method of TCC mode has been optimized. It is no longer 
necessary to define `BusinessActionContext` as an interface parameter in the 
first stage. If `BusinessActionContext` needs to be used in the first stage, it 
can be obtained through `BusinessActionContextUtil.getContext()`.
 
 4. The internal structure of the redis registration center has been adjusted 
and is no longer backward compatible. If you use redis as the registration 
center of seata, please also upgrade both seata-all (seata-spring-boot-starter) 
and seata-server that the client depends on.
@@ -93,7 +94,7 @@ description: Seata upgrade.
 
 
 1. The Redis data of version 1.3 and 1.4 are incompatible. Since the Redis 
mode reconstructs the data storage structure into hash, users who upgrade from 
1.3 to 1.4 need to wait for all transactions to run completely before iterating.
-       
+
 
 </details>
 
@@ -115,7 +116,7 @@ description: Seata upgrade.
    <summary><mark>Notes</mark></summary>
 
 1. The nacos registration center adds a new service attribute configuration 
`registry.nacos.application` = "seata-server". The original default name is 
serverAddr, and now the default is seata-server. The Server and Client must be 
consistent.
-       
+
 
 </details>
 
@@ -159,9 +160,9 @@ The autoconfig function is supported by itself. Afterwards, 
the autoconfig about
    2. (Required) Add a common index to the branch_id field of the TC side 
table lock_table
    3. (Optional) Some parameter naming changes, <a 
href="/docs/user/configurations100" target="_blank">Click here to check the 
parameter configuration</a>.
    4. client.report.success.enable can be set as false to improve performance.
-      
 
-</details>   
+
+</details>
 
 ********
 
diff --git a/i18n/en/docusaurus-plugin-content-docs/current/user/api.md 
b/i18n/en/docusaurus-plugin-content-docs/current/user/api.md
index 078dab267d..b47df2a1cf 100644
--- a/i18n/en/docusaurus-plugin-content-docs/current/user/api.md
+++ b/i18n/en/docusaurus-plugin-content-docs/current/user/api.md
@@ -9,7 +9,7 @@ description: Api Guide.
 Seata API is devided into 2 categories: High-Level API and Low-Level API
 
 - **High-Level API** : Used for defining and controlling transaction boundary, 
and querying transaction status.
-- **Low-Level API** : Used for controlling the propagation of transaction 
context. 
+- **Low-Level API** : Used for controlling the propagation of transaction 
context.
 
 # 2. High-Level API
 
@@ -257,3 +257,146 @@ Rebind the XID back after the execution of related 
business logic to achieve rec
 RootContext.bind(unbindXid);
 ```
 
+
+
+# 4. TCC API
+
+TCC interface definition
+```java
+public interface NormalTccAction {
+
+    /**
+     * Prepare boolean.
+     *
+     * @param a             the a
+     * @param b             the b
+     * @param tccParam      the tcc param
+     * @return the boolean
+     */
+    String prepare(int a, List b, TccParam tccParam);
+
+    /**
+     * Commit boolean.
+     *
+     * @param actionContext the action context
+     * @return the boolean
+     */
+    boolean commit(BusinessActionContext actionContext, TccParam param);
+
+    /**
+     * Rollback boolean.
+     *
+     * @param actionContext the action context
+     * @return the boolean
+     */
+    boolean rollback(BusinessActionContext actionContext, TccParam param);
+}
+```
+
+TCC interface definition implementation
+```java
+@LocalTCC
+public class NormalTccActionImpl implements NormalTccAction {
+
+    @TwoPhaseBusinessAction(name = "tccActionForTest", commitMethod = 
"commit", rollbackMethod = "rollback", commitArgsClasses = 
{BusinessActionContext.class, TccParam.class}, rollbackArgsClasses = 
{BusinessActionContext.class, TccParam.class})
+    @Override
+    public String prepare(@BusinessActionContextParameter("a") int a,
+                          @BusinessActionContextParameter(paramName = "b", 
index = 0) List b,
+                          @BusinessActionContextParameter(isParamInProperty = 
true) TccParam tccParam) {
+        return "a";
+    }
+
+    @Override
+    public boolean commit(BusinessActionContext actionContext,
+                          @BusinessActionContextParameter("tccParam") TccParam 
param) {
+        return false;
+    }
+
+    @Override
+    public boolean rollback(BusinessActionContext actionContext, 
@BusinessActionContextParameter("tccParam") TccParam param) {
+        return false;
+    }
+
+    public boolean otherMethod(){
+        return true;
+    }
+
+}
+```
+
+TCC API usage
+```java
+    @Test
+    public void testTcc() {
+
+        // Instantiate an un-proxied TCC interface implementation class
+        NormalTccAction tccAction = new NormalTccActionImpl();
+
+        // Create a proxy TCC interface class using the proxy tool ProxyUtil
+        NormalTccAction tccActionProxy = ProxyUtil.createProxy(tccAction);
+
+        // Obtain TCC interface parameters
+        TccParam tccParam = new TccParam(1, "a...@163.com");
+        List<String> listB = Arrays.asList("b");
+
+        // TCC Phase 1 submission
+        String result = tccActionProxy.prepare(0, listB, tccParam);
+
+        // verification
+        Assertions.assertEquals("a", result);
+        Assertions.assertNotNull(result);
+        Assertions.assertEquals("tccActionForTest", branchReference.get());
+
+    }
+```
+Brief description
+- 1,First, define the TCC interface: prepare, confirm, and rollback.
+- 2,Implementation interface. Note: The annotation @LocalTCC should be 
modified on the implementation class, and the annotation 
@TwoPhaseBusinessAction should be modified on the implementation class method 
prepare. You can pass parameters through BusinessActionContext.
+- 3,Create a TCC proxy object using ProxyUtil.createProxy (T target).
+- 4,Commit in phase 1 with the proxy class.
+
+## 4.1 TCC Annotation Description
+
+TCC has two core annotations, TwoPhaseBusinessAction and LocalTCC.
+
+### 4.1.1 @TwoPhaseBusinessAction
+
+@TwoPhaseBusinessAction indicates that the current method uses the TCC mode to 
manage transaction submission.
+
+- The name attribute registers a globally unique TCC bean name for the current 
transaction.
+
+As in the code example, name = "TccActionOne"
+
+The three execution phases of the TCC mode are:
+
+- Try phase, reserve operation resources (Prepare)
+
+The methods executed in this phase are the methods modified by 
@TwoPhaseBusinessAction. For example, the prepare method in the sample code.
+
+- Confirm phase, execute the main business logic (Commit)
+
+This phase uses the method pointed to by the commitMethod attribute to perform 
the Confirm work.
+
+- Cancel phase, transaction rollback (Rollback)
+
+This phase uses the method pointed to by the rollbackMethod attribute to 
perform the Rollback work.
+
+### 4.1.2 @LocalTCC
+The @LocalTCC annotation is used to indicate the local TCC interface that 
implements the two-phase commit. If Dubbo is used as the RPC communication 
component, this annotation is not required.
+
+## 4.2 Important parameter description
+
+## 4.2.1 BusinessActionContext
+You can use this input parameter to pass query parameters in the transaction 
context in TCC mode. The following attributes:
+- xid global transaction id
+- branchId branch transaction id
+- actionName branch resource id, (resource id)
+- actionContext business transfer parameter Map, you can use 
@BusinessActionContextParameter to annotate the parameters that need to be 
passed.
+
+## 4.2.2 @BusinessActionContextParameter
+Use this annotation to annotate the parameters that need to be passed in the 
transaction context. The parameters modified by this annotation will be set in 
BusinessActionContext.
+You can use the getActionContext method of BusinessActionContext to obtain the 
passed business parameter values ​​in the commit and rollback phases.
+As follows:
+```java
+context.getActionContext("id").toString();
+```
diff --git a/i18n/en/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md 
b/i18n/en/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md
index 301139fa6e..6512f24266 100644
--- a/i18n/en/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md
+++ b/i18n/en/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md
@@ -13,4 +13,5 @@ description: Seata upgrade.
    <summary><mark>Notes</mark></summary>
    If you upgrade from 1.8.x to 2.0.x, if you configure the Undolog or 
communication codec to FST, you need to change the serialization mode to 
something other than FST on the client before you can upgrade it on the server.
    Note: In version 2.0.0 of the server, there is a resource reentry issue in 
AT mode. For example, in a global transaction, if multiple local transactions 
make repeated data modifications that are not the same, registering multiple 
branches can lead to abnormal ordering of the two-phase commit. Therefore, if 
you encounter such scenarios, please refrain from upgrading to version 2.0.0 
and consider upgrading to the latest snapshot or a higher version.
+   The annotation @LocalTCC should be modified on the implementation class, 
and the annotation @TwoPhaseBusinessAction should be modified on the 
implementation class method prepare.
 </details>
diff --git a/i18n/en/docusaurus-plugin-content-docs/version-v2.0/user/api.md 
b/i18n/en/docusaurus-plugin-content-docs/version-v2.0/user/api.md
index 078dab267d..5812b3ec42 100644
--- a/i18n/en/docusaurus-plugin-content-docs/version-v2.0/user/api.md
+++ b/i18n/en/docusaurus-plugin-content-docs/version-v2.0/user/api.md
@@ -9,7 +9,7 @@ description: Api Guide.
 Seata API is devided into 2 categories: High-Level API and Low-Level API
 
 - **High-Level API** : Used for defining and controlling transaction boundary, 
and querying transaction status.
-- **Low-Level API** : Used for controlling the propagation of transaction 
context. 
+- **Low-Level API** : Used for controlling the propagation of transaction 
context.
 
 # 2. High-Level API
 
@@ -257,3 +257,145 @@ Rebind the XID back after the execution of related 
business logic to achieve rec
 RootContext.bind(unbindXid);
 ```
 
+
+# 4. TCC API
+
+TCC interface definition
+```java
+public interface NormalTccAction {
+
+    /**
+     * Prepare boolean.
+     *
+     * @param a             the a
+     * @param b             the b
+     * @param tccParam      the tcc param
+     * @return the boolean
+     */
+    String prepare(int a, List b, TccParam tccParam);
+
+    /**
+     * Commit boolean.
+     *
+     * @param actionContext the action context
+     * @return the boolean
+     */
+    boolean commit(BusinessActionContext actionContext, TccParam param);
+
+    /**
+     * Rollback boolean.
+     *
+     * @param actionContext the action context
+     * @return the boolean
+     */
+    boolean rollback(BusinessActionContext actionContext, TccParam param);
+}
+```
+
+TCC interface definition implementation
+```java
+@LocalTCC
+public class NormalTccActionImpl implements NormalTccAction {
+
+    @TwoPhaseBusinessAction(name = "tccActionForTest", commitMethod = 
"commit", rollbackMethod = "rollback", commitArgsClasses = 
{BusinessActionContext.class, TccParam.class}, rollbackArgsClasses = 
{BusinessActionContext.class, TccParam.class})
+    @Override
+    public String prepare(@BusinessActionContextParameter("a") int a,
+                          @BusinessActionContextParameter(paramName = "b", 
index = 0) List b,
+                          @BusinessActionContextParameter(isParamInProperty = 
true) TccParam tccParam) {
+        return "a";
+    }
+
+    @Override
+    public boolean commit(BusinessActionContext actionContext,
+                          @BusinessActionContextParameter("tccParam") TccParam 
param) {
+        return false;
+    }
+
+    @Override
+    public boolean rollback(BusinessActionContext actionContext, 
@BusinessActionContextParameter("tccParam") TccParam param) {
+        return false;
+    }
+
+    public boolean otherMethod(){
+        return true;
+    }
+
+}
+```
+
+TCC API usage
+```java
+    @Test
+    public void testTcc() {
+
+        // Instantiate an un-proxied TCC interface implementation class
+        NormalTccAction tccAction = new NormalTccActionImpl();
+
+        // Create a proxy TCC interface class using the proxy tool ProxyUtil
+        NormalTccAction tccActionProxy = ProxyUtil.createProxy(tccAction);
+
+        // Obtain TCC interface parameters
+        TccParam tccParam = new TccParam(1, "a...@163.com");
+        List<String> listB = Arrays.asList("b");
+
+        // TCC Phase 1 submission
+        String result = tccActionProxy.prepare(0, listB, tccParam);
+
+        // verification
+        Assertions.assertEquals("a", result);
+        Assertions.assertNotNull(result);
+        Assertions.assertEquals("tccActionForTest", branchReference.get());
+
+    }
+```
+Brief description
+- 1,First, define the TCC interface: prepare, confirm, and rollback.
+- 2,Implementation interface. Note: The annotation @LocalTCC should be 
modified on the implementation class, and the annotation 
@TwoPhaseBusinessAction should be modified on the implementation class method 
prepare. You can pass parameters through BusinessActionContext.
+- 3,Create a TCC proxy object using ProxyUtil.createProxy (T target).
+- 4,Commit in phase 1 with the proxy class.
+
+## 4.1 TCC Annotation Description
+
+TCC has two core annotations, TwoPhaseBusinessAction and LocalTCC.
+
+### 4.1.1 @TwoPhaseBusinessAction
+
+@TwoPhaseBusinessAction indicates that the current method uses the TCC mode to 
manage transaction submission.
+
+- The name attribute registers a globally unique TCC bean name for the current 
transaction.
+
+As in the code example, name = "TccActionOne"
+
+The three execution phases of the TCC mode are:
+
+- Try phase, reserve operation resources (Prepare)
+
+The methods executed in this phase are the methods modified by 
@TwoPhaseBusinessAction. For example, the prepare method in the sample code.
+
+- Confirm phase, execute the main business logic (Commit)
+
+This phase uses the method pointed to by the commitMethod attribute to perform 
the Confirm work.
+
+- Cancel phase, transaction rollback (Rollback)
+
+This phase uses the method pointed to by the rollbackMethod attribute to 
perform the Rollback work.
+
+### 4.1.2 @LocalTCC
+The @LocalTCC annotation is used to indicate the local TCC interface that 
implements the two-phase commit. If Dubbo is used as the RPC communication 
component, this annotation is not required.
+
+## 4.2 Important parameter description
+
+## 4.2.1 BusinessActionContext
+You can use this input parameter to pass query parameters in the transaction 
context in TCC mode. The following attributes:
+- xid global transaction id
+- branchId branch transaction id
+- actionName branch resource id, (resource id)
+- actionContext business transfer parameter Map, you can use 
@BusinessActionContextParameter to annotate the parameters that need to be 
passed.
+
+## 4.2.2 @BusinessActionContextParameter
+Use this annotation to annotate the parameters that need to be passed in the 
transaction context. The parameters modified by this annotation will be set in 
BusinessActionContext.
+You can use the getActionContext method of BusinessActionContext to obtain the 
passed business parameter values ​​in the commit and rollback phases.
+As follows:
+```java
+context.getActionContext("id").toString();
+```
diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/ops/upgrade.md 
b/i18n/zh-cn/docusaurus-plugin-content-docs/current/ops/upgrade.md
index 17ab5eabd0..d6d40cc712 100644
--- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/ops/upgrade.md
+++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/ops/upgrade.md
@@ -24,13 +24,13 @@ description: Seata upgrade.
 <a href="#4" target="_self">4. 升级到 seata 1.3.0 有哪些兼容性事项是需要注意的?</a>
 <br/>
 
-<a href="#3" target="_self">3. 升级到 seata 1.2.0 有哪些兼容性事项是需要注意的?</a> 
+<a href="#3" target="_self">3. 升级到 seata 1.2.0 有哪些兼容性事项是需要注意的?</a>
 <br/>
 
 <a href="#2" target="_self">2. 升级到 seata 1.1.0 有哪些兼容性事项是需要注意的?</a>
 <br/>
 
-<a href="#1" target="_self">1. 0.8、0.9版本如何升级到1.0版本?</a>     
+<a href="#1" target="_self">1. 0.8、0.9版本如何升级到1.0版本?</a>
 <br/>
 
 ------
@@ -38,7 +38,7 @@ description: Seata upgrade.
 <h3 id='9'>9. 升级到 seata 2.1 有哪些兼容性事项是需要注意的?</h3>
 <details>
   <summary><mark>注意事项</mark></summary>
-  
+
   1. 使用seata2.0 raft 
存储模式后,升级2.1需要登录后获取token,携带token请求/metadata/v1/cluster?group=在application.yml中的seata.server.raft.group的值,查询到集群元数据后。将follower节点先行升级,再升级leader节点。注:该升级完成后,raft存储模式下是不允许降级至2.0,请在线下环境得到充分验证后再进行生产环境升级。
   2. 用户在升级到seata2.1时需要配置seata raft的鉴权信息,首先在seata 
server端的`ignore.url`中增加`/metadata/v1/**`用以暂时关闭鉴权功能,然后在seata 
client端`application.yaml`或`registry.conf`中的`seata.registry.raft`中配置好`username`和`password`以及`tokenValidityInMilliseconds`(需要注意的是client端的username和password应当与server端所配置的保持一致,client端的tokenValidityInMilliseconds应当略小于你在server端配置的tokenValidityInMilliseconds),最后在server端移除`ignore.url`中的`/metadata/v1/**`用以开启raft元数据鉴权能力。
 </details>
@@ -50,6 +50,7 @@ description: Seata upgrade.
   <summary><mark>注意事项</mark></summary>
   从1.8.x 版本升级2.0.x 
版本,如果undolog或通信编解码的配置为fst都需要先提前在client修改为fst以外的序列化方式,server侧才可进行升级。
   注: 2.0.0的server 
存在at模式下资源重入,比如一个全局事务中,非同一个本地事务进行了多次相同的数据修改,注册了多个分支后会导致二阶段下发顺序异常,故如果有此类场景请勿升级到2.0.0版本,建议升级到最新snapshot或更高版本。
+  注解@LocalTCC要修饰在实现类上,注解@TwoPhaseBusinessAction要修饰在实现类方法prepare上。
 </details>
 
 ------
@@ -73,16 +74,16 @@ description: Seata upgrade.
  - lock_table 增加 status 字段,增加 idx_status,idx_xid_and_branch_id 索引
  - 增加 distributed_lock 表用于 seata-server 异步任务调度
   
升级1.5.0前,请注意表结构变更,表结构详情请[点击此处](https://github.com/apache/incubator-seata/tree/1.5.0/script/server/db)
-   
+
 2. TCC事务模式在1.5.0 增加防悬挂功能,如需由 Seata 
框架开启防悬挂,需要提前在客户端业务库中增加[此表](https://github.com/apache/incubator-seata/tree/1.5.0/script/client/tcc/db)
-   
+
 3. 
TCC模式一阶段方法进行了优化,不再需要在一阶段的接口入参定义`BusinessActionContext`,若一阶段需要使用到`BusinessActionContext`,可以通过`BusinessActionContextUtil.getContext()`取得
 
 4. redis注册中心内部结构调整,不再向下兼容,如使用redis作为seata的注册中心,请将客户端依赖的 
seata-all(seata-spring-boot-starter) 和 seata-server 一并升级。
 
 5. 事务分组配置支持了默认值,为了避免歧义和降低学习成本,默认事务分组的由`my_test_tx_group` 修改为 
`default_tx_group`。在1.5.X的版本中会向下进行兼容。
 
-</details>  
+</details>
 
 ------
 
@@ -92,9 +93,9 @@ description: Seata upgrade.
 
 
 1. 1.3与1.4的Redis数据无法兼容,因Redis模式重构数据存储结构为hash,1.3升级的用户需等待事务全部运行完毕后再做迭代.
-       
 
-</details>  
+
+</details>
 
 ------
 
@@ -105,7 +106,7 @@ description: Seata upgrade.
 1. 
nacos注册中心新增group的属性配置seata.registry.nacos.group,如果无配置,则默认为DEFAULT_GROUP,Server和Client端需保持一致。
 2. mysql 
undolog表去除id字段,与branch_table一并加强时间戳精度,防止undolog回滚时顺序错误导致出现脏数据无法回滚.(注:需要mysql5.6版本以上)
 
-</details>  
+</details>
 
 ********
 
@@ -114,9 +115,9 @@ description: Seata upgrade.
   <summary><mark>注意事项</mark></summary>
 
 1. nacos注册中心新增服务名的属性配置registry.nacos.application = 
"seata-server",原固定名为serverAddr,现默认为seata-server,Server和Client端需保持一致。
-       
 
-</details>  
+
+</details>
 
 ********
 
@@ -125,22 +126,22 @@ description: Seata upgrade.
   <summary><mark>注意事项</mark></summary>
 
 1. 需要注意配置项的兼容性,1.1.0 版本对于配置项的风格进行了统一。
-若程序中依赖的是 seata-all,对应于 *.conf 文件,conf文件中配置项的命名风格统一为 点号+驼峰式组合,[1.1.0 
配置项说明](/docs/user/configurations/), [1.1.0 
配置参考](https://github.com/apache/incubator-seata/tree/1.1.0/script/client/conf); 
-若程序中依赖的是seata-spring-boot-starter,对应于 *.properties 或 *.yml。propertie、 
yml文件命名风格统一为 点号+中划线组合 
+若程序中依赖的是 seata-all,对应于 *.conf 文件,conf文件中配置项的命名风格统一为 点号+驼峰式组合,[1.1.0 
配置项说明](/docs/user/configurations/), [1.1.0 
配置参考](https://github.com/apache/incubator-seata/tree/1.1.0/script/client/conf);
+若程序中依赖的是seata-spring-boot-starter,对应于 *.properties 或 *.yml。propertie、 
yml文件命名风格统一为 点号+中划线组合
 [1.1.0 
配置参考](https://github.com/apache/incubator-seata/tree/1.1.0/script/client/spring)
 需要特别注意的是1.0.0 版本配置项 seata.service
 .vgroup-mapping=default 1.1.0 更改为: seata.service.vgroup-mapping
-.my_test_tx_group=default,其中my_test_tx_group代表程序所使用的事务分组; 1.0.0 
版本配置项seata.service.grouplist=127.0.0.1:8091, 1.1.0 
+.my_test_tx_group=default,其中my_test_tx_group代表程序所使用的事务分组; 1.0.0 
版本配置项seata.service.grouplist=127.0.0.1:8091, 1.1.0
 更改为:seata.service.grouplist.default=127.0.0.1:8091 其中 default 代表 seata注册服务名。
 
 2. seata-all 默认不开启数据源自动代理。原 seata-all中 conf 文件配置项
-client.support.spring.datasource.autoproxy 配置项失效,由注解 
@EnableAutoDataSourceProxy 
+client.support.spring.datasource.autoproxy 配置项失效,由注解 @EnableAutoDataSourceProxy
 注解代替,注解参数可选择使用jdk代理或者cglib代理,当使用HikariDataSource 时推荐使用 cglib 代理模式。
 seata-spring-boot-starter 默认开启数据源代理,对应数据源自动代理配置项与1.0.0 版本保持不变。
 
-3. 使用spring cloud框架时需要使用[Spring Cloud 
Alibaba](https://github.com/alibaba/spring-cloud-alibaba)来进行seata 
-事务上下文的传递,与Spring Cloud Alibaba 版本集成依赖关系,参考 
[版本说明](https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E)
     
-spring-cloud-alibaba-seata 在 2.2.0.RELEASE 版本前 依赖的是seata-all 若继续使用低版本的 
spring-cloud-alibaba-seata 可以使用高版本的 seata-all 取代内置的 seata-all 版本;   
-从spring-cloud-alibaba-seata 在 2.2.0.RELEASE 
开始后(含)内部开始依赖seata-spring-boot-starter,2.2.0.RELEASE 内部集成 
seata-spring-boot-starter 1.0.0 可以升级为 seata-spring-boot-starter 
1.1.0,seata-spring-boot-starter 集成了seata-all,seata-spring-boot-starter 
包装了对于properties或yml 配置的autoconfig 功能,在spring-cloud-alibaba-seata 2.2.0.RELEASE 
前 
+3. 使用spring cloud框架时需要使用[Spring Cloud 
Alibaba](https://github.com/alibaba/spring-cloud-alibaba)来进行seata
+事务上下文的传递,与Spring Cloud Alibaba 版本集成依赖关系,参考 
[版本说明](https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E)
+spring-cloud-alibaba-seata 在 2.2.0.RELEASE 版本前 依赖的是seata-all 若继续使用低版本的 
spring-cloud-alibaba-seata 可以使用高版本的 seata-all 取代内置的 seata-all 版本;
+从spring-cloud-alibaba-seata 在 2.2.0.RELEASE 
开始后(含)内部开始依赖seata-spring-boot-starter,2.2.0.RELEASE 内部集成 
seata-spring-boot-starter 1.0.0 可以升级为 seata-spring-boot-starter 
1.1.0,seata-spring-boot-starter 集成了seata-all,seata-spring-boot-starter 
包装了对于properties或yml 配置的autoconfig 功能,在spring-cloud-alibaba-seata 2.2.0.RELEASE 前
 autoconfig 功能由其本身支持,在其后去掉 spring-cloud-alibaba-seata 中关于 seata 本身的autoconfig 
由seata-spring-boot-starter 支持,因此低版本spring-cloud-alibaba-seata 只能配合 
seata-all使用,高版本spring-cloud-alibaba-seata 只能配合seata-spring-boot-starter 
使用,以2.2.0.RELEASE为分界点。
 
 4. TC端采用 db 存储模式时 branch_table 中增加 gmt_create,gmt_modified 字段的精度,用于精确确认回滚的顺序,
@@ -150,16 +151,16 @@ autoconfig 功能由其本身支持,在其后去掉 spring-cloud-alibaba-seata
 
 ********
 
-<h3 id='1'>1. 0.8、0.9版本如何升级到1.0版本?</h3>   
+<h3 id='1'>1. 0.8、0.9版本如何升级到1.0版本?</h3>
 <details>
   <summary><mark>注意事项</mark></summary>
 
-   1. (可选)1.0支持yml、properties,需用seata-spring-boot-starter替换掉 seata-all   
-   2.  (必选)TC端表lock_table字段branch_id增加普通索引   
-   3. (可选)部分参数命名改动,<a href="/docs/user/configurations100" 
target="_blank">点击查看参数配置</a>   
-   4. (可选) client.report.success.enable可以置为false,提升性能   
-      
+   1. (可选)1.0支持yml、properties,需用seata-spring-boot-starter替换掉 seata-all
+   2.  (必选)TC端表lock_table字段branch_id增加普通索引
+   3. (可选)部分参数命名改动,<a href="/docs/user/configurations100" 
target="_blank">点击查看参数配置</a>
+   4. (可选) client.report.success.enable可以置为false,提升性能
 
-</details>   
+
+</details>
 
 ********
diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/user/api.md 
b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user/api.md
index d05b5d1594..f879a86be3 100644
--- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/user/api.md
+++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user/api.md
@@ -262,7 +262,6 @@ RootContext.bind(unbindXid);
 
 TCC接口定义
 ```java
-@LocalTCC
 public interface NormalTccAction {
 
     /**
@@ -273,10 +272,7 @@ public interface NormalTccAction {
      * @param tccParam      the tcc param
      * @return the boolean
      */
-    @TwoPhaseBusinessAction(name = "tccActionForTest", commitMethod = 
"commit", rollbackMethod = "rollback", commitArgsClasses = 
{BusinessActionContext.class, TccParam.class}, rollbackArgsClasses = 
{BusinessActionContext.class, TccParam.class})
-    String prepare(@BusinessActionContextParameter("a") int a,
-                    @BusinessActionContextParameter(paramName = "b", index = 
0) List b,
-                    @BusinessActionContextParameter(isParamInProperty = true) 
TccParam tccParam);
+    String prepare(int a, List b, TccParam tccParam);
 
     /**
      * Commit boolean.
@@ -284,8 +280,7 @@ public interface NormalTccAction {
      * @param actionContext the action context
      * @return the boolean
      */
-    boolean commit(BusinessActionContext actionContext,
-                   @BusinessActionContextParameter("tccParam") TccParam param);
+    boolean commit(BusinessActionContext actionContext, TccParam param);
 
     /**
      * Rollback boolean.
@@ -293,26 +288,31 @@ public interface NormalTccAction {
      * @param actionContext the action context
      * @return the boolean
      */
-    boolean rollback(BusinessActionContext actionContext, 
@BusinessActionContextParameter("tccParam") TccParam param);
+    boolean rollback(BusinessActionContext actionContext, TccParam param);
 }
 ```
 
 TCC接口定义实现
 ```java
+@LocalTCC
 public class NormalTccActionImpl implements NormalTccAction {
 
+    @TwoPhaseBusinessAction(name = "tccActionForTest", commitMethod = 
"commit", rollbackMethod = "rollback", commitArgsClasses = 
{BusinessActionContext.class, TccParam.class}, rollbackArgsClasses = 
{BusinessActionContext.class, TccParam.class})
     @Override
-    public String prepare(int a, List b, TccParam tccParam) {
+    public String prepare(@BusinessActionContextParameter("a") int a,
+                          @BusinessActionContextParameter(paramName = "b", 
index = 0) List b,
+                          @BusinessActionContextParameter(isParamInProperty = 
true) TccParam tccParam) {
         return "a";
     }
 
     @Override
-    public boolean commit(BusinessActionContext actionContext, TccParam param) 
{
+    public boolean commit(BusinessActionContext actionContext,
+                          @BusinessActionContextParameter("tccParam") TccParam 
param) {
         return false;
     }
 
     @Override
-    public boolean rollback(BusinessActionContext actionContext, TccParam 
param) {
+    public boolean rollback(BusinessActionContext actionContext, 
@BusinessActionContextParameter("tccParam") TccParam param) {
         return false;
     }
 
@@ -349,8 +349,8 @@ TCC API 使用方式
     }
 ```
 简述说明
-- 1,首先定义TCC接口,prepare(@TwoPhaseBusinessAction修饰),confirm,rollback。
-- 2,实现接口,可以通过BusinessActionContext来传递参数。
+- 1,首先定义TCC接口,prepare,confirm,rollback。
+- 
2,实现接口,注意:注解@LocalTCC要修饰在实现类上,注解@TwoPhaseBusinessAction要修饰在实现类方法prepare上,可以通过BusinessActionContext来传递参数。
 - 3,用ProxyUtil.createProxy(T 
target)创建TCC代理对象。(io.seata.integration.tx.api.util.ProxyUtil)
 - 4,用代理类一阶段提交。
 
diff --git 
a/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md 
b/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md
index 89b846adbd..d4c62e905d 100644
--- a/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md
+++ b/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/ops/upgrade.md
@@ -13,4 +13,5 @@ description: Seata upgrade.
   <summary><mark>注意事项</mark></summary>
   从1.8.x 版本升级2.0.x 
版本,如果undolog或通信编解码为fst都需要先提前在client修改为fst以外的序列化方式,server侧才可进行升级。
   注: 2.0.0的server 
存在at模式下资源重入,比如一个全局事务中,非同一个本地事务进行了多次相同的数据修改,注册了多个分支后会导致二阶段下发顺序异常,故如果有此类场景请勿升级到2.0.0版本,建议升级到最新snapshot或更高版本。
+  注解@LocalTCC要修饰在实现类上,注解@TwoPhaseBusinessAction要修饰在实现类方法prepare上。
 </details>
diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/user/api.md 
b/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/user/api.md
index 558a0213af..83abe00125 100644
--- a/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/user/api.md
+++ b/i18n/zh-cn/docusaurus-plugin-content-docs/version-v2.0/user/api.md
@@ -263,7 +263,6 @@ RootContext.bind(unbindXid);
 
 TCC接口定义
 ```java
-@LocalTCC
 public interface NormalTccAction {
 
     /**
@@ -274,10 +273,7 @@ public interface NormalTccAction {
      * @param tccParam      the tcc param
      * @return the boolean
      */
-    @TwoPhaseBusinessAction(name = "tccActionForTest", commitMethod = 
"commit", rollbackMethod = "rollback", commitArgsClasses = 
{BusinessActionContext.class, TccParam.class}, rollbackArgsClasses = 
{BusinessActionContext.class, TccParam.class})
-    String prepare(@BusinessActionContextParameter("a") int a,
-                    @BusinessActionContextParameter(paramName = "b", index = 
0) List b,
-                    @BusinessActionContextParameter(isParamInProperty = true) 
TccParam tccParam);
+    String prepare(int a, List b, TccParam tccParam);
 
     /**
      * Commit boolean.
@@ -285,8 +281,7 @@ public interface NormalTccAction {
      * @param actionContext the action context
      * @return the boolean
      */
-    boolean commit(BusinessActionContext actionContext,
-                   @BusinessActionContextParameter("tccParam") TccParam param);
+    boolean commit(BusinessActionContext actionContext, TccParam param);
 
     /**
      * Rollback boolean.
@@ -294,26 +289,31 @@ public interface NormalTccAction {
      * @param actionContext the action context
      * @return the boolean
      */
-    boolean rollback(BusinessActionContext actionContext, 
@BusinessActionContextParameter("tccParam") TccParam param);
+    boolean rollback(BusinessActionContext actionContext, TccParam param);
 }
 ```
 
 TCC接口定义实现
 ```java
+@LocalTCC
 public class NormalTccActionImpl implements NormalTccAction {
 
+    @TwoPhaseBusinessAction(name = "tccActionForTest", commitMethod = 
"commit", rollbackMethod = "rollback", commitArgsClasses = 
{BusinessActionContext.class, TccParam.class}, rollbackArgsClasses = 
{BusinessActionContext.class, TccParam.class})
     @Override
-    public String prepare(int a, List b, TccParam tccParam) {
+    public String prepare(@BusinessActionContextParameter("a") int a,
+                          @BusinessActionContextParameter(paramName = "b", 
index = 0) List b,
+                          @BusinessActionContextParameter(isParamInProperty = 
true) TccParam tccParam) {
         return "a";
     }
 
     @Override
-    public boolean commit(BusinessActionContext actionContext, TccParam param) 
{
+    public boolean commit(BusinessActionContext actionContext,
+                          @BusinessActionContextParameter("tccParam") TccParam 
param) {
         return false;
     }
 
     @Override
-    public boolean rollback(BusinessActionContext actionContext, TccParam 
param) {
+    public boolean rollback(BusinessActionContext actionContext, 
@BusinessActionContextParameter("tccParam") TccParam param) {
         return false;
     }
 
@@ -350,8 +350,8 @@ TCC API 使用方式
     }
 ```
 简述说明
-- 1,首先定义TCC接口,prepare(@TwoPhaseBusinessAction修饰),confirm,rollback。
-- 2,实现接口,可以通过BusinessActionContext来传递参数。
+- 1,首先定义TCC接口,prepare,confirm,rollback。
+- 
2,实现接口,注意:注解@LocalTCC要修饰在实现类上,注解@TwoPhaseBusinessAction要修饰在实现类方法prepare上,可以通过BusinessActionContext来传递参数。
 - 3,用ProxyUtil.createProxy(T 
target)创建TCC代理对象。(io.seata.integration.tx.api.util.ProxyUtil)
 - 4,用代理类一阶段提交。
 


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org


Reply via email to