2023-07-29 10:19:42 +08:00
|
|
|
|
using Hncore.Infrastructure.EF;
|
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Hncore.Pass.BaseInfo.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
public class UserDbContext : DbContextBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public UserDbContext(DbContextOptions<UserDbContext> options, IHttpContextAccessor httpContextAccessor) :
|
|
|
|
|
|
base(options, httpContextAccessor)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
|
{
|
|
|
|
|
|
modelBuilder.Entity<Manager>(entity =>
|
|
|
|
|
|
{
|
|
|
|
|
|
entity.ToTable("manager");
|
|
|
|
|
|
entity.HasKey(t => t.Id);
|
|
|
|
|
|
entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
});
|
|
|
|
|
|
modelBuilder.Entity<User>(entity =>
|
|
|
|
|
|
{
|
|
|
|
|
|
entity.ToTable("user");
|
|
|
|
|
|
entity.HasKey(t => t.Id);
|
|
|
|
|
|
entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
});
|
|
|
|
|
|
//modelBuilder.Entity<etor_authority_role>(entity =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
// entity.ToTable("Wx_App");
|
|
|
|
|
|
// entity.HasKey(t => t.Id);
|
|
|
|
|
|
// entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
//});
|
|
|
|
|
|
//modelBuilder.Entity<etor_authority_managerdatadomain>(entity =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
// entity.ToTable("Wx_App");
|
|
|
|
|
|
// entity.HasKey(t => t.Id);
|
|
|
|
|
|
// entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
//});
|
|
|
|
|
|
modelBuilder.Entity<WxAppEntity>(entity =>
|
|
|
|
|
|
{
|
|
|
|
|
|
entity.ToTable("Wx_App");
|
|
|
|
|
|
entity.HasKey(t => t.Id);
|
|
|
|
|
|
entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
});
|
|
|
|
|
|
modelBuilder.Entity<WxAppUserEntity>(entity =>
|
|
|
|
|
|
{
|
|
|
|
|
|
entity.ToTable("wx_app_user");
|
|
|
|
|
|
entity.HasKey(t => t.Id);
|
|
|
|
|
|
entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity<UserScore>(entity =>
|
|
|
|
|
|
{
|
|
|
|
|
|
entity.ToTable("user_score");
|
|
|
|
|
|
entity.HasKey(t => t.Id);
|
|
|
|
|
|
entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity<UserChargeOrderEntity>(entity =>
|
|
|
|
|
|
{
|
|
|
|
|
|
entity.ToTable("user_charge_order");
|
|
|
|
|
|
entity.HasKey(t => t.Id);
|
|
|
|
|
|
entity.Property(t => t.Id).ValueGeneratedOnAdd();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|