...
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Common.Validation
|
||||
public static bool CheckLawPassword(this string password, ref List<string> errors)
|
||||
{
|
||||
bool ret = true;
|
||||
if (password.Length != 6)
|
||||
if (password.Length < 6)
|
||||
{
|
||||
errors.Add("کلمه عبور باید حداقل 6 گاراکتر باشد");
|
||||
ret = false;
|
||||
|
@@ -1,4 +1,6 @@
|
||||
using Hushian.WebApi;
|
||||
using Hushian.Application.Models;
|
||||
using Hushian.Application.Services;
|
||||
using Hushian.WebApi;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -58,7 +60,14 @@ namespace Hushian.Application
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
services.AddScoped(typeof(AuthService));
|
||||
services.AddScoped(typeof(CompanyService));
|
||||
services.AddScoped(typeof(ConversationService));
|
||||
services.AddScoped(typeof(ExperService));
|
||||
services.AddScoped(typeof(GroupService));
|
||||
services.AddScoped(typeof(UserService));
|
||||
services.AddScoped(typeof(VerificationService));
|
||||
services.Configure<JwtSettings>(configuration.GetSection("JwtSettings"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ namespace Hushian.Application.Services
|
||||
Role="Company",
|
||||
img=Company.logo,
|
||||
MobileOrUserName = Company.Mobile,
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await GenerateToken(Company.Mobile, Company.ID, "Company"))
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(_jwtSettings.GenerateToken(Company.Mobile, Company.ID, "Company"))
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace Hushian.Application.Services
|
||||
CompanyId = exper.CompanyID,
|
||||
MobileOrUserName = exper.UserName,
|
||||
Role="Exper",
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await GenerateToken(exper.UserName, exper.ID, "Exper"))
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(_jwtSettings.GenerateToken(exper.UserName, exper.ID, "Exper"))
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -126,31 +126,6 @@ namespace Hushian.Application.Services
|
||||
return Response;
|
||||
}
|
||||
|
||||
public async Task<JwtSecurityToken> GenerateToken(string UserName, int userId, string Role)
|
||||
{
|
||||
var claims = new[]
|
||||
{
|
||||
new Claim(JwtRegisteredClaimNames.Sub,UserName),
|
||||
new Claim(ClaimTypes.NameIdentifier, UserName),
|
||||
new Claim(CustomClaimTypes.Uid,userId.ToString()),
|
||||
new Claim(ClaimTypes.Role, Role)
|
||||
};
|
||||
|
||||
|
||||
var symmetricSecurityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_jwtSettings.Key));
|
||||
var signingCredentials = new SigningCredentials(symmetricSecurityKey, SecurityAlgorithms.HmacSha256);
|
||||
|
||||
var jwtSecurityToken = new JwtSecurityToken(
|
||||
issuer: _jwtSettings.Issuer,
|
||||
audience: _jwtSettings.Audience,
|
||||
claims: claims,
|
||||
expires: DateTime.UtcNow.AddMinutes(_jwtSettings.DurationInMinutes),
|
||||
signingCredentials: signingCredentials);
|
||||
|
||||
//user.Token = new JwtSecurityTokenHandler().WriteToken(jwtSecurityToken);
|
||||
//var resultupdateuser = await _userManager.UpdateAsync(user);
|
||||
|
||||
return jwtSecurityToken;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,12 @@
|
||||
using System;
|
||||
using Hushian.Application.Constants;
|
||||
using Hushian.Application.Models;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -18,5 +23,30 @@ namespace Hushian.Application.Services
|
||||
{
|
||||
return d.Hour.ToString() + ":" + d.Minute.ToString();
|
||||
}
|
||||
public static JwtSecurityToken GenerateToken(this JwtSettings _jwtSettings,string UserName, int userId, string Role)
|
||||
{
|
||||
var claims = new[]
|
||||
{
|
||||
new Claim(JwtRegisteredClaimNames.Sub,UserName),
|
||||
new Claim(ClaimTypes.NameIdentifier, UserName),
|
||||
new Claim(CustomClaimTypes.Uid,userId.ToString()),
|
||||
new Claim(ClaimTypes.Role, Role)
|
||||
};
|
||||
|
||||
|
||||
var symmetricSecurityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_jwtSettings.Key));
|
||||
var signingCredentials = new SigningCredentials(symmetricSecurityKey, SecurityAlgorithms.HmacSha256);
|
||||
var jwtSecurityToken = new JwtSecurityToken(
|
||||
issuer: _jwtSettings.Issuer,
|
||||
audience: _jwtSettings.Audience,
|
||||
claims: claims,
|
||||
expires: DateTime.UtcNow.AddMinutes(_jwtSettings.DurationInMinutes),
|
||||
signingCredentials: signingCredentials);
|
||||
|
||||
//user.Token = new JwtSecurityTokenHandler().WriteToken(jwtSecurityToken);
|
||||
//var resultupdateuser = await _userManager.UpdateAsync(user);
|
||||
|
||||
return jwtSecurityToken;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,12 @@ namespace Hushian.Application.Services
|
||||
public class UserService
|
||||
{
|
||||
private readonly IGenericRepository<User> _UserRepository;
|
||||
|
||||
public UserService(IGenericRepository<User> userRepository)
|
||||
{
|
||||
_UserRepository = userRepository;
|
||||
}
|
||||
|
||||
public async Task<bool> AnyUser(int UserID) =>await _UserRepository.Get().AnyAsync(a=>a.ID==UserID);
|
||||
|
||||
}
|
||||
|
@@ -11,31 +11,33 @@ using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using Hushian.Application.Models.Message;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Hushian.Application.Services
|
||||
{
|
||||
public class VerificationService
|
||||
{
|
||||
private readonly JwtSettings _jwtSettings;
|
||||
private readonly IGenericRepository<VerificationCode> _VerificationCodeRepository;
|
||||
private readonly IGenericRepository<Company> _CompanyRepository;
|
||||
private readonly IGenericRepository<Exper> _ExperRepository;
|
||||
private readonly IMessageSender _messageSender;
|
||||
private readonly IGenericRepository<User> _UserRepository;
|
||||
private readonly AuthService _authService;
|
||||
|
||||
public VerificationService(IGenericRepository<VerificationCode> verificationCodeRepository
|
||||
, IMessageSender messageSender
|
||||
, IGenericRepository<User> userRepository
|
||||
, AuthService authService
|
||||
, IGenericRepository<Company> companyRepository
|
||||
, IGenericRepository<Exper> experRepository)
|
||||
, IGenericRepository<Exper> experRepository
|
||||
, IOptions<JwtSettings> jwtSettings)
|
||||
{
|
||||
_VerificationCodeRepository = verificationCodeRepository;
|
||||
_messageSender = messageSender;
|
||||
_UserRepository = userRepository;
|
||||
_authService = authService;
|
||||
_CompanyRepository = companyRepository;
|
||||
_ExperRepository = experRepository;
|
||||
_jwtSettings = jwtSettings.Value;
|
||||
}
|
||||
|
||||
public async Task<int> GenerateCodeForLoginUser(string Mobile)
|
||||
@@ -93,7 +95,7 @@ namespace Hushian.Application.Services
|
||||
Id = User.ID,
|
||||
MobileOrUserName = User.Mobile,
|
||||
Role="User",
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await _authService.GenerateToken(User.Mobile, User.ID, "User"))
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(_jwtSettings.GenerateToken(User.Mobile, User.ID, "User"))
|
||||
};
|
||||
}
|
||||
else
|
||||
@@ -156,7 +158,7 @@ namespace Hushian.Application.Services
|
||||
Role = "Company",
|
||||
img = anyCompany.logo,
|
||||
MobileOrUserName = anyCompany.Mobile,
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await _authService.GenerateToken(anyCompany.Mobile, anyCompany.ID, "Company"))
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(_jwtSettings.GenerateToken(anyCompany.Mobile, anyCompany.ID, "Company"))
|
||||
};
|
||||
}
|
||||
else
|
||||
|
@@ -20,7 +20,7 @@ namespace Hushian.Infrastructure
|
||||
//services.Configure<aiSetting>(configuration.GetSection("aiSettings"));
|
||||
//services.AddTransient<IOpenai, OpenaiService>();
|
||||
|
||||
// services.AddScoped(c => new Melipayamak.RestClient(configuration.GetSection("MessageSettings:UserName").Value, configuration.GetSection("MessageSettings:Password").Value));
|
||||
services.AddScoped(c => new Melipayamak.RestClient(configuration.GetSection("MessageSettings:UserName").Value, configuration.GetSection("MessageSettings:Password").Value));
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using Hushian.Domain.Entites;
|
||||
using Identity.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
||||
@@ -7,30 +8,40 @@ namespace Hushian.Persistence
|
||||
public class HushianDbContext : DbContext
|
||||
{
|
||||
public HushianDbContext(DbContextOptions<HushianDbContext> options)
|
||||
:base(options)
|
||||
: base(options)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region Table
|
||||
public DbSet<Company> Companies { get; set; }
|
||||
public DbSet<Conversation> Conversations { get; set; }
|
||||
public DbSet<ConversationResponse> ConversationItems { get; set; }
|
||||
public DbSet<Group> Groups { get; set; }
|
||||
public DbSet<Exper> Expers { get; set; }
|
||||
public DbSet<ExperGroup> EG { get; set; }
|
||||
public DbSet<Company> Companies { get; set; }
|
||||
public DbSet<Conversation> Conversations { get; set; }
|
||||
public DbSet<ConversationResponse> ConversationItems { get; set; }
|
||||
public DbSet<Group> Groups { get; set; }
|
||||
public DbSet<Exper> Expers { get; set; }
|
||||
public DbSet<ExperGroup> EG { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<VerificationCode > verificationCodes { get; set; }
|
||||
#endregion
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<ExperGroup>().HasKey(c => new { c.ExperID, c.GroupID });
|
||||
modelBuilder.Entity<ExperGroup>().HasOne(eg => eg.Exper)
|
||||
.WithMany(e => e.EG)
|
||||
.HasForeignKey(eg => eg.ExperID)
|
||||
.OnDelete(DeleteBehavior.ClientCascade);
|
||||
|
||||
modelBuilder.Entity<ExperGroup>()
|
||||
.HasOne(eg => eg.Group)
|
||||
.WithMany(g => g.EG)
|
||||
.HasForeignKey(eg => eg.GroupID)
|
||||
.OnDelete(DeleteBehavior.ClientCascade);
|
||||
modelBuilder
|
||||
.ApplyConfigurationsFromAssembly(typeof(HushianDbContext).Assembly);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
425
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.Designer.cs
generated
Normal file
425
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.Designer.cs
generated
Normal file
@@ -0,0 +1,425 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
[Migration("20250724132732_InitalDB")]
|
||||
partial class InitalDB
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
287
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.cs
Normal file
287
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.cs
Normal file
@@ -0,0 +1,287 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitalDB : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Companies",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FullName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FullNameManager = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
WebSite = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
logo = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
Available = table.Column<bool>(type: "bit", nullable: false),
|
||||
allowBot = table.Column<bool>(type: "bit", nullable: false),
|
||||
Verified = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Companies", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
FullName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CompanyContentInfo",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
Content = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CompanyContentInfo", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_CompanyContentInfo_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Expers",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
FullName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
UserName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Available = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Expers", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_Expers_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Groups",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
img = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
Info = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Available = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Groups", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_Groups_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Conversations",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
UserID = table.Column<int>(type: "int", nullable: false),
|
||||
GroupID = table.Column<int>(type: "int", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
FinishedDateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Conversations", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_Conversations_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Conversations_Groups_GroupID",
|
||||
column: x => x.GroupID,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "ID");
|
||||
table.ForeignKey(
|
||||
name: "FK_Conversations_Users_UserID",
|
||||
column: x => x.UserID,
|
||||
principalTable: "Users",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EG",
|
||||
columns: table => new
|
||||
{
|
||||
ExperID = table.Column<int>(type: "int", nullable: false),
|
||||
GroupID = table.Column<int>(type: "int", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EG", x => new { x.ExperID, x.GroupID });
|
||||
table.ForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
column: x => x.ExperID,
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_EG_Groups_GroupID",
|
||||
column: x => x.GroupID,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "ID");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ConversationItems",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ConversationID = table.Column<int>(type: "int", nullable: false),
|
||||
ExperID = table.Column<int>(type: "int", nullable: true),
|
||||
IsRead = table.Column<bool>(type: "bit", nullable: false),
|
||||
Type = table.Column<int>(type: "int", nullable: false),
|
||||
Text = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FileName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
FileType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
FileContent = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
ReadDateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ConversationItems", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConversationItems_Conversations_ConversationID",
|
||||
column: x => x.ConversationID,
|
||||
principalTable: "Conversations",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConversationItems_Expers_ExperID",
|
||||
column: x => x.ExperID,
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CompanyContentInfo_CompanyID",
|
||||
table: "CompanyContentInfo",
|
||||
column: "CompanyID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConversationItems_ConversationID",
|
||||
table: "ConversationItems",
|
||||
column: "ConversationID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConversationItems_ExperID",
|
||||
table: "ConversationItems",
|
||||
column: "ExperID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Conversations_CompanyID",
|
||||
table: "Conversations",
|
||||
column: "CompanyID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Conversations_GroupID",
|
||||
table: "Conversations",
|
||||
column: "GroupID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Conversations_UserID",
|
||||
table: "Conversations",
|
||||
column: "UserID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EG_GroupID",
|
||||
table: "EG",
|
||||
column: "GroupID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Expers_CompanyID",
|
||||
table: "Expers",
|
||||
column: "CompanyID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Groups_CompanyID",
|
||||
table: "Groups",
|
||||
column: "CompanyID");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CompanyContentInfo");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ConversationItems");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EG");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Conversations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Expers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Groups");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Companies");
|
||||
}
|
||||
}
|
||||
}
|
425
Infrastructure/Persistence/Migrations/20250724140236_changetbeg.Designer.cs
generated
Normal file
425
Infrastructure/Persistence/Migrations/20250724140236_changetbeg.Designer.cs
generated
Normal file
@@ -0,0 +1,425 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
[Migration("20250724140236_changetbeg")]
|
||||
partial class changetbeg
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class changetbeg : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG",
|
||||
column: "ExperID",
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG",
|
||||
column: "ExperID",
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
452
Infrastructure/Persistence/Migrations/20250724183709_tbverification.Designer.cs
generated
Normal file
452
Infrastructure/Persistence/Migrations/20250724183709_tbverification.Designer.cs
generated
Normal file
@@ -0,0 +1,452 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
[Migration("20250724183709_tbverification")]
|
||||
partial class tbverification
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Identity.Models.VerificationCode", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("verificationCodes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tbverification : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "verificationCodes",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Type = table.Column<int>(type: "int", nullable: false),
|
||||
Code = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_verificationCodes", x => x.ID);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "verificationCodes");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,449 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
partial class HushianDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Identity.Models.VerificationCode", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("verificationCodes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
using Hushian.Application;
|
||||
using Hushian.Infrastructure;
|
||||
using Hushian.Persistence;
|
||||
using Hushian.WebApi;
|
||||
|
||||
@@ -12,7 +13,10 @@ builder.Services.AddOpenApi();
|
||||
|
||||
builder.Services.ConfigureApplicationServices(builder.Configuration);
|
||||
builder.Services.ConfigurePersistenceServices(builder.Configuration);
|
||||
builder.Services.ConfigureInfrastractureServices(builder.Configuration);
|
||||
builder.Services.AddSignalR();
|
||||
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
@@ -21,7 +25,6 @@ if (app.Environment.IsDevelopment())
|
||||
app.MapOpenApi();
|
||||
}
|
||||
|
||||
|
||||
app.MapHub<ChatNotificationHub>("/chatNotificationHub");
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
@@ -6,19 +6,33 @@
|
||||
@inject NavigationManager navigation;
|
||||
|
||||
<div class="header-form">
|
||||
<img src="/before/assets/images/Hushian-logo.svg" width="133" alt="Hushian" class="lg:hidden mb-3">
|
||||
|
||||
<span>@Title</span>
|
||||
<span style="font-size: small;white-space: pre-line;">@Title</span>
|
||||
</div>
|
||||
<p></p>
|
||||
@if (type == VerificationCodeType.ForgetPassword)
|
||||
{
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<TextInput @bind-value=code type="text" name="code" style="text-align:center;margin-left: 10px;" placeholder="کد ارسال شده" required="required" />
|
||||
<div style="justify-content: space-between;margin-top:5px;;margin-bottom:15px">
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code1" @oninput="MoveNext"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input1" />
|
||||
|
||||
</div>
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code2" @oninput="MoveNext"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input2" />
|
||||
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code3" @oninput="MoveNext"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input3" />
|
||||
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code4" @oninput="OnLastInput"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input4" />
|
||||
</div>
|
||||
|
||||
<div style="justify-content: space-between">
|
||||
<TextInput @bind-value=Value type="password" name="Value" style="text-align:center;margin-top: 10px;;margin-left: 10px" placeholder="کلمه عبور جدید" required="required" />
|
||||
<TextInput @bind-value=ReValue type="password" name="ReValue" style="text-align:center;margin-top: 10px;;margin-left: 10px" placeholder="تکرار کلمه عبور جدید" required="required" />
|
||||
|
||||
@@ -28,10 +42,28 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<TextInput @bind-value=code type="text" name="code" style="text-align:center;margin-left: 10px;" placeholder="کد ارسال شده" required="required" />
|
||||
<div style="justify-content: space-between;margin-top:5px">
|
||||
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code1" @oninput="MoveNext"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input1" />
|
||||
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code2" @oninput="MoveNext"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input2" />
|
||||
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code3" @oninput="MoveNext"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input3" />
|
||||
|
||||
<input maxlength="1" type="text" inputmode="numeric" pattern="[0-9]*"
|
||||
@bind="code4" @oninput="OnLastInput"
|
||||
style="width: 40px; height: 40px; text-align: center; border: 2px solid #ccc; border-radius: 5px; font-size: 20px;"
|
||||
@ref="input4" />
|
||||
|
||||
<Button Loading=loading LoadingText="ارسال درخواست" @onclick=onClick Color="ButtonColor.Success"> احراز </Button>
|
||||
|
||||
</div>
|
||||
}
|
||||
@@ -59,6 +91,10 @@ else
|
||||
bool loading = false;
|
||||
string resendmsg = "ارسال مجدد";
|
||||
bool Disabledresendmsg = false;
|
||||
//-----------------
|
||||
private string code1, code2, code3, code4;
|
||||
|
||||
private ElementReference input1, input2, input3, input4;
|
||||
}
|
||||
@functions {
|
||||
protected override async Task OnParametersSetAsync()
|
||||
@@ -125,5 +161,35 @@ else
|
||||
}
|
||||
loading = false;
|
||||
}
|
||||
private async Task MoveNext(ChangeEventArgs e)
|
||||
{
|
||||
if (e.Value?.ToString()?.Length == 1)
|
||||
{
|
||||
if (input1.Context == null) return;
|
||||
|
||||
if (string.IsNullOrEmpty(code1))
|
||||
await input2.FocusAsync();
|
||||
else if (string.IsNullOrEmpty(code2))
|
||||
await input3.FocusAsync();
|
||||
else if (string.IsNullOrEmpty(code3))
|
||||
await input4.FocusAsync();
|
||||
else if (string.IsNullOrEmpty(code4))
|
||||
{
|
||||
code = $"{code1}{code2}{code3}{code4}";
|
||||
}
|
||||
}
|
||||
}
|
||||
private async Task OnLastInput(ChangeEventArgs e)
|
||||
{
|
||||
code4 = e.Value?.ToString();
|
||||
|
||||
if (!string.IsNullOrEmpty(code4) && code4.Length == 1)
|
||||
{
|
||||
code = $"{code1}{code2}{code3}{code4}";
|
||||
if(type==VerificationCodeType.PhoneNumberConfirmed)
|
||||
await onClick();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -91,7 +91,7 @@
|
||||
parameters.Add("sendValue", Username);
|
||||
parameters.Add("ID", 0);
|
||||
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<VerificationCodeType>(this, CallBackVer));
|
||||
parameters.Add("Title", "بازیابی کلمه عبور");
|
||||
parameters.Add("Title", "بازیابی کلمه عبور" + '\n' + "برای تکمیل کد پبامک شده را وارد کنید");
|
||||
await modal.ShowAsync<Verification>(title: "احراز", parameters: parameters);
|
||||
}
|
||||
async Task CallBackVer(VerificationCodeType type)
|
||||
|
@@ -23,7 +23,7 @@
|
||||
کاربر گرامی، لطفاً توجه فرمایید که شمارههمراه واردشده به نام خودتان باشد .
|
||||
</div>
|
||||
</div>
|
||||
<form id="primary_form" class="form" method="post">
|
||||
<form id="primary_form" class="form">
|
||||
<div class=" group w-full">
|
||||
<label class="block mb-2 text-slate-600 font-bold" for="PhoneNumber">
|
||||
شماره همراه
|
||||
@@ -91,7 +91,7 @@
|
||||
</div> *@
|
||||
|
||||
<div class=" space-y-5 flex flex-col items-center">
|
||||
<Button Loading=Loading LoadingText="منتظر بمانید" @onclick=onClick Color="ButtonColor.Success" Type="ButtonType.Submit" Class="btn-primary w-full mb-4 lg:mb-0"> ثبت نام </Button>
|
||||
<Button Loading=Loading LoadingText="منتظر بمانید" @onclick=onClick Color="ButtonColor.Success" Type="ButtonType.Button" Class="btn-primary w-full mb-4 lg:mb-0"> ثبت نام </Button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
}
|
||||
async Task onClick()
|
||||
{
|
||||
|
||||
//-----------validate
|
||||
if (string.IsNullOrEmpty(FullName))
|
||||
{
|
||||
@@ -167,7 +168,7 @@
|
||||
parameters.Add("type", VerificationCodeType.PhoneNumberConfirmed);
|
||||
parameters.Add("sendValue", PhoneNumber);
|
||||
parameters.Add("ID", ID);
|
||||
parameters.Add("Title", "ثبت نام با موفقیت انجام شد برای استفاده کاربری را احرار کنید");
|
||||
parameters.Add("Title", "ثبت نام با موفقیت انجام شد" +'\n'+ "برای تکمیل کد پبامک شده را وارد کنید");
|
||||
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<VerificationCodeType>(this, CallBackVer));
|
||||
await modal.ShowAsync<Verification>(title: "احراز", parameters: parameters);
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5137/api/") });
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5089/api/") });
|
||||
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
|
||||
builder.Services.AddScoped<BaseController>();
|
||||
builder.Services.AddScoped<AuthService>();
|
||||
|
Reference in New Issue
Block a user