新增SwaggerDemo
This commit is contained in:
24
电子展板/WebModule/ModelMetadata/MyConfigModelDataProvider.cs
Normal file
24
电子展板/WebModule/ModelMetadata/MyConfigModelDataProvider.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Nancy.Swagger;
|
||||
using Nancy.Swagger.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using 电子展板.Models;
|
||||
using 电子展板.Utility.Swagger;
|
||||
|
||||
namespace 电子展板.WebModule.ModelMetadata
|
||||
{
|
||||
public class MyConfigModelDataProvider : ISwaggerModelDataProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// 使用自定义特性注解完成配置
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public SwaggerModelData GetModelData()
|
||||
{
|
||||
return SwaggerModelDataUtils.GetModelData<MyConfig>();
|
||||
}
|
||||
}
|
||||
}
|
||||
19
电子展板/WebModule/ModelMetadata/RetValueDataProvider.cs
Normal file
19
电子展板/WebModule/ModelMetadata/RetValueDataProvider.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Nancy.Swagger;
|
||||
using Nancy.Swagger.Services;
|
||||
using 电子展板.Models;
|
||||
using 电子展板.Utility.Swagger;
|
||||
|
||||
namespace 电子展板.WebModule.ModelMetadata
|
||||
{
|
||||
public class RetValueDataProvider : ISwaggerModelDataProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// 使用自定义特性注解完成配置
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public SwaggerModelData GetModelData()
|
||||
{
|
||||
return SwaggerModelDataUtils.GetModelData<RetValue>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user