处理日期数组

This commit is contained in:
qianhao.xu
2025-02-19 09:45:07 +08:00
parent 4aed6294ad
commit 90e940b2a1
2 changed files with 22 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ builder.Services.AddMvc(options =>
options.JsonSerializerOptions.WriteIndented = true;
options.JsonSerializerOptions.Converters.Add(new JsonConverterUtil.DateTimeConverter());
options.JsonSerializerOptions.Converters.Add(new JsonConverterUtil.DateTimeNullConverter());
options.JsonSerializerOptions.Converters.Add(new JsonConverterUtil.DateTimeArrayConverter());
options.JsonSerializerOptions.Converters.Add(new StringConverter());
//PropertyNamingPolicy属性用于前端传过来的属性的格式策略目前内置的仅有一种策略CamelCase
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;