-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
72 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Afdian.Server.Controllers | ||
{ | ||
[ApiExplorerSettings(IgnoreApi = true)] | ||
[Route("api/[controller]/[action]")] | ||
[ApiController] | ||
public class HomeController : ControllerBase | ||
{ | ||
[HttpGet] | ||
public async Task<string> Version() | ||
{ | ||
string version = Utils.CommonUtil.Version(); | ||
|
||
return await Task.FromResult(version); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Afdian.Server.Utils | ||
{ | ||
public class CommonUtil | ||
{ | ||
public static string Version() | ||
{ | ||
string version = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(Server.Startup).Assembly.Location).ProductVersion.Split('+').First(); | ||
|
||
return version; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,28 +2,30 @@ | |
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Afdian.Server | Afdian.Sdk | 爱发电 非官方 .NET SDK</title> | ||
<title>Afdian.Server | 爱发电 徽章 Badge | Afdian.Sdk | 爱发电 非官方 .NET SDK</title> | ||
<!-- 移动端设置 --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | ||
<!-- CSS only --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> | ||
<script> | ||
var _hmt = _hmt || []; | ||
(function () { | ||
var hm = document.createElement("script"); | ||
hm.src = "https://hm.baidu.com/hm.js?b44e4240604b579c37c97f2956a333be"; | ||
var s = document.getElementsByTagName("script")[0]; | ||
s.parentNode.insertBefore(hm, s); | ||
})(); | ||
</script> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="row align-items-center"> | ||
<div class="col align-self-center"> | ||
<div class="form"> | ||
<div class="form-group"> | ||
<label>user_id</label> | ||
<input id="js-input-userId" type="text" class="form-control"> | ||
</div> | ||
<div class="form-group"> | ||
<label>token</label> | ||
<input id="js-input-token" type="text" class="form-control"> | ||
</div> | ||
<button id="js-btn-getBadge-1" class="btn btn-info btn-block" style="margin-top:14px;">获取Badge - 显式UserId,Token</button> | ||
</div> | ||
</div> | ||
<div style="margin:20px auto;text-align:center;"> | ||
<h1>Afdian.Server</h1> | ||
<h2>开发中</h2> | ||
<div> | ||
<a target="_blank" href="/swagger">创建 爱发电 徽章 Badge</a> | ||
</div> | ||
<div> | ||
<a target="_blank" href="https://github.com/yiyungent/Afdian.Sdk">GitHub 仓库</a> | ||
</div> | ||
</div> | ||
<!-- JavaScript Bundle with Popper --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var _hmt = _hmt || []; | ||
(function () { | ||
var hm = document.createElement("script"); | ||
hm.src = "https://hm.baidu.com/hm.js?b44e4240604b579c37c97f2956a333be"; | ||
var s = document.getElementsByTagName("script")[0]; | ||
s.parentNode.insertBefore(hm, s); | ||
})(); |