Skip to content

Commit c8e16d1

Browse files
authored
Merge pull request #223 from dotnetcore/codex/update-comments-to-english
Clarify parameter documentation throughout services
2 parents d5caea5 + 5f3c0ca commit c8e16d1

File tree

66 files changed

+622
-594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+622
-594
lines changed

src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.xml

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AgileConfig.Server.Apisite/Appsettings.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ namespace AgileConfig.Server.Apisite
66
public class Appsettings
77
{
88
/// <summary>
9-
/// 是否演示模式
9+
/// Indicates whether the server runs in demo mode.
1010
/// </summary>
1111
public static bool IsPreviewMode => "true".Equals(Global.Config["preview_mode"], StringComparison.CurrentCultureIgnoreCase);
1212
/// <summary>
13-
/// 是否控制台模式
13+
/// Indicates whether the admin console mode is enabled.
1414
/// </summary>
1515
public static bool IsAdminConsoleMode => "true".Equals(Global.Config["adminConsole"], StringComparison.CurrentCultureIgnoreCase);
1616

1717
/// <summary>
18-
/// 是否自动加入节点列表
18+
/// Indicates whether the cluster auto-join feature is enabled.
1919
/// </summary>
2020
public static bool Cluster => "true".Equals(Global.Config["cluster"], StringComparison.CurrentCultureIgnoreCase);
2121

@@ -25,7 +25,7 @@ public class Appsettings
2525
public static string PathBase => Global.Config["pathBase"];
2626

2727
/// <summary>
28-
/// 是否开启SSO
28+
/// Indicates whether single sign-on is enabled.
2929
/// </summary>
3030
public static bool SsoEnabled => "true".Equals(Global.Config["SSO:enabled"], StringComparison.CurrentCultureIgnoreCase);
3131

src/AgileConfig.Server.Apisite/Controllers/AdminController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public IActionResult PasswordInited()
171171
}
172172

173173
/// <summary>
174-
/// 初始化密码
174+
/// Initialize the administrator password.
175175
/// </summary>
176176
/// <returns></returns>
177177
[HttpPost]

src/AgileConfig.Server.Apisite/Controllers/AppController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public async Task<IActionResult> Delete(string id)
294294
}
295295

296296
/// <summary>
297-
/// 获取所有可以继承的app
297+
/// Get all applications that can be inherited.
298298
/// </summary>
299299
/// <returns></returns>
300300
[HttpGet]
@@ -305,7 +305,7 @@ public async Task<IActionResult> InheritancedApps(string currentAppId)
305305
var self = apps.FirstOrDefault(a => a.Id == currentAppId);
306306
if (self != null)
307307
{
308-
//过滤本身
308+
// Exclude the current application itself.
309309
apps.Remove(self);
310310
}
311311

@@ -326,10 +326,10 @@ public async Task<IActionResult> InheritancedApps(string currentAppId)
326326
}
327327

328328
/// <summary>
329-
/// 保存app的授权信息
329+
/// Save application authorization information.
330330
/// </summary>
331-
/// <param name="model"></param>
332-
/// <returns></returns>
331+
/// <param name="model">View model containing authorization assignments.</param>
332+
/// <returns>Operation result.</returns>
333333
[TypeFilter(typeof(PermissionCheckAttribute), Arguments = new object[] { "App.Auth", Functions.App_Auth })]
334334
[HttpPost]
335335
public async Task<IActionResult> SaveAppAuth([FromBody] AppAuthVM model)

