Browse Source
Merge pull request #17981 from abpframework/DateOnly
Support `DateOnly` and `TimeOnly` in `AspNetCoreApiDescriptionModelProvider`.
pull/17993/head
Masum ULU
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
12 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
-
framework/src/Volo.Abp.Core/Volo/Abp/Reflection/TypeHelper.cs
-
npm/ng-packs/packages/schematics/src/constants/system-types.ts
|
|
|
@ -214,6 +214,8 @@ public class AspNetCoreApiDescriptionModelProvider : IApiDescriptionModelProvide |
|
|
|
type == typeof(void) || |
|
|
|
type == typeof(Enum) || |
|
|
|
type == typeof(ValueType) || |
|
|
|
type == typeof(DateOnly) || |
|
|
|
type == typeof(TimeOnly) || |
|
|
|
TypeHelper.IsPrimitiveExtended(type)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
|
|
|
|
@ -257,6 +257,14 @@ public static class TypeHelper |
|
|
|
{ |
|
|
|
return "string"; |
|
|
|
} |
|
|
|
else if (type.FullName == "System.DateOnly") |
|
|
|
{ |
|
|
|
return "string"; |
|
|
|
} |
|
|
|
else if (type.FullName == "System.TimeOnly") |
|
|
|
{ |
|
|
|
return "string"; |
|
|
|
} |
|
|
|
else if (type == typeof(TimeSpan)) |
|
|
|
{ |
|
|
|
return "string"; |
|
|
|
|
|
|
|
@ -5,6 +5,8 @@ export const SYSTEM_TYPES = new Map([ |
|
|
|
['Collections.Generic.Dictionary', 'Record'], |
|
|
|
['DateTime', 'string'], |
|
|
|
['DateTimeOffset', 'string'], |
|
|
|
['DateOnly', 'string'], |
|
|
|
['TimeOnly', 'string'], |
|
|
|
['Decimal', 'number'], |
|
|
|
['Double', 'number'], |
|
|
|
['Guid', 'string'], |
|
|
|
|