增加了model默认字段
This commit is contained in:
@@ -61,14 +61,14 @@ namespace SimApi.Configs
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Swagger文档相关配置,需要启用 EnableSimApiDoc
|
/// Swagger文档相关配置,需要启用 EnableSimApiDoc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SimApiDocOptions SimApiDocOptions { get; set; } = new SimApiDocOptions();
|
public SimApiDocOptions SimApiDocOptions { get; set; } = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// S3兼容的存储系统配置,需要启用 EnableSimApiStorage
|
/// S3兼容的存储系统配置,需要启用 EnableSimApiStorage
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SimApiStorageOptions SimApiStorageOptions { get; set; } = new SimApiStorageOptions();
|
public SimApiStorageOptions SimApiStorageOptions { get; set; } = new();
|
||||||
|
|
||||||
public SimApiSynapseOptions SimApiSynapseOptions { get; set; } = new SimApiSynapseOptions();
|
public SimApiSynapseOptions SimApiSynapseOptions { get; set; } = new();
|
||||||
|
|
||||||
public void ConfigureSimApiSynapse(Action<SimApiSynapseOptions> options = null)
|
public void ConfigureSimApiSynapse(Action<SimApiSynapseOptions> options = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using SimApi.Helpers;
|
using SimApi.Helpers;
|
||||||
@@ -7,10 +8,16 @@ namespace SimApi.Models
|
|||||||
{
|
{
|
||||||
public class SimApiBaseModel
|
public class SimApiBaseModel
|
||||||
{
|
{
|
||||||
protected virtual string[] MapperIgnoreField { get; set; } =
|
[Column(Order = 1)]
|
||||||
{
|
public string Id { get; set; } = Guid.NewGuid().ToString();
|
||||||
"Id", "CreatedAt", "UpdatedAt"
|
|
||||||
};
|
[Column(Order = 9998)]
|
||||||
|
public DateTime UpdatedAt { get; set; } = SimApiUtil.CstNow;
|
||||||
|
|
||||||
|
[Column(Order = 9999)]
|
||||||
|
public DateTime CreatedAt { get; set; } = SimApiUtil.CstNow;
|
||||||
|
|
||||||
|
protected virtual string[] MapperIgnoreField { get; set; } = { "Id", "CreatedAt", "UpdatedAt" };
|
||||||
|
|
||||||
protected virtual string UpdatedTimeField { get; set; } = "UpdatedAt";
|
protected virtual string UpdatedTimeField { get; set; } = "UpdatedAt";
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
<SynchReleaseVersion>false</SynchReleaseVersion>
|
<SynchReleaseVersion>false</SynchReleaseVersion>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<PackageVersion>5.0.2</PackageVersion>
|
<PackageVersion>5.0.2</PackageVersion>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user