绕过JNPF规范过滤
This commit is contained in:
@@ -243,6 +243,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[NonUnify]
|
||||||
public async Task<dynamic> MESCreateInstock(MESCreateInstockInput input)
|
public async Task<dynamic> MESCreateInstock(MESCreateInstockInput input)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
15
common/Tnb.Common/Utils/SkipNormalizationAttribute.cs
Normal file
15
common/Tnb.Common/Utils/SkipNormalizationAttribute.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.Common.Utils
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Method)]
|
||||||
|
public class SkipNormalizationAttribute : Attribute
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.SpecificationDocument;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
|
namespace Tnb.Common.Utils
|
||||||
|
{
|
||||||
|
//public class SkipNormalizationAttributeConventionalRegistrar : IConventionalRegistrar
|
||||||
|
//{
|
||||||
|
// public void Register(IServiceCollection services, IConfiguration configuration)
|
||||||
|
// {
|
||||||
|
// // 注册规范化过滤器时,跳过带有SkipNormalizationAttribute特性的方法
|
||||||
|
// services.Configure<ApiOptions>(options =>
|
||||||
|
// {
|
||||||
|
// options.Normalizers.Add<ApiActionFilter>(descriptor =>
|
||||||
|
// {
|
||||||
|
// var shouldSkip = descriptor.GetMethodInfo().IsDefined(typeof(SkipNormalizationAttribute), inherit: true);
|
||||||
|
// return !shouldSkip;
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user