mirror of
https://github.com/nsnail/IGeekFan.AspNetCore.Knife4jUI.git
synced 2025-04-13 19:52:50 +08:00
update package
This commit is contained in:
parent
66cd518872
commit
1e9fb7d195
@ -1,39 +1,46 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<Description>Middleware to expose an embedded version of the knife4j-vue-v3 from an ASP.NET Core application</Description>
|
||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageId></PackageId>
|
||||
<PackageId>IGeekFan.AspNetCore.Knife4jUI</PackageId>
|
||||
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore</PackageTags>
|
||||
<PackageProjectUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI</PackageProjectUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI.git</RepositoryUrl>
|
||||
<RootNamespace>IGeekFan.AspNetCore.Knife4jUI</RootNamespace>
|
||||
<Version>0.0.7</Version>
|
||||
<Version>0.0.9</Version>
|
||||
<Company />
|
||||
<Authors>igeekfan;xiaoym;</Authors>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Copyright>Apache License 2.0</Copyright>
|
||||
<PackageLicenseExpression></PackageLicenseExpression>
|
||||
<AssemblyVersion>0.0.8.0</AssemblyVersion>
|
||||
<FileVersion>0.0.8.0</FileVersion>
|
||||
<AssemblyVersion>0.0.9.0</AssemblyVersion>
|
||||
<FileVersion>0.0.9.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Using SourceLink -->
|
||||
<PropertyGroup>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' ">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="4.6.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0' ">
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -136,6 +136,8 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
||||
public string Url { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string SwaggerVersion { get; set; } = "3.0";
|
||||
}
|
||||
|
||||
public enum ModelRendering
|
||||
|
@ -14,8 +14,8 @@ using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System.Collections.Generic;
|
||||
#if NETCOREAPP3_0
|
||||
using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment;
|
||||
#if NETSTANDARD2_0
|
||||
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
|
||||
#endif
|
||||
namespace IGeekFan.AspNetCore.Knife4jUI
|
||||
{
|
||||
@ -29,7 +29,7 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
||||
|
||||
public Knife4jUIMiddleware(
|
||||
RequestDelegate next,
|
||||
IHostingEnvironment hostingEnv,
|
||||
IWebHostEnvironment hostingEnv,
|
||||
ILoggerFactory loggerFactory,
|
||||
Knife4UIOptions options)
|
||||
{
|
||||
@ -66,7 +66,7 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
||||
return;
|
||||
}
|
||||
|
||||
if (httpMethod == "GET" && Regex.IsMatch(path, $"^/v3/api-docs/swagger-config$"))
|
||||
if (httpMethod == "GET" && Regex.IsMatch(path, $"^/swagger-resources$"))
|
||||
{
|
||||
await RespondWithConfig(httpContext.Response);
|
||||
return;
|
||||
@ -77,12 +77,12 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
||||
|
||||
private async Task RespondWithConfig(HttpResponse response)
|
||||
{
|
||||
await response.WriteAsync(JsonSerializer.Serialize(_options.ConfigObject, _jsonSerializerOptions));
|
||||
await response.WriteAsync(JsonSerializer.Serialize(_options.ConfigObject.Urls, _jsonSerializerOptions));
|
||||
}
|
||||
|
||||
private StaticFileMiddleware CreateStaticFileMiddleware(
|
||||
RequestDelegate next,
|
||||
IHostingEnvironment hostingEnv,
|
||||
IWebHostEnvironment hostingEnv,
|
||||
ILoggerFactory loggerFactory,
|
||||
Knife4UIOptions options)
|
||||
{
|
||||
|
@ -6,17 +6,33 @@
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
<link rel=icon href=favicon.ico>
|
||||
<title>%(DocumentTitle)</title>
|
||||
<link href=knife4j/css/app.8efd8010.css rel=preload as= style>
|
||||
<link href=knife4j/js/app.d4cb69c0.js rel=preload as=script>
|
||||
<link href=knife4j/js/chunk-vendors.e86fea24.js rel=preload as=script>
|
||||
<link href=knife4j/css/app.8efd8010.css rel=stylesheet>
|
||||
<link href=knife4j/css/chunk-51277dbe.57225f85.css rel=prefetch>
|
||||
<link href=knife4j/js/chunk-069eb437.0b47243d.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-0fd67716.d57e2c41.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-2d0af44e.c299c1d4.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-2d0bd799.cc91c520.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-2d0d0b98.cb1dea78.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-2d0da532.dd3c929c.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-2d22269d.bd9173e1.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-3b888a65.8737ce4f.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-3ec4aaa8.a79d19f8.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-51277dbe.4335d8bb.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-589faee0.b24e5f3d.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-735c675c.76ef1019.js rel=prefetch>
|
||||
<link href=knife4j/js/chunk-adb9e944.b888f4bd.js rel=prefetch>
|
||||
<link href=knife4j/css/app.284871fa.css rel=preload as=style>
|
||||
<link href=knife4j/css/chunk-vendors.3f2387de.css rel=preload as=style>
|
||||
<link href=knife4j/js/app.703cb2b2.js rel=preload as=script>
|
||||
<link href=knife4j/js/chunk-vendors.90e8ba20.js rel=preload as=script>
|
||||
<link href=knife4j/css/chunk-vendors.3f2387de.css rel=stylesheet>
|
||||
<link href=knife4j/css/app.284871fa.css rel=stylesheet>
|
||||
%(HeadContent)
|
||||
</head>
|
||||
<body>
|
||||
<noscript><strong>We're sorry but knife4j-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript>
|
||||
<div id=app></div>
|
||||
<script src=knife4j/js/chunk-vendors.e86fea24.js></script>
|
||||
<script src=knife4j/js/app.d4cb69c0.js></script>
|
||||
<script src=knife4j/js/chunk-vendors.90e8ba20.js></script>
|
||||
<script src=knife4j/js/app.703cb2b2.js></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1 @@
|
||||
.api-tab[data-v-7da2228c]{margin-top:15px}.api-tab .ant-tag[data-v-7da2228c]{height:32px;line-height:32px}.api-basic[data-v-7da2228c]{padding:11px}.api-basic-title[data-v-7da2228c]{font-size:14px;font-weight:700}.api-basic-body[data-v-7da2228c]{font-size:14px;font-family:-webkit-body}.api-description[data-v-7da2228c]{border-left:4px solid #ddd;line-height:30px}.api-body-desc[data-v-7da2228c]{padding:10px;min-height:35px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #e8e8e8}.ant-card-body[data-v-7da2228c]{padding:5px}.api-title[data-v-7da2228c]{margin-top:10px;margin-bottom:5px;font-size:16px;font-weight:600;height:30px;line-height:30px;border-left:4px solid #00ab6d;text-indent:8px}.content-line[data-v-7da2228c]{height:25px;line-height:25px}.content-line-count[data-v-7da2228c]{height:35px;line-height:35px}.divider[data-v-7da2228c]{margin:4px 0}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
src/IGeekFan.AspNetCore.Knife4jUI/knife4j/js/app.703cb2b2.js.gz
Normal file
BIN
src/IGeekFan.AspNetCore.Knife4jUI/knife4j/js/app.703cb2b2.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d0af44e"],{"0e36":function(e,t,i){"use strict";i.r(t);var n={name:"EditorShow",components:{editor:i("7c9e")},props:{value:{type:String,required:!0,default:""},xmlMode:{type:Boolean,default:!1,required:!1}},data:function(){return{lang:"json",editor:null,editorHeight:200}},methods:{change:function(e){this.$emit("change",e)},resetEditorHeight:function(){var e=this;setTimeout((function(){var t=e.editor.session.getLength();1==t&&(t=10);var i=16*t;e.editorHeight=i}),300)},editorInit:function(e){var t=this;this.editor=e,i("2099"),i("818b"),i("0696"),this.xmlMode&&(this.lang="xml"),i("1d29"),this.resetEditorHeight(),this.editor.renderer.on("afterRender",(function(){t.$emit("showDescription","123")}))}}},o=i("2877"),r=Object(o.a)(n,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("editor",{attrs:{value:e.value,lang:e.lang,theme:"eclipse",width:"100%",height:e.editorHeight},on:{init:e.editorInit,input:e.change}})],1)}),[],!1,null,null,null);t.default=r.exports}}]);
|
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d0bd799"],{"2bc6":function(t,e,a){"use strict";a.r(e);var n={name:"DataType",props:{text:{type:String,default:"string",required:!0},record:{type:Object,required:!0}},data:function(){return{validators:[]}},created:function(){this.intiValidator()},methods:{intiValidator:function(){var t=this.record;if(null!=t.validateInstance)for(var e in this.getJsonKeyLength(t.validateInstance),t.validateInstance){var a=e+":"+t.validateInstance[e];this.validators.push({key:e,val:a})}},getJsonKeyLength:function(t){var e=0;if(null!=t)for(var a in t)t.hasOwnProperty(a)&&e++;return e}}},r=a("2877"),i=Object(r.a)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.record.validateStatus?a("span",{staticClass:"knife4j-request-validate-jsr"},[a("a-tooltip",{attrs:{placement:"right"}},[a("template",{slot:"title"},t._l(t.validators,(function(e){return a("div",{key:e.key},[t._v(t._s(e.val))])})),0),t._v(" "+t._s(t.text)+" ")],2)],1):a("span",[t._v(t._s(null==t.text||""==t.text?"string":t.text))])])}),[],!1,null,null,null);e.default=i.exports}}]);
|
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d0d0b98"],{"68cc":function(n,e,t){"use strict";t.r(e);var s=t("0e54"),r=t.n(s);r.a.setOptions({gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!0,smartypants:!1});var a={name:"Markdown",props:{source:{type:String}},computed:{markdownSource:function(){return r()(this.source)}}},o=t("2877"),c=Object(o.a)(a,(function(){var n=this,e=n.$createElement;return(n._self._c||e)("div",{staticClass:"knife4j-markdown",domProps:{innerHTML:n._s(n.markdownSource)}})}),[],!1,null,null,null);e.default=c.exports}}]);
|
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d0da532"],{"6ab3":function(e,n,t){"use strict";t.r(n);var u=(t("5609"),t("b1c7"),{name:"OAuth2",components:{},data:function(){return{api:null,swaggerInstance:null,debugSupport:!1}},computed:{swagger:function(){return this.$store.state.globals.swagger}},mounted:function(){},beforeCreate:function(){},created:function(){},methods:{}}),a=t("2877"),o=Object(a.a)(u,(function(){var e=this,n=e.$createElement;return(e._self._c||n)("a-row",[e._v(" 我是OAuth2回调页面 ")])}),[],!1,null,"5ccd4e78",null);n.default=o.exports}}]);
|
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d22269d"],{cf04:function(t,e,i){"use strict";i.r(e);var n={name:"EditorShow",components:{editor:i("7c9e")},props:{value:{type:String,required:!0,default:""}},data:function(){return{lang:"javascript",editor:null,editorHeight:200}},methods:{resetEditorHeight:function(){var t=this;setTimeout((function(){var e=t.editor.session.getLength();1==e&&(e=10);var i=16*e;t.editorHeight=i}),300)},change:function(t){this.$emit("change",t)},editorInit:function(t){var e=this;this.editor=t,i("2099"),i("bb36"),i("1d29"),this.resetEditorHeight(),this.editor.renderer.on("afterRender",(function(){e.$emit("showDescription","123")}))}}},r=i("2877"),o=Object(r.a)(n,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("editor",{attrs:{value:t.value,lang:t.lang,theme:"eclipse",width:"100%",height:t.editorHeight},on:{init:t.editorInit,input:t.change}})],1)}),[],!1,null,null,null);e.default=o.exports}}]);
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* clipboard.js v2.0.6
|
||||
* https://clipboardjs.com/
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
*/
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* clipboard.js v2.0.6
|
||||
* https://clipboardjs.com/
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
*/
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* clipboard.js v2.0.6
|
||||
* https://clipboardjs.com/
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
*/
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,77 @@
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
localForage -- Offline Storage, Improved
|
||||
Version 1.9.0
|
||||
https://localforage.github.io/localForage
|
||||
(c) 2013-2017 Mozilla, Apache License 2.0
|
||||
*/
|
||||
|
||||
/*!
|
||||
* vue-router v3.4.3
|
||||
* (c) 2020 Evan You
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
Copyright (c) 2017 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Vue.js v2.6.12
|
||||
* (c) 2014-2020 Evan You
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* vue-i18n v8.21.0
|
||||
* (c) 2020 kazuya kawaguchi
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* vuex v3.5.1
|
||||
* (c) 2020 Evan You
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
|
||||
|
||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/**
|
||||
* [js-md5]{@link https://github.com/emn178/js-md5}
|
||||
*
|
||||
* @namespace md5
|
||||
* @version 0.7.3
|
||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||
* @copyright Chen, Yi-Cyuan 2014-2017
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
||||
|
||||
//! license : MIT
|
||||
|
||||
//! moment.js
|
||||
|
||||
//! moment.js language configuration
|
||||
|
||||
//! moment.js locale configuration
|
||||
|
||||
//! momentjs.com
|
||||
|
||||
//! version : 2.27.0
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,91 +0,0 @@
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
localForage -- Offline Storage, Improved
|
||||
Version 1.7.3
|
||||
https://localforage.github.io/localForage
|
||||
(c) 2013-2017 Mozilla, Apache License 2.0
|
||||
*/
|
||||
|
||||
/*!
|
||||
* vue-router v3.1.6
|
||||
* (c) 2020 Evan You
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
Copyright (c) 2017 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Vue.js v2.6.11
|
||||
* (c) 2014-2019 Evan You
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* clipboard.js v2.0.6
|
||||
* https://clipboardjs.com/
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
*/
|
||||
|
||||
/*!
|
||||
* html2canvas 1.0.0-rc.5 <https://html2canvas.hertzen.com>
|
||||
* Copyright (c) 2019 Niklas von Hertzen <https://hertzen.com>
|
||||
* Released under MIT License
|
||||
*/
|
||||
|
||||
/*!
|
||||
* vue-i18n v8.17.4
|
||||
* (c) 2020 kazuya kawaguchi
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
|
||||
|
||||
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
||||
|
||||
/**
|
||||
* [js-md5]{@link https://github.com/emn178/js-md5}
|
||||
*
|
||||
* @namespace md5
|
||||
* @version 0.7.3
|
||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||
* @copyright Chen, Yi-Cyuan 2014-2017
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* vuex v3.3.0
|
||||
* (c) 2020 Evan You
|
||||
* @license MIT
|
||||
*/
|
Binary file not shown.
@ -26,6 +26,13 @@ namespace Basic.Controllers
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpPost("form-with-user")]
|
||||
public IActionResult PostFormUser([FromForm] FormUser FormUser)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("{name}")]
|
||||
[Produces("application/octet-stream", Type = typeof(FileResult))]
|
||||
public FileResult GetFile(string name)
|
||||
@ -47,4 +54,11 @@ namespace Basic.Controllers
|
||||
|
||||
public IFormFile File { get; set; }
|
||||
}
|
||||
|
||||
public class FormUser
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string User { get; set; }
|
||||
}
|
||||
}
|
@ -104,21 +104,21 @@ namespace Basic
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.RoutePrefix = "swagger"; // serve the UI at root
|
||||
c.SwaggerEndpoint("/v1/api-docs", "V1 Docs");
|
||||
c.SwaggerEndpoint("/gp/api-docs", "되쩌친욥");
|
||||
c.SwaggerEndpoint("/v1/swagger.json", "V1 Docs");
|
||||
c.SwaggerEndpoint("/gp/swagger.json", "되쩌친욥");
|
||||
});
|
||||
app.UseKnife4UI(c =>
|
||||
{
|
||||
c.RoutePrefix = ""; // serve the UI at root
|
||||
c.SwaggerEndpoint("/v1/api-docs", "V1 Docs");
|
||||
c.SwaggerEndpoint("/gp/api-docs", "되쩌친욥");
|
||||
c.SwaggerEndpoint("/v1/swagger.json", "V1 Docs");
|
||||
c.SwaggerEndpoint("/gp/swagger.json", "되쩌친욥");
|
||||
});
|
||||
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
endpoints.MapSwagger("{documentName}/api-docs");
|
||||
endpoints.MapSwagger("{documentName}/swagger.json");
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Knife4jUIDemo.Controllers
|
||||
{
|
||||
@ -11,7 +10,7 @@ namespace Knife4jUIDemo.Controllers
|
||||
/// 中文这是一个Get请求这是一个Get请求
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("api/WeatherForecast")]
|
||||
[Route("api/WeatherForecast/[action]")]
|
||||
public class WeatherForecastController : ControllerBase
|
||||
{
|
||||
private static readonly string[] Summaries = new[]
|
||||
@ -26,6 +25,38 @@ namespace Knife4jUIDemo.Controllers
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个ErrorCode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ErrorCode GetErrorCode()
|
||||
{
|
||||
return ErrorCode.Success;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public ErrorCode GetErrorCode2(ErrorCode errorCode)
|
||||
{
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult GetErrorCode4(ErrorCode errorCode)
|
||||
{
|
||||
return new JsonResult(new PostErrorCodeDto() { Message="a",ErrorCode=errorCode});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送一个Post
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public PostErrorCodeDto PostErrorCode([FromBody] PostErrorCodeDto PostErrorCodeDto)
|
||||
{
|
||||
return PostErrorCodeDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 这是一个Get请求
|
||||
/// </summary>
|
||||
@ -43,4 +74,19 @@ namespace Knife4jUIDemo.Controllers
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 请求实体
|
||||
/// </summary>
|
||||
public class PostErrorCodeDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 异常信息
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
/// <summary>
|
||||
/// 状态码
|
||||
/// </summary>
|
||||
public ErrorCode ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
81
test/Knife4jUIDemo/ErrorCode.cs
Normal file
81
test/Knife4jUIDemo/ErrorCode.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Knife4jUIDemo
|
||||
{
|
||||
/// <summary>
|
||||
/// 注释ErrorCode
|
||||
/// </summary>
|
||||
public enum ErrorCode
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作成功
|
||||
/// </summary>
|
||||
Success = 0,
|
||||
/// <summary>
|
||||
/// 未知错误
|
||||
/// </summary>
|
||||
UnknownError = 1007,
|
||||
/// <summary>
|
||||
/// 服务器未知错误
|
||||
/// </summary>
|
||||
ServerUnknownError = 999,
|
||||
|
||||
/// <summary>
|
||||
/// 失败
|
||||
/// </summary>
|
||||
Error = 1000,
|
||||
|
||||
/// <summary>
|
||||
/// 认证失败
|
||||
/// </summary>
|
||||
AuthenticationFailed = 10000,
|
||||
/// <summary>
|
||||
/// 无权限
|
||||
/// </summary>
|
||||
NoPermission = 10001,
|
||||
/// <summary>
|
||||
/// 失败
|
||||
/// </summary>
|
||||
Fail = 9999,
|
||||
/// <summary>
|
||||
/// refreshToken异常
|
||||
/// </summary>
|
||||
RefreshTokenError = 10100,
|
||||
/// <summary>
|
||||
/// 资源不存在
|
||||
/// </summary>
|
||||
NotFound = 10020,
|
||||
/// <summary>
|
||||
/// 参数错误
|
||||
/// </summary>
|
||||
[Description("参数错误")]
|
||||
ParameterError = 10030,
|
||||
/// <summary>
|
||||
/// 令牌失效
|
||||
/// </summary>
|
||||
[Description("令牌失效")]
|
||||
TokenInvalidation = 10040,
|
||||
/// <summary>
|
||||
/// 令牌过期
|
||||
/// </summary>
|
||||
TokenExpired = 10050,
|
||||
/// <summary>
|
||||
/// 字段重复
|
||||
/// </summary>
|
||||
RepeatField = 10060,
|
||||
/// <summary>
|
||||
/// 禁止操作
|
||||
/// </summary>
|
||||
Inoperable = 10070,
|
||||
//10080 请求方法不允许
|
||||
|
||||
//10110 文件体积过大
|
||||
|
||||
//10120 文件数量过多
|
||||
|
||||
//10130 文件扩展名不符合规范
|
||||
|
||||
//10140 请求过于频繁,请稍后重试
|
||||
ManyRequests = 10140
|
||||
}
|
||||
}
|
@ -9,11 +9,113 @@
|
||||
中文这是一个Get请求这是一个Get请求
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Knife4jUIDemo.Controllers.WeatherForecastController.GetErrorCode">
|
||||
<summary>
|
||||
得到一个ErrorCode
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Knife4jUIDemo.Controllers.WeatherForecastController.PostErrorCode(Knife4jUIDemo.Controllers.PostErrorCodeDto)">
|
||||
<summary>
|
||||
发送一个Post
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Knife4jUIDemo.Controllers.WeatherForecastController.Get">
|
||||
<summary>
|
||||
这是一个Get请求
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Knife4jUIDemo.Controllers.PostErrorCodeDto">
|
||||
<summary>
|
||||
请求实体
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Knife4jUIDemo.Controllers.PostErrorCodeDto.Message">
|
||||
<summary>
|
||||
异常信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Knife4jUIDemo.Controllers.PostErrorCodeDto.ErrorCode">
|
||||
<summary>
|
||||
状态码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Knife4jUIDemo.ErrorCode">
|
||||
<summary>
|
||||
注释ErrorCode
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.Success">
|
||||
<summary>
|
||||
操作成功
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.UnknownError">
|
||||
<summary>
|
||||
未知错误
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.ServerUnknownError">
|
||||
<summary>
|
||||
服务器未知错误
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.Error">
|
||||
<summary>
|
||||
失败
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.AuthenticationFailed">
|
||||
<summary>
|
||||
认证失败
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.NoPermission">
|
||||
<summary>
|
||||
无权限
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.Fail">
|
||||
<summary>
|
||||
失败
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.RefreshTokenError">
|
||||
<summary>
|
||||
refreshToken异常
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.NotFound">
|
||||
<summary>
|
||||
资源不存在
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.ParameterError">
|
||||
<summary>
|
||||
参数错误
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.TokenInvalidation">
|
||||
<summary>
|
||||
令牌失效
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.TokenExpired">
|
||||
<summary>
|
||||
令牌过期
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.RepeatField">
|
||||
<summary>
|
||||
字段重复
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Knife4jUIDemo.ErrorCode.Inoperable">
|
||||
<summary>
|
||||
禁止操作
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
@ -60,20 +60,20 @@ namespace Knife4jUIDemo
|
||||
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.RoutePrefix = "swagger"; // serve the UI at root
|
||||
c.SwaggerEndpoint("/v1/api-docs", "LinCms");
|
||||
c.SwaggerEndpoint("v1/swagger.json", "My API V1");
|
||||
//c.SwaggerEndpoint("/v1/api-docs", "LinCms");
|
||||
});
|
||||
|
||||
app.UseKnife4UI(c =>
|
||||
{
|
||||
c.RoutePrefix = ""; // serve the UI at root
|
||||
c.SwaggerEndpoint("/v1/api-docs", "V1 Docs");
|
||||
c.SwaggerEndpoint("/v1/swagger.json", "V1 Docs");
|
||||
});
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
endpoints.MapSwagger("{documentName}/api-docs");
|
||||
endpoints.MapSwagger("{documentName}/swagger.json");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user