|
|
@ -43,6 +43,16 @@ builder.Services.AddCors(options =>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddSwaggerGen(c =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string? basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); //获取应用程序所在目录
|
|
|
|
|
|
|
|
if (basePath != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string xmlPath = Path.Combine(basePath, "WebStarter.xml");
|
|
|
|
|
|
|
|
c.IncludeXmlComments(xmlPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddControllers().AddJsonOptions(configure =>
|
|
|
|
builder.Services.AddControllers().AddJsonOptions(configure =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
configure.JsonSerializerOptions.Converters.Add(new DatetimeJsonConverter());
|
|
|
|
configure.JsonSerializerOptions.Converters.Add(new DatetimeJsonConverter());
|
|
|
|