diff --git a/Bootstrap.Admin/Controllers/Api/GiteeController.cs b/Bootstrap.Admin/Controllers/Api/GiteeController.cs
index e967cc20..63bbedd0 100644
--- a/Bootstrap.Admin/Controllers/Api/GiteeController.cs
+++ b/Bootstrap.Admin/Controllers/Api/GiteeController.cs
@@ -19,11 +19,13 @@ namespace Bootstrap.Admin.Controllers.Api
///
///
///
+ ///
+ ///
///
- public async Task Issues([FromServices]IHttpClientFactory httpClientFactory)
+ public async Task Issues([FromServices]IHttpClientFactory httpClientFactory, [FromQuery]string userName = "LongbowEnterprise", [FromQuery]string repoName = "BootstrapAdmin")
{
var client = httpClientFactory.CreateClient();
- var content = await client.GetStringAsync("https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues");
+ var content = await client.GetStringAsync($"https://gitee.com/{userName}/{repoName}/issues");
var regex = Regex.Matches(content, "([\\d]+)
", RegexOptions.IgnoreCase);
var labels = new string[] { "open", "closed", "rejected" };
var result = regex.Select((m, i) => $"{labels[i]} {m.Groups[1].Value}");
@@ -34,14 +36,69 @@ namespace Bootstrap.Admin.Controllers.Api
///
///
///
+ ///
+ ///
///
- public async Task Releases([FromServices]IHttpClientFactory httpClientFactory)
+ public async Task Pulls([FromServices]IHttpClientFactory httpClientFactory, [FromQuery]string userName = "LongbowEnterprise", [FromQuery]string repoName = "BootstrapAdmin")
{
var client = httpClientFactory.CreateClient();
- var content = await client.GetStringAsync("https://gitee.com/LongbowEnterprise/BootstrapAdmin/releases");
- var regex = Regex.Match(content, "", RegexOptions.IgnoreCase);
+ var content = await client.GetStringAsync($"https://gitee.com/{userName}/{repoName}/pulls");
+ var regex = Regex.Matches(content, "([\\d]+)
", RegexOptions.IgnoreCase);
+ var labels = new string[] { "open", "merged", "closed" };
+ var result = regex.Select((m, i) => $"{labels[i]} {m.Groups[1].Value}");
+ return new JsonResult(new { schemaVersion = 1, label = string.Join(" ", result), message = "sweet world", color = "orange" });
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task Releases([FromServices]IHttpClientFactory httpClientFactory, [FromQuery]string userName = "LongbowEnterprise", [FromQuery]string repoName = "BootstrapAdmin")
+ {
+ var client = httpClientFactory.CreateClient();
+ var content = await client.GetStringAsync($"https://gitee.com/{userName}/{repoName}/releases");
+ var regex = Regex.Match(content, $"", RegexOptions.IgnoreCase);
var result = regex.Groups[1].Value;
return new JsonResult(new { schemaVersion = 1, label = result, message = "sweet world", color = "orange" });
}
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task Builds([FromServices]IHttpClientFactory httpClientFactory, [FromQuery]string userName = "ArgoZhang", [FromQuery]string projName = "bootstrapadmin")
+ {
+ var client = httpClientFactory.CreateClient();
+ var content = await client.GetAsJsonAsync($"https://ci.appveyor.com/api/projects/{userName}/{projName}");
+ return new JsonResult(new { schemaVersion = 1, label = content.Build.Version, message = "sweet world", color = "orange" });
+ }
+
+ ///
+ ///
+ ///
+ private class AppveyorBuildResult
+ {
+ ///
+ ///
+ ///
+ public Build Build { get; set; }
+ }
+
+ ///
+ ///
+ ///
+ private class Build
+ {
+ ///
+ ///
+ ///
+ public string Version { get; set; }
+ }
}
}
diff --git a/README.md b/README.md
index 78cbccf7..3352ea3e 100644
--- a/README.md
+++ b/README.md
@@ -5,11 +5,14 @@
[![Gitee license](https://img.shields.io/github/license/argozhang/bootstrapadmin.svg?logo=git&logoColor=red)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/blob/master/LICENSE)
## Gitee
+[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&url=https%3A%2F%2Fba.sdgxgz.com%2FBA%2Fapi%2FGitee%2FBuilds?projName=bootstrapadmin-9m1jm)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm)
[![Build Status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin-9m1jm/dev.svg?logo=appveyor&label=maser)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm)
-[![Build Status](https://img.shields.io/appveyor/tests/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm/build/tests)
-[![Issue Status](https://img.shields.io/endpoint.svg?logo=appveyor&label=issues&url=https%3A%2F%2Fba.sdgxgz.com%2FBA%2Fapi%2FGitee%2FIssues)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues)
+[![Test Status](https://img.shields.io/appveyor/tests/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm/build/tests)
+[![Issue Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=critical&label=issues&url=https%3A%2F%2Fba.sdgxgz.com%2FBA%2Fapi%2FGitee%2FIssues)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues)
+[![Pull Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=brightgreen&label=pulls&url=https%3A%2F%2Fba.sdgxgz.com%2FBA%2Fapi%2FGitee%2FPullss)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/pulls)
## GitHub
+[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&url=https%3A%2F%2Fba.sdgxgz.com%2FBA%2Fapi%2FGitee%2FBuilds?projName=bootstrapadmin)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin)
[![Build status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin/dev.svg?logo=appveyor&label=dev)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/dev)
[![Build status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin/dev.svg?logo=appveyor&label=master)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master)
[![Test Status](https://img.shields.io/appveyor/tests/argozhang/bootstrapadmin/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master/tests)