Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit84492b9

Browse files
committed
fix: trans options bug
1 parentc6c0742 commit84492b9

File tree

4 files changed

+142
-57
lines changed

4 files changed

+142
-57
lines changed

‎src/Dtmcli/DtmImp/AbstTrans.cs‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎src/Dtmcli/Msg/Msg.cs‎

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88

99
namespaceDtmcli
1010
{
11-
publicclassMsg:DtmImp.AbstTrans
11+
publicclassMsg
1212
{
13+
privatereadonlyDtmImp.TransBase_transBase;
14+
privatereadonlyIDtmClient_dtmClient;
15+
1316
publicMsg(IDtmClientdtmHttpClient,stringgid)
1417
{
1518
this._dtmClient=dtmHttpClient;
@@ -109,5 +112,48 @@ private async Task<Exception> RespAsErrorCompatible(HttpResponseMessage resp)
109112

110113
returnnull;
111114
}
115+
116+
/// <summary>
117+
/// Enable wait result for trans
118+
/// </summary>
119+
/// <returns></returns>
120+
publicMsgEnableWaitResult()
121+
{
122+
this._transBase.WaitResult=true;
123+
returnthis;
124+
}
125+
126+
/// <summary>
127+
/// Set timeout to fail for trans, unit is second
128+
/// </summary>
129+
/// <param name="timeoutToFail">timeout to fail</param>
130+
/// <returns></returns>
131+
publicMsgSetTimeoutToFail(longtimeoutToFail)
132+
{
133+
this._transBase.TimeoutToFail=timeoutToFail;
134+
returnthis;
135+
}
136+
137+
/// <summary>
138+
/// Set retry interval for trans, unit is second
139+
/// </summary>
140+
/// <param name="retryInterval"></param>
141+
/// <returns></returns>
142+
publicMsgSetRetryInterval(longretryInterval)
143+
{
144+
this._transBase.RetryInterval=retryInterval;
145+
returnthis;
146+
}
147+
148+
/// <summary>
149+
/// Set branch headers for trans
150+
/// </summary>
151+
/// <param name="headers"></param>
152+
/// <returns></returns>
153+
publicMsgSetBranchHeaders(Dictionary<string,string>headers)
154+
{
155+
this._transBase.BranchHeaders=headers;
156+
returnthis;
157+
}
112158
}
113159
}

‎src/Dtmcli/Saga/Saga.cs‎

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77

88
namespaceDtmcli
99
{
10-
publicclassSaga:DtmImp.AbstTrans
10+
publicclassSaga
1111
{
1212
privatebool_concurrent=false;
1313
privateDictionary<int,List<int>>_orders=newDictionary<int,List<int>>();
1414

15+
privatereadonlyDtmImp.TransBase_transBase;
16+
privatereadonlyIDtmClient_dtmClient;
17+
1518
publicSaga(IDtmClientdtmHttpClient,stringgid)
1619
{
1720
this._dtmClient=dtmHttpClient;
@@ -51,5 +54,48 @@ public async Task<bool> Submit(CancellationToken cancellationToken = default)
5154
}
5255

5356
internalDtmImp.TransBaseGetTransBase()=>this._transBase;
57+
58+
/// <summary>
59+
/// Enable wait result for trans
60+
/// </summary>
61+
/// <returns></returns>
62+
publicSagaEnableWaitResult()
63+
{
64+
this._transBase.WaitResult=true;
65+
returnthis;
66+
}
67+
68+
/// <summary>
69+
/// Set timeout to fail for trans, unit is second
70+
/// </summary>
71+
/// <param name="timeoutToFail">timeout to fail</param>
72+
/// <returns></returns>
73+
publicSagaSetTimeoutToFail(longtimeoutToFail)
74+
{
75+
this._transBase.TimeoutToFail=timeoutToFail;
76+
returnthis;
77+
}
78+
79+
/// <summary>
80+
/// Set retry interval for trans, unit is second
81+
/// </summary>
82+
/// <param name="retryInterval"></param>
83+
/// <returns></returns>
84+
publicSagaSetRetryInterval(longretryInterval)
85+
{
86+
this._transBase.RetryInterval=retryInterval;
87+
returnthis;
88+
}
89+
90+
/// <summary>
91+
/// Set branch headers for trans
92+
/// </summary>
93+
/// <param name="headers"></param>
94+
/// <returns></returns>
95+
publicSagaSetBranchHeaders(Dictionary<string,string>headers)
96+
{
97+
this._transBase.BranchHeaders=headers;
98+
returnthis;
99+
}
54100
}
55101
}

‎src/Dtmcli/Tcc/Tcc.cs‎

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55

66
namespaceDtmcli
77
{
8-
publicclassTcc:DtmImp.AbstTrans
8+
publicclassTcc
99
{
10+
privatereadonlyDtmImp.TransBase_transBase;
11+
privatereadonlyIDtmClient_dtmClient;
12+
1013
publicTcc(IDtmClientdtmHttpClient,DtmImp.TransBasetransBase)
1114
{
1215
this._dtmClient=dtmHttpClient;
@@ -48,6 +51,49 @@ public async Task<string> CallBranch(object body, string tryUrl, string confirmU
4851
returncontent;
4952
}
5053

51-
internalDtmImp.TransBaseGetTransBase()=>_transBase;
54+
internalDtmImp.TransBaseGetTransBase()=>_transBase;
55+
56+
/// <summary>
57+
/// Enable wait result for trans
58+
/// </summary>
59+
/// <returns></returns>
60+
publicTccEnableWaitResult()
61+
{
62+
this._transBase.WaitResult=true;
63+
returnthis;
64+
}
65+
66+
/// <summary>
67+
/// Set timeout to fail for trans, unit is second
68+
/// </summary>
69+
/// <param name="timeoutToFail">timeout to fail</param>
70+
/// <returns></returns>
71+
publicTccSetTimeoutToFail(longtimeoutToFail)
72+
{
73+
this._transBase.TimeoutToFail=timeoutToFail;
74+
returnthis;
75+
}
76+
77+
/// <summary>
78+
/// Set retry interval for trans, unit is second
79+
/// </summary>
80+
/// <param name="retryInterval"></param>
81+
/// <returns></returns>
82+
publicTccSetRetryInterval(longretryInterval)
83+
{
84+
this._transBase.RetryInterval=retryInterval;
85+
returnthis;
86+
}
87+
88+
/// <summary>
89+
/// Set branch headers for trans
90+
/// </summary>
91+
/// <param name="headers"></param>
92+
/// <returns></returns>
93+
publicTccSetBranchHeaders(Dictionary<string,string>headers)
94+
{
95+
this._transBase.BranchHeaders=headers;
96+
returnthis;
97+
}
5298
}
5399
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp