增加带Header与NavigationBar的API接口文档View

This commit is contained in:
Argo-Lenovo 2016-12-22 22:36:18 +08:00
parent 820875595b
commit d94521d523
7 changed files with 77 additions and 34 deletions

View File

@ -105,6 +105,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\ErrorLog\Readme.txt" />
<Content Include="Content\css\api.css" />
<Content Include="Content\css\bootstrap-datetimepicker.css" />
<Content Include="Content\css\bootstrap-datetimepicker.min.css" />
<Content Include="Content\css\IE8.css" />
@ -322,6 +323,7 @@
<Content Include="Views\Shared\_Mobile.cshtml" />
<Content Include="Views\Home\Mobile.cshtml" />
<Content Include="Views\Shared\SubMenu.cshtml" />
<Content Include="Views\Admin\Api.cshtml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>

View File

@ -0,0 +1,35 @@
h3 {
margin-top: 0;
color: #000;
}
.btn {
text-shadow: none;
}
.control-label {
width: 80px;
}
.main-content {
padding: 15px;
}
.main-content > section:not(:first-child) {
padding-top: 10px;
}
.main-content > section > div {
line-height: 26px;
}
.main-content > section > div > div {
display: inline-block;
word-break: break-all;
}
.test {
display: none;
padding: 10px 0 0 0;
color: #5cb85c;
}

View File

@ -8,42 +8,12 @@
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/bootstrap-theme.css" rel="stylesheet">
<link href="../css/api.css" rel="stylesheet">
<!--[if lte IE 9 ]>
<link href="../Content/css/IE8.css" rel="stylesheet" />
<![endif]-->
<style type="text/css">
.btn {
text-shadow: none;
}
button {
outline: none !important;
}
h3 {
margin-top: 0;
}
section {
padding: 15px;
}
section > div > div {
display: inline-block;
word-break: break-all;
}
.control-label {
width: 80px;
}
.test {
display: none;
padding: 10px 0 0 0;
}
</style>
</head>
<body>
<body id="main-content" class="main-content">
<!--[if lte IE 9 ]>
<div id="ieAlert" class="alert alert-danger alert-dismissible">
<div>你的浏览器版本太低不能完美的支持本系统请升级到至少IE9 <a href="../IE/IE9.exe" target="_blank">速速点击下载</a> </div>

View File

@ -145,5 +145,14 @@ namespace Bootstrap.Admin.Controllers
var v = new NavigatorBarModel("~/Admin/Mobile");
return View(v);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public ActionResult Api()
{
var v = new NavigatorBarModel("~/Admin/Api");
return View(v);
}
}
}

View File

@ -45,7 +45,7 @@
headers: options.headers,
success: function (result) {
if (!options.test) {
var $body = $('body');
var $body = $('#main-content');
$body.append('<section></section>');
var $section = $body.find('section').last();
$section.append($.format('<h3>{0}</h3>', options.title));

View File

@ -0,0 +1,27 @@
@model NavigatorBarModel
@{
ViewBag.Title = "Api 文档";
Layout = "~/Views/Shared/_Admin.cshtml";
}
@section header {
@Html.Partial("Header", Model)
}
@section navigator {
@Html.Partial("Navigator", Model)
}
@section javascript {
<script src="~/Scripts/apidoc.js"></script>
}
@section css {
<link href="~/Content/css/api.css" rel="stylesheet" />
}
<section>
<div><h3>接口返回值定义</h3></div>
<div><label class="control-label">布尔值:</label><div>成功返回True失败返回False</div></div>
<div><label class="control-label">对象:</label><div>Json字符串</div></div>
</section>
<section>
<div><h3>接口请求定义</h3></div>
<div><label class="control-label">内容类型</label><div>Content-Type:application/json; charset=utf-8</div></div>
<div><label class="control-label">授权Token</label><div>Token:362a4733-341a-464d-ab12-e01554338839</div></div>
</section>

View File

@ -53,7 +53,7 @@ INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [C
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (19, 18, N'客户端测试', 10, N'fa fa-wrench', N'~/Admin/Mobile', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (20, 0, N'工具集合', 20, N'fa fa-gavel', N'#', N'1')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (21, 20, N'客户端测试', 10, N'fa fa-wrench', N'../Home/Mobile', N'1')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (22, 18, N'API文档', 10, N'fa fa-wrench', N'~/Content/html/api.html', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (22, 18, N'API文档', 10, N'fa fa-wrench', N'~/Admin/Api', N'0')
SET IDENTITY_INSERT [dbo].[Navigations] OFF
DELETE FROM GROUPS WHERE ID = 1