Add MetaData Table From ExistData

Change to use MySQL
This commit is contained in:
Suphonchai Phoonsawat 2023-06-26 14:02:04 +07:00
parent 89de09d213
commit a0b3b13074
136 changed files with 3438 additions and 1237 deletions

View file

@ -1,35 +1,11 @@
using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace BMA.EHR.Domain.Common
{
public class BaseController : ControllerBase
{
#region " Fields "
private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
#region " Constructor and Destructor "
public BaseController(IHttpContextAccessor httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
#region " Protected "

View file

@ -1,13 +0,0 @@
using BMA.EHR.Domain.Common.Interfaces;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.Domain.Common
{
public abstract class BaseDataEntity<T> : BaseEntity<T>, IActivableEntity
{
[Required, Column(Order = 990), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
}
}

View file

@ -1,13 +0,0 @@
using BMA.EHR.Domain.Common.Interfaces;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.Domain.Common
{
public class BaseDraftEntity<T> : BaseDataEntity<T>, IPublishableEntity
{
[Required, Column(Order = 899), Comment("สถานะการเผยแพร่ข้อมูล")]
public bool IsPublished { get; set; } = false;
}
}

View file

@ -1,36 +0,0 @@
using BMA.EHR.Domain.Common.Interfaces;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMA.EHR.Domain.Common
{
public class BaseEntity<T> : IAuditableEntity
{
[Key, Column(Order = 0), Comment("คีย์หลัก")]
public virtual T Id { get; set; }
[Required, Column(Order = 991), Comment("User Id ที่สร้างข้อมูล")]
public Guid CreatedUserId { get; set; } = Guid.Empty;
[Required, Column(Order = 992), Comment("ชื่อ User ที่สร้างข้อมูล")]
public string CreatedUserFullName { get; set; } = string.Empty;
[Required, Column(Order = 993), Comment("สร้างข้อมูลเมื่อ")]
public DateTime CreatedDate { get; set; } = DateTime.Now;
[Column(Order = 994), Comment("User Id ที่แก้ไขข้อมูล")]
public Guid? ModifiedUserId { get; set; }
[Column(Order = 995), Comment("ชื่อ User ที่แก้ไขข้อมูล")]
public string? ModifiedUserFullName { get; set; }
[Column(Order = 996), Comment("แก้ไขข้อมูลเมื่อ")]
public DateTime? ModifiedDate { get; set; }
}
}

View file

@ -1,7 +0,0 @@
namespace BMA.EHR.Domain.Common.Interfaces
{
public interface IActivableEntity
{
bool IsActive { get; set; }
}
}

View file

@ -1,17 +0,0 @@
namespace BMA.EHR.Domain.Common.Interfaces
{
public interface IAuditableEntity
{
Guid CreatedUserId { get; set; }
string CreatedUserFullName { get; set; }
DateTime CreatedDate { get; set; }
Guid? ModifiedUserId { get; set; }
string? ModifiedUserFullName { get; set; }
DateTime? ModifiedDate { get; set; }
}
}

View file

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMA.EHR.Domain.Common.Interfaces
{
public interface IPublishableEntity
{
bool IsPublished { get; set; }
}
}