Skip to content

Commit 86808ba

Browse files
authored
Merge pull request #34 from catcherwong/depend-and-const
upgrading dependencies and make some string to static readonly
2 parents 4317130 + 402c016 commit 86808ba

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Dtmcli/DtmClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class DtmClient : IDtmClient
1414
{
1515
private static readonly char Slash = '/';
1616
private static readonly string QueryStringFormat = "dtm={0}&gid={1}&trans_type={2}&branch_id={3}&op={4}";
17+
private static readonly string QuestionMark = "?";
18+
private static readonly string And = "&";
1719

1820
private readonly IHttpClientFactory _httpClientFactory;
1921
private readonly DtmOptions _dtmOptions;
@@ -82,8 +84,8 @@ public async Task<HttpResponseMessage> TransRequestBranch(TransBase tb, HttpMeth
8284

8385
var client = _httpClientFactory.CreateClient(Constant.BranchClientHttpName);
8486

85-
if (url.Contains("?")) url = string.Concat(url, "&" ,queryParams);
86-
else url = string.Concat(url, "?", queryParams);
87+
if (url.Contains(QuestionMark)) url = string.Concat(url, And, queryParams);
88+
else url = string.Concat(url, QuestionMark, queryParams);
8789

8890
var httpRequestMsg = new HttpRequestMessage(method, url);
8991
foreach (var item in tb.BranchHeaders ?? new Dictionary<string, string>())

src/Dtmcli/Dtmcli.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</ItemGroup>
2525

2626
<ItemGroup>
27-
<PackageReference Include="DtmCommon" Version="0.5.0" />
27+
<PackageReference Include="DtmCommon" Version="1.0.0" />
2828
</ItemGroup>
2929

3030
</Project>

0 commit comments

Comments
 (0)