This commit is contained in:
gongxh
2021-05-21 09:50:57 +08:00
parent c06d2d80e7
commit 956e149c2d
4 changed files with 11 additions and 10 deletions

View File

@@ -7,8 +7,14 @@ using Swashbuckle.Application;
namespace NX.ERP.WebAPi
{
/// <summary>
///
/// </summary>
public class SwaggerConfig
{
/// <summary>
///
/// </summary>
public static void Register()
{
var thisAssembly = typeof(SwaggerConfig).Assembly;
@@ -36,7 +42,7 @@ namespace NX.ERP.WebAPi
// If you want the output Swagger docs to be indented properly, enable the "PrettyPrint" option.
//
//c.PrettyPrint();
c.PrettyPrint();
// If your API has multiple versions, use "MultipleApiVersions" instead of "SingleApiVersion".
// In this case, you must provide a lambda that tells Swashbuckle which actions should be
@@ -101,9 +107,9 @@ namespace NX.ERP.WebAPi
// those comments into the generated docs and UI. You can enable this by providing the path to one or
// more Xml comment files.
//
c.IncludeXmlComments(string.Format("{0}/bin/NX.ERP.WebAPi.xml", System.AppDomain.CurrentDomain.BaseDirectory));
// c.IncludeXmlComments(string.Format("{0}/bin/NX.ERP.WebAPi.xml", System.AppDomain.CurrentDomain.BaseDirectory));
c.IncludeXmlComments(string.Format("{0}/bin/NX.ERP.Model.xml", System.AppDomain.CurrentDomain.BaseDirectory));
// c.IncludeXmlComments(string.Format("{0}/bin/NX.ERP.Model.xml", System.AppDomain.CurrentDomain.BaseDirectory));
// Swashbuckle makes a best attempt at generating Swagger compliant JSON schemas for the various types
// exposed in your API. However, there may be occasions when more control of the output is needed.
// This is supported through the "MapType" and "SchemaFilter" options:

View File

@@ -16,7 +16,7 @@ namespace NX.ERP.WebAPi.Controllers.Store
/// </summary>
/// <param name="Code"></param>
/// <returns></returns>
[HttpPost]
[HttpGet]
[Route("api/Stock/GetStock")]
public IEnumerable<Model.Response.Store.Stock> GetList([FromUri]string Code)
{