feat: Gitee Issue 接口 open 为 0 时显示为 success 颜色

This commit is contained in:
Argo Zhang 2019-08-11 12:27:58 +08:00
parent 0e7ad0a282
commit 9bc109e607
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 8 additions and 13 deletions

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api namespace Bootstrap.Admin.Controllers.Api
{ {
/// <summary> /// <summary>
/// /// Gitee 网站信息接口类
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
@ -18,7 +18,7 @@ namespace Bootstrap.Admin.Controllers.Api
public class GiteeController : ControllerBase public class GiteeController : ControllerBase
{ {
/// <summary> /// <summary>
/// /// 获取 Gitee 网站 Issues 信息
/// </summary> /// </summary>
/// <param name="httpClientFactory"></param> /// <param name="httpClientFactory"></param>
/// <param name="userName"></param> /// <param name="userName"></param>
@ -38,11 +38,12 @@ namespace Bootstrap.Admin.Controllers.Api
var result = string.IsNullOrEmpty(content) ? new string[] { "unknown" } : regex.Select((m, i) => $"{labels[i]} {m.Groups[1].Value}"); var result = string.IsNullOrEmpty(content) ? new string[] { "unknown" } : regex.Select((m, i) => $"{labels[i]} {m.Groups[1].Value}");
return string.Join(" ", result); return string.Join(" ", result);
}); });
color = ret.StartsWith("open 0 progressing 0") ? "success" : color;
return new JsonResult(new { schemaVersion = 1, label, message = ret, color }); return new JsonResult(new { schemaVersion = 1, label, message = ret, color });
} }
/// <summary> /// <summary>
/// /// 获取 Gitee 网站 Pulls 信息
/// </summary> /// </summary>
/// <param name="httpClientFactory"></param> /// <param name="httpClientFactory"></param>
/// <param name="userName"></param> /// <param name="userName"></param>
@ -66,7 +67,7 @@ namespace Bootstrap.Admin.Controllers.Api
} }
/// <summary> /// <summary>
/// /// 获取 Gitee 网站 Releases 信息
/// </summary> /// </summary>
/// <param name="httpClientFactory"></param> /// <param name="httpClientFactory"></param>
/// <param name="userName"></param> /// <param name="userName"></param>
@ -88,7 +89,7 @@ namespace Bootstrap.Admin.Controllers.Api
} }
/// <summary> /// <summary>
/// /// 获取 Gitee 网站 Builds 信息
/// </summary> /// </summary>
/// <param name="httpClientFactory"></param> /// <param name="httpClientFactory"></param>
/// <param name="userName"></param> /// <param name="userName"></param>
@ -127,24 +128,18 @@ namespace Bootstrap.Admin.Controllers.Api
return ret; return ret;
} }
/// <summary>
///
/// </summary>
private class AppveyorBuildResult private class AppveyorBuildResult
{ {
/// <summary> /// <summary>
/// /// Appveyor 编译版本实例
/// </summary> /// </summary>
public Build Build { get; set; } public Build Build { get; set; }
} }
/// <summary>
///
/// </summary>
private class Build private class Build
{ {
/// <summary> /// <summary>
/// /// Build 版本信息
/// </summary> /// </summary>
public string Version { get; set; } public string Version { get; set; }
} }