From 6e5660c184d2e6b33a23c39bae8daf2f67287680 Mon Sep 17 00:00:00 2001
From: WX <WX@LAPTOP-D7EGQG4L>
Date: 星期日, 20 二月 2022 19:09:41 +0800
Subject: [PATCH] 返回结果修改
---
ZTICInterface.Web.Entry/Program.cs | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ZTICInterface.Web.Entry/Program.cs b/ZTICInterface.Web.Entry/Program.cs
index 76cb085..d9d4b47 100644
--- a/ZTICInterface.Web.Entry/Program.cs
+++ b/ZTICInterface.Web.Entry/Program.cs
@@ -5,7 +5,9 @@
var builder = WebApplication.CreateBuilder(args).Inject();
-builder.Services.AddControllers().AddNewtonsoftJson(options =>
+builder.Services.AddControllers()
+ .AddUnifyResult<MyRESTfulResultProvider>()
+ .AddNewtonsoftJson(options =>
{
options.SerializerSettings.ContractResolver =
new CamelCasePropertyNamesContractResolver(); //序列化时key为驼峰样式
@@ -13,7 +15,7 @@
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; //忽略循环引用
});
-//builder.Services.AddInjectWithUnifyResult<MyRESTfulResultProvider>();
+
builder.Services.AddSqlsugarSetup();
builder.Services.AddSingleton(typeof(Repository<>));
--
Gitblit v1.8.0