src/AgileConfig.Server.Apisite/Controllers/ConfigController.cs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ public async Task<IActionResult> Edit([FromBody] ConfigVM model, [FromQuery] Env
226226
var isPublished = await _configService.IsPublishedAsync(config.Id, env.Value);
227227
if (isPublished)
228228
{
229-
//如果是已发布的配置,修改后状态设置为编辑
229+
// When an already published configuration is modified, mark it as edited.
230230
config.EditStatus = EditStatus.Edit;
231231
}
232232
else
233233
{
234-
//如果没有发布,说明是新增的,一直维持新增状态
234+
// If it has never been published, keep the status as added.
235235
config.EditStatus = EditStatus.Add;
236236
}
237237

@@ -253,11 +253,11 @@ public async Task<IActionResult> Edit([FromBody] ConfigVM model, [FromQuery] Env
253253
}
254254

255255
/// <summary>
256-
/// 是否只是修改了描述信息
256+
/// Determine whether only the description field changed.
257257
/// </summary>
258-
/// <param name="newConfig"></param>
259-
/// <param name="oldConfig"></param>
260-
/// <returns></returns>
258+
/// <param name="newConfig">Configuration submitted by the client.</param>
259+
/// <param name="oldConfig">Existing configuration stored in the database.</param>
260+
/// <returns>True when only the description differs.</returns>
261261
private bool IsOnlyUpdateDescription(Config newConfig, Config oldConfig)
262262
{
263263
return newConfig.Key == oldConfig.Key && newConfig.Group == oldConfig.Group &&
@@ -279,14 +279,14 @@ public async Task<IActionResult> All(string env)
279279
}
280280

281281
/// <summary>
282-
/// 按多条件进行搜索
282+
/// Search configurations with multiple filter conditions.
283283
/// </summary>
284-
/// <param name="appId">应用id</param>
285-
/// <param name="group">分组</param>
286-
/// <param name="key"></param>
287-
/// <param name="onlineStatus">在线状态</param>
288-
/// <param name="pageSize">分页大小</param>
289-
/// <param name="current">当前页</param>
284+
/// <param name="appId">Application ID.</param>
285+
/// <param name="group">Configuration group.</param>
286+
/// <param name="key">Configuration key.</param>
287+
/// <param name="onlineStatus">Filter by online status.</param>
288+
/// <param name="pageSize">Number of items per page.</param>
289+
/// <param name="current">Current page number.</param>
290290
/// <returns></returns>
291291
[HttpGet]
292292
public async Task<IActionResult> Search(string appId, string group, string key, OnlineStatus? onlineStatus,
@@ -390,7 +390,7 @@ public async Task<IActionResult> Delete(string id, EnvString env)
390390
var isPublished = await _configService.IsPublishedAsync(config.Id, env.Value);
391391
if (!isPublished)
392392
{
393-
//如果已经没有发布过直接删掉
393+
// If it has never been published, remove it directly.
394394
config.Status = ConfigStatus.Deleted;
395395
}
396396

@@ -437,7 +437,7 @@ public async Task<IActionResult> DeleteSome([FromBody] List<string> ids, EnvStri
437437
var isPublished = await _configService.IsPublishedAsync(config.Id, env.Value);
438438
if (!isPublished)
439439
{
440-
//如果已经没有发布过直接删掉
440+
// If it has never been published, remove it directly.
441441
config.Status = ConfigStatus.Deleted;
442442
}
443443

@@ -514,7 +514,7 @@ public async Task<IActionResult> ConfigPublishedHistory(string configId, EnvStri
514514
}
515515

516516
/// <summary>
517-
/// 发布所有待发布的配置项
517+
/// Publish all pending configuration items.
518518
/// </summary>
519519
/// <returns></returns>
520520
[TypeFilter(typeof(PermissionCheckAttribute),
@@ -550,7 +550,7 @@ public async Task<IActionResult> Publish([FromBody] PublishLogVM model, EnvStrin
550550
}
551551

552552
/// <summary>
553-
/// 预览上传的json文件
553+
/// Preview an uploaded JSON configuration file.
554554
/// </summary>
555555
/// <returns></returns>
556556
public IActionResult PreViewJsonFile()
@@ -578,7 +578,7 @@ public IActionResult PreViewJsonFile()
578578
var paths = key.Split(":");
579579
if (paths.Length > 1)
580580
{
581-
//如果是复杂key,取最后一个为真正的key,其他作为group
581+
// For hierarchical keys, use the last segment as the key and the rest as the group.
582582
newKey = paths[paths.Length - 1];
583583
group = string.Join(":", paths.ToList().Take(paths.Length - 1));
584584
}
@@ -601,9 +601,9 @@ public IActionResult PreViewJsonFile()
601601
}
602602

603603
/// <summary>
604-
/// 导出json文件
604+
/// Export an application's configurations as a JSON file.
605605
/// </summary>
606-
/// <param name="appId">应用id</param>
606+
/// <param name="appId">Application ID.</param>
607607
/// <returns></returns>
608608
public async Task<IActionResult> ExportJson(string appId, EnvString env)
609609
{
@@ -627,9 +627,9 @@ public async Task<IActionResult> ExportJson(string appId, EnvString env)
627627
}
628628

629629
/// <summary>
630-
/// 获取待发布的明细
630+
/// Get counts of configuration changes that are waiting to be published.
631631
/// </summary>
632-
/// <param name="appId">应用id</param>
632+
/// <param name="appId">Application ID.</param>
633633
/// <returns></returns>
634634
public async Task<IActionResult> WaitPublishStatus(string appId, EnvString env)
635635
{
@@ -659,9 +659,9 @@ public async Task<IActionResult> WaitPublishStatus(string appId, EnvString env)
659659
}
660660

661661
/// <summary>
662-
/// 获取发布详情的历史
662+
/// Retrieve the publish history details for an application.
663663
/// </summary>
664-
/// <param name="appId"></param>
664+
/// <param name="appId">Application ID.</param>
665665
/// <returns></returns>
666666
public async Task<IActionResult> PublishHistory(string appId, EnvString env)
667667
{
@@ -781,7 +781,7 @@ public async Task<IActionResult> GetKvList(string appId, EnvString env)
781781
}
782782

783783
var configs = await _configService.GetByAppIdAsync(appId, env.Value);
784-
// text 格式展示的时候不需要删除的配置
784+
// When displaying text format, exclude deleted configurations.
785785
configs = configs.Where(x => x.EditStatus != EditStatus.Deleted).ToList();
786786
var kvList = new List<KeyValuePair<string, string>>();
787787
foreach (var config in configs)
@@ -798,9 +798,9 @@ public async Task<IActionResult> GetKvList(string appId, EnvString env)
798798
}
799799

800800
/// <summary>
801-
/// 获取json格式的配置
801+
/// Get configuration content in JSON format.
802802
/// </summary>
803-
/// <param name="appId">应用id</param>
803+
/// <param name="appId">Application ID.</param>
804804
/// <returns></returns>
805805
public async Task<IActionResult> GetJson(string appId, EnvString env)
806806
{
@@ -810,7 +810,7 @@ public async Task<IActionResult> GetJson(string appId, EnvString env)
810810
}
811811

812812
var configs = await _configService.GetByAppIdAsync(appId, env.Value);
813-
// json 格式展示的时候不需要删除的配置
813+
// When producing JSON, exclude deleted configurations.
814814
configs = configs.Where(x => x.EditStatus != EditStatus.Deleted).ToList();
815815
var dict = new Dictionary<string, string>();
816816
configs.ForEach(x =>

src/AgileConfig.Server.Apisite/Controllers/RemoteOPController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace AgileConfig.Server.Apisite.Controllers
1010
{
1111
/// <summary>
12-
/// 这个Controller用来接受其它节点发送过来的命令
12+
/// Receives commands sent from other nodes.
1313
/// </summary>
1414
public class RemoteOpController : Controller
1515
{

src/AgileConfig.Server.Apisite/Controllers/RemoteServerProxyController.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace AgileConfig.Server.Apisite.Controllers
1515
{
1616
/// <summary>
17-
/// 这个Controller是控制台网页跟后台的接口,不要跟RemoteOp那个Controller混淆
17+
/// Handles console web requests that proxy operations to remote server nodes (distinct from RemoteOpController).
1818
/// </summary>
1919
[Authorize]
2020
public class RemoteServerProxyController : Controller
@@ -35,11 +35,11 @@ ITinyEventBus tinyEventBus
3535
}
3636

3737
/// <summary>
38-
/// 通知一个节点的某个客户端离线
38+
/// Notify a node to disconnect a specific client.
3939
/// </summary>
40-
/// <param name="address"></param>
41-
/// <param name="clientId"></param>
42-
/// <returns></returns>
40+
/// <param name="address">Remote node address.</param>
41+
/// <param name="clientId">Client identifier to disconnect.</param>
42+
/// <returns>Operation result.</returns>
4343
[HttpPost]
4444
public async Task<IActionResult> Client_Offline(string address, string clientId)
4545
{
@@ -69,10 +69,10 @@ public async Task<IActionResult> Client_Offline(string address, string clientId)
6969
}
7070

7171
/// <summary>
72-
/// 通知某个节点让所有的客户端刷新配置项
72+
/// Notify a node to instruct all clients to reload configuration.
7373
/// </summary>
74-
/// <param name="address"></param>
75-
/// <returns></returns>
74+
/// <param name="address">Remote node address.</param>
75+
/// <returns>Operation result.</returns>
7676
[HttpPost]
7777
public async Task<IActionResult> AllClients_Reload(string address)
7878
{
@@ -89,11 +89,11 @@ public async Task<IActionResult> AllClients_Reload(string address)
8989
}
9090

9191
/// <summary>
92-
/// 通知某个节点个某个客户端刷新配置项
92+
/// Notify a node to instruct a single client to reload configuration.
9393
/// </summary>
94-
/// <param name="address"></param>
95-
/// <param name="clientId"></param>
96-
/// <returns></returns>
94+
/// <param name="address">Remote node address.</param>
95+
/// <param name="clientId">Client identifier to reload.</param>
96+
/// <returns>Operation result.</returns>
9797
[HttpPost]
9898
public async Task<IActionResult> Client_Reload(string address, string clientId)
9999
{

0 commit comments

Comments
 (0)