Compare commits
5 Commits
ba3bffd9eb
...
changeuser
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
214112a92a | ||
|
|
58975ce589 | ||
|
|
337fbba488 | ||
|
|
8a8239908f | ||
|
|
d93c3dce8a |
@@ -411,10 +411,9 @@ namespace Hushian.Application.Services
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public async Task<ResponseBase<ChatItemDto>> GetLastOpenChatInCompany(int CompanyID, int UserID)
|
public async Task<ChatItemDto?> GetLastOpenChatInCompany(int CompanyID, int UserID)
|
||||||
{
|
{
|
||||||
ResponseBase<ChatItemDto> Response = new();
|
return await _ConversationRepository.Get()
|
||||||
Response.Value = await _ConversationRepository.Get()
|
|
||||||
.Include(inc => inc.Group)
|
.Include(inc => inc.Group)
|
||||||
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
||||||
.Where(w => w.UserID == UserID && w.CompanyID == CompanyID && w.Status != ConversationStatus.Finished)
|
.Where(w => w.UserID == UserID && w.CompanyID == CompanyID && w.Status != ConversationStatus.Finished)
|
||||||
@@ -449,13 +448,11 @@ namespace Hushian.Application.Services
|
|||||||
|
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (Response.Value != null) Response.Success = true;
|
|
||||||
return Response;
|
|
||||||
}
|
}
|
||||||
public async Task<ResponseBase<ChatItemDto>> GetChat(int ChatID, int UserID)
|
public async Task<ChatItemDto?> GetChat(int ChatID, int UserID)
|
||||||
{
|
{
|
||||||
ResponseBase<ChatItemDto> Response = new();
|
return await _ConversationRepository.Get()
|
||||||
Response.Value = await _ConversationRepository.Get()
|
|
||||||
.Include(inc => inc.Group)
|
.Include(inc => inc.Group)
|
||||||
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
||||||
.Where(w => w.UserID == UserID && w.ID == ChatID)
|
.Where(w => w.UserID == UserID && w.ID == ChatID)
|
||||||
@@ -490,8 +487,7 @@ namespace Hushian.Application.Services
|
|||||||
|
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (Response.Value != null) Response.Success = true;
|
|
||||||
return Response;
|
|
||||||
}
|
}
|
||||||
public async Task WriteInHubFromCompany(ChatItemResponseDto item, string ToUser)
|
public async Task WriteInHubFromCompany(ChatItemResponseDto item, string ToUser)
|
||||||
{
|
{
|
||||||
@@ -524,5 +520,22 @@ namespace Hushian.Application.Services
|
|||||||
.SendAsync("NewChat", CompanyID);
|
.SendAsync("NewChat", CompanyID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<(int, int)?> GetLastChat(int UserID)
|
||||||
|
{
|
||||||
|
int companyid = 0;
|
||||||
|
var request = _ConversationRepository.Get()
|
||||||
|
.Include(inc => inc.Group)
|
||||||
|
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
||||||
|
.Where(w => w.UserID == UserID)
|
||||||
|
.OrderByDescending(o => o.ID);
|
||||||
|
var item1=await request.Select(s => s.ID).FirstOrDefaultAsync();
|
||||||
|
if (item1 == null) return null;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
companyid = await request.Select(s => s.CompanyID).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (item1,companyid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,425 +0,0 @@
|
|||||||
// <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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,425 +0,0 @@
|
|||||||
// <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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,452 +0,0 @@
|
|||||||
// <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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,490 +0,0 @@
|
|||||||
// <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("20250815213829_tbpromt")]
|
|
||||||
partial class tbpromt
|
|
||||||
{
|
|
||||||
/// <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.Prompt", 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>("Test")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.HasKey("ID");
|
|
||||||
|
|
||||||
b.HasIndex("CompanyID");
|
|
||||||
|
|
||||||
b.ToTable("prompts");
|
|
||||||
});
|
|
||||||
|
|
||||||
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.Prompt", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
|
||||||
.WithMany("prompts")
|
|
||||||
.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");
|
|
||||||
|
|
||||||
b.Navigation("prompts");
|
|
||||||
});
|
|
||||||
|
|
||||||
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,48 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Hushian.Persistence.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class tbpromt : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "prompts",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
ID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
||||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
Test = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_prompts", x => x.ID);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_prompts_Companies_CompanyID",
|
|
||||||
column: x => x.CompanyID,
|
|
||||||
principalTable: "Companies",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_prompts_CompanyID",
|
|
||||||
table: "prompts",
|
|
||||||
column: "CompanyID");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "prompts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,520 +0,0 @@
|
|||||||
// <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("20250817205731_newtable")]
|
|
||||||
partial class newtable
|
|
||||||
{
|
|
||||||
/// <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.AIA", 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>("Request")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<string>("Response")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<int>("UserID")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.HasKey("ID");
|
|
||||||
|
|
||||||
b.ToTable("AIAs");
|
|
||||||
});
|
|
||||||
|
|
||||||
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.Prompt", 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>("Test")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.HasKey("ID");
|
|
||||||
|
|
||||||
b.HasIndex("CompanyID");
|
|
||||||
|
|
||||||
b.ToTable("prompts");
|
|
||||||
});
|
|
||||||
|
|
||||||
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.Prompt", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
|
||||||
.WithMany("prompts")
|
|
||||||
.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");
|
|
||||||
|
|
||||||
b.Navigation("prompts");
|
|
||||||
});
|
|
||||||
|
|
||||||
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,39 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Hushian.Persistence.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class newtable : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AIAs",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
ID = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
||||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
UserID = table.Column<int>(type: "int", nullable: false),
|
|
||||||
Request = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
||||||
Response = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AIAs", x => x.ID);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "AIAs");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Hushian.Persistence.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class chngrtbai : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "UserID",
|
|
||||||
table: "AIAs");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "aiKeyUser",
|
|
||||||
table: "AIAs",
|
|
||||||
type: "nvarchar(max)",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AIAs_CompanyID",
|
|
||||||
table: "AIAs",
|
|
||||||
column: "CompanyID");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AIAs_Companies_CompanyID",
|
|
||||||
table: "AIAs",
|
|
||||||
column: "CompanyID",
|
|
||||||
principalTable: "Companies",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AIAs_Companies_CompanyID",
|
|
||||||
table: "AIAs");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_AIAs_CompanyID",
|
|
||||||
table: "AIAs");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "aiKeyUser",
|
|
||||||
table: "AIAs");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "UserID",
|
|
||||||
table: "AIAs",
|
|
||||||
type: "int",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
namespace Hushian.Persistence.Migrations
|
namespace Hushian.Persistence.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(HushianDbContext))]
|
[DbContext(typeof(HushianDbContext))]
|
||||||
[Migration("20250818094257_chngrtbai")]
|
[Migration("20251023075422_Newdb")]
|
||||||
partial class chngrtbai
|
partial class Newdb
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
namespace Hushian.Persistence.Migrations
|
namespace Hushian.Persistence.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class InitalDB : Migration
|
public partial class Newdb : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
@@ -49,6 +49,45 @@ namespace Hushian.Persistence.Migrations
|
|||||||
table.PrimaryKey("PK_Users", x => x.ID);
|
table.PrimaryKey("PK_Users", x => x.ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "AIAs",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
ID = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||||
|
aiKeyUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Request = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Response = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AIAs", x => x.ID);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_AIAs_Companies_CompanyID",
|
||||||
|
column: x => x.CompanyID,
|
||||||
|
principalTable: "Companies",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "CompanyContentInfo",
|
name: "CompanyContentInfo",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -118,6 +157,27 @@ namespace Hushian.Persistence.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "prompts",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
ID = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Test = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_prompts", x => x.ID);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_prompts_Companies_CompanyID",
|
||||||
|
column: x => x.CompanyID,
|
||||||
|
principalTable: "Companies",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Conversations",
|
name: "Conversations",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -168,8 +228,7 @@ namespace Hushian.Persistence.Migrations
|
|||||||
name: "FK_EG_Expers_ExperID",
|
name: "FK_EG_Expers_ExperID",
|
||||||
column: x => x.ExperID,
|
column: x => x.ExperID,
|
||||||
principalTable: "Expers",
|
principalTable: "Expers",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID");
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_EG_Groups_GroupID",
|
name: "FK_EG_Groups_GroupID",
|
||||||
column: x => x.GroupID,
|
column: x => x.GroupID,
|
||||||
@@ -210,6 +269,11 @@ namespace Hushian.Persistence.Migrations
|
|||||||
principalColumn: "ID");
|
principalColumn: "ID");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_AIAs_CompanyID",
|
||||||
|
table: "AIAs",
|
||||||
|
column: "CompanyID");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_CompanyContentInfo_CompanyID",
|
name: "IX_CompanyContentInfo_CompanyID",
|
||||||
table: "CompanyContentInfo",
|
table: "CompanyContentInfo",
|
||||||
@@ -254,11 +318,19 @@ namespace Hushian.Persistence.Migrations
|
|||||||
name: "IX_Groups_CompanyID",
|
name: "IX_Groups_CompanyID",
|
||||||
table: "Groups",
|
table: "Groups",
|
||||||
column: "CompanyID");
|
column: "CompanyID");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_prompts_CompanyID",
|
||||||
|
table: "prompts",
|
||||||
|
column: "CompanyID");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "AIAs");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "CompanyContentInfo");
|
name: "CompanyContentInfo");
|
||||||
|
|
||||||
@@ -268,6 +340,12 @@ namespace Hushian.Persistence.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "EG");
|
name: "EG");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "prompts");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "verificationCodes");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Conversations");
|
name: "Conversations");
|
||||||
|
|
||||||
@@ -50,7 +50,18 @@ namespace Hushian.WebApi.Controllers.v1
|
|||||||
int UserID = Convert.ToInt32(strUserID);
|
int UserID = Convert.ToInt32(strUserID);
|
||||||
var response = await _chatService.GetLastOpenChatInCompany(CompanyID,UserID);
|
var response = await _chatService.GetLastOpenChatInCompany(CompanyID,UserID);
|
||||||
|
|
||||||
return response.Success ? Ok(response.Value) : Accepted() ;
|
return Ok(response);
|
||||||
|
|
||||||
|
}
|
||||||
|
[HttpGet("User/LastChat")]
|
||||||
|
[Authorize(Roles = "User")]
|
||||||
|
public async Task<ActionResult> GetLastChat()
|
||||||
|
{
|
||||||
|
string strUserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
||||||
|
int UserID = Convert.ToInt32(strUserID);
|
||||||
|
var response = await _chatService.GetLastChat(UserID);
|
||||||
|
|
||||||
|
return Ok(response);
|
||||||
|
|
||||||
}
|
}
|
||||||
[HttpGet("User/Chat/{ChatID}")]
|
[HttpGet("User/Chat/{ChatID}")]
|
||||||
@@ -61,7 +72,7 @@ namespace Hushian.WebApi.Controllers.v1
|
|||||||
int UserID = Convert.ToInt32(strUserID);
|
int UserID = Convert.ToInt32(strUserID);
|
||||||
var response = await _chatService.GetChat(ChatID, UserID);
|
var response = await _chatService.GetChat(ChatID, UserID);
|
||||||
|
|
||||||
return response.Success ? Ok(response.Value) : Accepted();
|
return response==null ? NotFound() : Ok(response);
|
||||||
|
|
||||||
}
|
}
|
||||||
[HttpGet("ChatsAwaitingOurResponse")]
|
[HttpGet("ChatsAwaitingOurResponse")]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"MainConnectionString": "Data Source=195.88.208.142;Initial Catalog=Hushian;User ID=sa;Password=M439610m@;TrustServerCertificate=True"
|
"MainConnectionString": "Data Source=156.255.1.229;Initial Catalog=HushianIR;User ID=sa;Password=SAPassw0rd;TrustServerCertificate=True"
|
||||||
},
|
},
|
||||||
"EmailSettings": {
|
"EmailSettings": {
|
||||||
"ApiKey": "SendGrid_Key_Here",
|
"ApiKey": "SendGrid_Key_Here",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
"aigrpcserver": {
|
"aigrpcserver": {
|
||||||
"target": "192.168.1.14:5042"
|
"target": "156.255.1.229:5042"
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -18,8 +18,6 @@
|
|||||||
Href="/"
|
Href="/"
|
||||||
IconName="IconName.BootstrapFill"
|
IconName="IconName.BootstrapFill"
|
||||||
Title="هوشــیان"
|
Title="هوشــیان"
|
||||||
BadgeText="v1.3.1"
|
|
||||||
ImageSrc="/before/assets/images/logofilehushian.png"
|
|
||||||
DataProvider="SidebarDataProvider"
|
DataProvider="SidebarDataProvider"
|
||||||
Width="200"
|
Width="200"
|
||||||
WidthUnit="Unit.Px" />
|
WidthUnit="Unit.Px" />
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,18 @@
|
|||||||
@using Common.Validation
|
@using Common.Validation
|
||||||
@using HushianWebApp.Service
|
@using HushianWebApp.Service
|
||||||
|
@using HushianWebApp.Services
|
||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@inject VerificationService verificationService;
|
@inject VerificationService verificationService;
|
||||||
|
@inject NavigationManager navigationManager;
|
||||||
|
@page "/UserPanelLogin"
|
||||||
|
@layout UserPanelLayout
|
||||||
|
@inject ILocalStorageService localStorageService;
|
||||||
|
@inject ChatService chatService;
|
||||||
|
<div class="d-flex justify-content-center align-items-center" style="height: 100%;">
|
||||||
|
<div class="login-container p-4 bg-white rounded shadow-sm" style="max-width: 400px; width: 100%;">
|
||||||
|
<div class="text-center mb-4">
|
||||||
|
<h4 class="text-primary mb-2">ورود به سیستم</h4>
|
||||||
|
</div>
|
||||||
<div class="login-form">
|
<div class="login-form">
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<span class="badge bg-info p-2 rounded-pill">نیاز برای ارتباط با کارشناسان وارد شود</span>
|
<span class="badge bg-info p-2 rounded-pill">نیاز برای ارتباط با کارشناسان وارد شود</span>
|
||||||
@@ -70,11 +81,11 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private bool visible = false;
|
private bool visible = false;
|
||||||
[Parameter] public EventCallback OnMultipleOfThree { get; set; }
|
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
public int ID { get; set; } = 0;
|
public int ID { get; set; } = 0;
|
||||||
private string _code = string.Empty;
|
private string _code = string.Empty;
|
||||||
@@ -144,7 +155,34 @@
|
|||||||
{
|
{
|
||||||
visible = true;
|
visible = true;
|
||||||
if (await AuthService.Verificationlogin(ID, Code))
|
if (await AuthService.Verificationlogin(ID, Code))
|
||||||
await OnMultipleOfThree.InvokeAsync();
|
{
|
||||||
|
int CompanyID = await localStorageService.GetItem<int>("CompanyID");
|
||||||
|
int GroupID = await localStorageService.GetItem<int>("GroupID");
|
||||||
|
int ChatID = await localStorageService.GetItem<int>("ChatID");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (CompanyID==null || CompanyID == 0)
|
||||||
|
{
|
||||||
|
var response= await chatService.GetLastChat();
|
||||||
|
CompanyID = response.Value.Item2;
|
||||||
|
ChatID = response.Value.Item1;
|
||||||
|
//----------------------------------------
|
||||||
|
|
||||||
|
if (CompanyID!=null && CompanyID!=0) await localStorageService.SetItem("CompanyID", CompanyID);
|
||||||
|
if (ChatID!=null && ChatID!=0)
|
||||||
|
{
|
||||||
|
await localStorageService.RemoveItem("ChatID");
|
||||||
|
await localStorageService.SetItem("ChatID", ChatID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
string route = $"UserCP/{CompanyID}";
|
||||||
|
if (ChatID!=null && ChatID!=0) route += $"?ChatID={ChatID}";
|
||||||
|
if (GroupID!=null && GroupID!=0 && !(ChatID!=null && ChatID!=0)) route += $"?GroupID={GroupID}";
|
||||||
|
|
||||||
|
navigationManager.NavigateTo(route);
|
||||||
|
}
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
// private async Task MoveNext(ChangeEventArgs e)
|
// private async Task MoveNext(ChangeEventArgs e)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@page "/UserCP/{CompanyID:int}"
|
@page "/UserCP/{CompanyID:int}"
|
||||||
@page "/UserCP/{CompanyID:int}/{ChatID:int?}"
|
|
||||||
@using Common.Dtos.Company
|
@using Common.Dtos.Company
|
||||||
@using Common.Dtos.Conversation
|
@using Common.Dtos.Conversation
|
||||||
@using Common.Dtos.Group
|
@using Common.Dtos.Group
|
||||||
@@ -13,6 +12,7 @@
|
|||||||
{
|
{
|
||||||
<PageTitle>گفتگو با @CompanyInfo?.FullName</PageTitle>
|
<PageTitle>گفتگو با @CompanyInfo?.FullName</PageTitle>
|
||||||
}
|
}
|
||||||
|
|
||||||
@implements IAsyncDisposable
|
@implements IAsyncDisposable
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject ChatService ChatService
|
@inject ChatService ChatService
|
||||||
@@ -27,22 +27,23 @@
|
|||||||
@inject ToastService toastService
|
@inject ToastService toastService
|
||||||
@inject HttpClient _Http;
|
@inject HttpClient _Http;
|
||||||
@layout UserPanelLayout
|
@layout UserPanelLayout
|
||||||
|
|
||||||
<ConfirmDialog @ref="dialog" />
|
<ConfirmDialog @ref="dialog" />
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row" style="height:85vh">
|
<div class="row" style="height:85vh">
|
||||||
@if (IsEndFirstProcess)
|
@if (IsEndFirstProcess)
|
||||||
{
|
{
|
||||||
@if (IsLogin)
|
if (string.IsNullOrEmpty(Error))
|
||||||
{
|
{
|
||||||
<div class="col-md-12 d-flex flex-column" id="B">
|
<div class="col-md-12 d-flex flex-column" id="B">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@if (LastOpenChat != null)
|
@if (Chat != null)
|
||||||
{
|
{
|
||||||
<p type="text" class="form-control fw-bold text-primary" style="border:none;align-self: center;" aria-describedby="basic-addon1">@ExperYou</p>
|
<p type="text" class="form-control fw-bold text-primary" style="border:none;align-self: center;" aria-describedby="basic-addon1">@ExperYou</p>
|
||||||
}
|
}
|
||||||
<div class="d-flex gap-2 ms-auto">
|
<div class="d-flex gap-2 ms-auto">
|
||||||
@if (LastOpenChat != null)
|
@if (Chat != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
<Button Color="ButtonColor.Success" Size=ButtonSize.ExtraSmall Outline="true" @onclick="NewChat" Class="new-conversation-btn">
|
<Button Color="ButtonColor.Success" Size=ButtonSize.ExtraSmall Outline="true" @onclick="NewChat" Class="new-conversation-btn">
|
||||||
@@ -56,15 +57,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- B1: Chat area -->
|
<!-- B1: Chat area -->
|
||||||
<div class="flex-fill chat-area-container" id="B1">
|
<div class="flex-fill chat-area-container" id="B1">
|
||||||
@if (LastOpenChat != null && LastOpenChat.Responses != null)
|
@if (Chat != null && Chat.Responses != null)
|
||||||
{
|
{
|
||||||
<div class="chat-container p-3">
|
<div class="chat-container p-3">
|
||||||
@{
|
@{
|
||||||
bool target = false;
|
bool target = false;
|
||||||
}
|
}
|
||||||
@foreach (var msg in LastOpenChat?.Responses)
|
@foreach (var msg in Chat?.Responses)
|
||||||
{
|
{
|
||||||
@if (!target && ((!msg.IsRead && msg.Type != Common.Enums.ConversationType.UE) || LastOpenChat.Responses.Last() == msg))
|
@if (!target && ((!msg.IsRead && msg.Type != Common.Enums.ConversationType.UE) || Chat.Responses.Last() == msg))
|
||||||
{
|
{
|
||||||
target = true;
|
target = true;
|
||||||
<div id="target" class="chat-separator">
|
<div id="target" class="chat-separator">
|
||||||
@@ -77,8 +78,8 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="d-flex mb-2 @(msg.Type!=Common.Enums.ConversationType.UE ? "justify-content-end" : "justify-content-start")">
|
<div class="d-flex mb-2 @(msg.Type != Common.Enums.ConversationType.UE ? "justify-content-end" : "justify-content-start")">
|
||||||
<div class="chat-bubble @(msg.Type!=Common.Enums.ConversationType.UE ? "chat-mine": "chat-other")" data-id="@msg.ID">
|
<div class="chat-bubble @(msg.Type != Common.Enums.ConversationType.UE ? "chat-mine" : "chat-other")" data-id="@msg.ID">
|
||||||
@if (msg.FileContent != null && msg.FileContent.Length > 0 && !string.IsNullOrWhiteSpace(msg.FileType))
|
@if (msg.FileContent != null && msg.FileContent.Length > 0 && !string.IsNullOrWhiteSpace(msg.FileType))
|
||||||
{
|
{
|
||||||
@if (msg.FileType.StartsWith("image/"))
|
@if (msg.FileType.StartsWith("image/"))
|
||||||
@@ -137,10 +138,10 @@
|
|||||||
<div class="groups-container mt-4">
|
<div class="groups-container mt-4">
|
||||||
<h6 class="text-center mb-3 text-muted">انتخاب گروه:</h6>
|
<h6 class="text-center mb-3 text-muted">انتخاب گروه:</h6>
|
||||||
<div class="groups-grid">
|
<div class="groups-grid">
|
||||||
@foreach (var group in CompanyGroups.Where(w=>w.Available))
|
@foreach (var group in CompanyGroups.Where(w => w.Available))
|
||||||
{
|
{
|
||||||
<div class="group-card @(GroupID == group.ID ? "selected" : "")"
|
<div class="group-card @(GroupID == group.ID ? "selected" : "")"
|
||||||
@onclick="() => SelectGroup(group.ID)">
|
@onclick="() => SelectGroup(group.ID)">
|
||||||
<div class="group-card-content">
|
<div class="group-card-content">
|
||||||
@if (group.img == null || group.img.Length == 0)
|
@if (group.img == null || group.img.Length == 0)
|
||||||
{
|
{
|
||||||
@@ -163,7 +164,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (CompanyInfo != null && (LastOpenChat == null || (LastOpenChat != null && LastOpenChat.status != Common.Enums.ConversationStatus.Finished && LastOpenChat.Responses != null)))
|
@if (CompanyInfo != null && (Chat == null || (Chat != null && Chat.status != Common.Enums.ConversationStatus.Finished && Chat.Responses != null)))
|
||||||
{
|
{
|
||||||
<!-- B2: Message input -->
|
<!-- B2: Message input -->
|
||||||
<div class="message-input-container" id="B2">
|
<div class="message-input-container" id="B2">
|
||||||
@@ -175,13 +176,12 @@
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<!-- Audio Recording Button -->
|
<!-- Audio Recording Button -->
|
||||||
<Button Color="@(IsRecording ? ButtonColor.Danger : ButtonColor.Secondary)"
|
<Button Color="@(IsRecording? ButtonColor.Danger: ButtonColor.Secondary)"
|
||||||
Size=ButtonSize.Small
|
Size=ButtonSize.Small
|
||||||
Outline="true"
|
Outline="true"
|
||||||
@onclick="ToggleAudioRecording"
|
@onclick="ToggleAudioRecording"
|
||||||
class=@($"audio-btn {(IsRecording ? "recording" : "")}")
|
class=@($"audio-btn {(IsRecording ? "recording" : "")}")
|
||||||
title="@(IsRecording ? "توقف ضبط" : "ضبط صدا")"
|
title="@(IsRecording ? "توقف ضبط" : "ضبط صدا")">
|
||||||
>
|
|
||||||
@if (IsRecording)
|
@if (IsRecording)
|
||||||
{
|
{
|
||||||
<Icon Name="IconName.StopCircle" Class="recording-pulse" />
|
<Icon Name="IconName.StopCircle" Class="recording-pulse" />
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@if (LastOpenChat!=null && LastOpenChat.status == Common.Enums.ConversationStatus.InProgress)
|
@if (Chat != null && Chat.status == Common.Enums.ConversationStatus.InProgress)
|
||||||
{
|
{
|
||||||
<Button Color="ButtonColor.Danger" Size=ButtonSize.ExtraSmall Outline="true" @onclick="CloseChat" Class="finish-conversation-btn">
|
<Button Color="ButtonColor.Danger" Size=ButtonSize.ExtraSmall Outline="true" @onclick="CloseChat" Class="finish-conversation-btn">
|
||||||
<Icon Name="IconName.Escape" Class="me-1" /> اتمام گفتگو
|
<Icon Name="IconName.Escape" Class="me-1" /> اتمام گفتگو
|
||||||
@@ -243,23 +243,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (LastOpenChat.status == Common.Enums.ConversationStatus.Finished)
|
@if (Chat?.status == Common.Enums.ConversationStatus.Finished)
|
||||||
{
|
{
|
||||||
<p style="color: red;text-align: center;font-weight: bold;">این گفتگو به پایان رسیده</p>
|
<p style="color: red;text-align: center;font-weight: bold;">این گفتگو به پایان رسیده</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="d-flex justify-content-center align-items-center" style="height: 100%;">
|
<div class="d-flex justify-content-center align-items-center" style="height: 100%;">
|
||||||
<div class="login-container p-4 bg-white rounded shadow-sm" style="max-width: 400px; width: 100%;">
|
<div class="text-center">
|
||||||
<div class="text-center mb-4">
|
<Alert Color="AlertColor.Danger" Dismissable="false">
|
||||||
<h4 class="text-primary mb-2">ورود به سیستم</h4>
|
<Icon Name="IconName.ExclamationTriangleFill" class="me-2"></Icon>@Error </Alert>
|
||||||
</div>
|
|
||||||
<LoginComponent OnMultipleOfThree="EventCallback.Factory.Create(this, Afterlogin)" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -270,36 +272,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@code {
|
@code {
|
||||||
[Parameter] public int CompanyID { get; set; }
|
|
||||||
[Parameter] public int? ChatID { get; set; }
|
#region fild
|
||||||
private ConfirmDialog dialog = default!;
|
private bool IsEndFirstProcess { get; set; } = false;
|
||||||
private HubConnection? hubConnection;
|
|
||||||
private bool _shouldObserveVisibility = false;
|
private bool _shouldObserveVisibility = false;
|
||||||
int? GroupID = null;
|
|
||||||
ReadANDUpdate_CompanyDto? CompanyInfo = new();
|
|
||||||
Common.Dtos.CurrentUserInfo CurrentUser = new();
|
|
||||||
List<Read_GroupDto> CompanyGroups = new();
|
|
||||||
ChatItemDto? LastOpenChat = null;
|
|
||||||
string MsgInput = string.Empty;
|
string MsgInput = string.Empty;
|
||||||
IBrowserFile? SelectedImageFile = null;
|
|
||||||
byte[]? SelectedImageBytes = null;
|
|
||||||
string? SelectedImagePreview = null;
|
|
||||||
|
|
||||||
// Audio recording properties
|
|
||||||
bool IsRecording = false;
|
|
||||||
string RecordingTime = "00:00";
|
|
||||||
byte[]? RecordedAudioBytes = null;
|
|
||||||
string? RecordedAudioUrl = null;
|
|
||||||
string RecordedAudioDuration = "00:00";
|
|
||||||
private System.Threading.Timer? recordingTimer;
|
|
||||||
private DateTime recordingStartTime;
|
|
||||||
|
|
||||||
bool chatloading = false;
|
bool chatloading = false;
|
||||||
public bool IsLogin { get; set; } = false;
|
|
||||||
public bool IsEndFirstProcess { get; set; } = false;
|
|
||||||
string ExperYou
|
string ExperYou
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -311,23 +294,57 @@
|
|||||||
value += "/" + CompanyGroups.FirstOrDefault(f => f.ID == GroupID.GetValueOrDefault()).Name;
|
value += "/" + CompanyGroups.FirstOrDefault(f => f.ID == GroupID.GetValueOrDefault()).Name;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (LastOpenChat != null && LastOpenChat.Responses!=null)
|
if (Chat != null && Chat.Responses != null)
|
||||||
{
|
{
|
||||||
var model = LastOpenChat.Responses.OrderBy(o => o.ID).LastOrDefault(l => l.Type != Common.Enums.ConversationType.UE);
|
var model = Chat.Responses.OrderBy(o => o.ID).LastOrDefault(l => l.Type != Common.Enums.ConversationType.UE);
|
||||||
|
|
||||||
if (model!=null && model.Type==Common.Enums.ConversationType.CU && !string.IsNullOrEmpty(CompanyInfo.FullNameManager))
|
if (model != null && model.Type == Common.Enums.ConversationType.CU && !string.IsNullOrEmpty(CompanyInfo.FullNameManager))
|
||||||
{
|
{
|
||||||
value += "/" + CompanyInfo.FullNameManager;
|
value += "/" + CompanyInfo.FullNameManager;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (!string.IsNullOrEmpty(LastOpenChat.ExperFullName))
|
if (!string.IsNullOrEmpty(Chat.ExperFullName))
|
||||||
value += "/" + LastOpenChat.ExperFullName;
|
value += "/" + Chat.ExperFullName;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
string Error = "";
|
||||||
|
#endregion
|
||||||
|
#region Image
|
||||||
|
IBrowserFile? SelectedImageFile = null;
|
||||||
|
byte[]? SelectedImageBytes = null;
|
||||||
|
string? SelectedImagePreview = null;
|
||||||
|
#endregion
|
||||||
|
#region Audio recording properties
|
||||||
|
bool IsRecording = false;
|
||||||
|
string RecordingTime = "00:00";
|
||||||
|
byte[]? RecordedAudioBytes = null;
|
||||||
|
string? RecordedAudioUrl = null;
|
||||||
|
string RecordedAudioDuration = "00:00";
|
||||||
|
private System.Threading.Timer? recordingTimer;
|
||||||
|
private DateTime recordingStartTime;
|
||||||
|
#endregion
|
||||||
|
#region Parameter
|
||||||
|
[Parameter] public int CompanyID { get; set; }
|
||||||
|
|
||||||
// Audio recording methods
|
[SupplyParameterFromQuery(Name = "ChatID")]
|
||||||
|
private int? ChatID { get; set; }
|
||||||
|
|
||||||
|
[SupplyParameterFromQuery(Name = "GroupID")]
|
||||||
|
private int? GroupID { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
ConfirmDialog dialog = default!;
|
||||||
|
HubConnection? hubConnection;
|
||||||
|
ReadANDUpdate_CompanyDto? CompanyInfo = null;
|
||||||
|
Common.Dtos.CurrentUserInfo CurrentUser = new();
|
||||||
|
List<Read_GroupDto> CompanyGroups = new();
|
||||||
|
ChatItemDto? Chat = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
@functions{
|
||||||
|
#region Audio recording methods
|
||||||
private async Task ToggleAudioRecording()
|
private async Task ToggleAudioRecording()
|
||||||
{
|
{
|
||||||
if (IsRecording)
|
if (IsRecording)
|
||||||
@@ -416,271 +433,10 @@
|
|||||||
? string.Empty
|
? string.Empty
|
||||||
: $"data:{fileType};base64,{Convert.ToBase64String(content)}";
|
: $"data:{fileType};base64,{Convert.ToBase64String(content)}";
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
@functions {
|
@functions {
|
||||||
async Task OnClickSendMsg()
|
#region Image
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(MsgInput) || SelectedImageFile != null || RecordedAudioBytes != null)
|
|
||||||
{
|
|
||||||
if (LastOpenChat != null)
|
|
||||||
{
|
|
||||||
Common.Enums.ConversationType type = Common.Enums.ConversationType.UE;
|
|
||||||
ChatItemResponseDto? model;
|
|
||||||
|
|
||||||
if (SelectedImageFile != null)
|
|
||||||
{
|
|
||||||
var bytes = SelectedImageBytes ?? Array.Empty<byte>();
|
|
||||||
model = await chatService.ADDChatResponse(
|
|
||||||
LastOpenChat.ID,
|
|
||||||
MsgInput,
|
|
||||||
type,
|
|
||||||
SelectedImageFile.Name,
|
|
||||||
SelectedImageFile.ContentType,
|
|
||||||
bytes);
|
|
||||||
}
|
|
||||||
else if (RecordedAudioBytes != null)
|
|
||||||
{
|
|
||||||
// Send audio message
|
|
||||||
var fileName = $"audio_{DateTimeOffset.Now.ToUnixTimeSeconds()}.wav";
|
|
||||||
model = await chatService.ADDChatResponse(
|
|
||||||
LastOpenChat.ID,
|
|
||||||
MsgInput,
|
|
||||||
type,
|
|
||||||
fileName,
|
|
||||||
"audio/wav",
|
|
||||||
RecordedAudioBytes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
model = await chatService.ADDChatResponse(LastOpenChat.ID, MsgInput, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
LastOpenChat?.Responses.Add(model);
|
|
||||||
LastOpenChat.LastText = MsgInput;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//TODO New Chat
|
|
||||||
var model = await chatService.NewChatFromCurrentUser(new ADD_ConversationDto()
|
|
||||||
{
|
|
||||||
CompanyID = CompanyID,
|
|
||||||
GroupID = GroupID,
|
|
||||||
Question = MsgInput,
|
|
||||||
UserID = 0
|
|
||||||
});
|
|
||||||
if (model != null)
|
|
||||||
{
|
|
||||||
LastOpenChat = model;
|
|
||||||
}
|
|
||||||
else toastService.Notify(new ToastMessage(ToastType.Danger, "خطا در گفتگو جدید"));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
await Task.Yield();
|
|
||||||
// Scroll to bottom for user's own messages
|
|
||||||
await JS.InvokeVoidAsync("scrollToBottom", "B1");
|
|
||||||
MsgInput = string.Empty;
|
|
||||||
SelectedImageFile = null;
|
|
||||||
SelectedImageBytes = null;
|
|
||||||
SelectedImagePreview = null;
|
|
||||||
|
|
||||||
// Clear recorded audio after sending
|
|
||||||
RecordedAudioBytes = null;
|
|
||||||
RecordedAudioUrl = null;
|
|
||||||
RecordedAudioDuration = "00:00";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
||||||
{
|
|
||||||
if (_shouldObserveVisibility)
|
|
||||||
{
|
|
||||||
_shouldObserveVisibility = false;
|
|
||||||
await JS.InvokeVoidAsync("observeVisibility", DotNetObjectReference.Create(this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
|
|
||||||
await IsOnline();
|
|
||||||
//-------------hub
|
|
||||||
var token = await localStorageService.GetItem<string>("U/key");
|
|
||||||
string AddressHub = _Http.BaseAddress.AbsoluteUri.Replace("api/", "");
|
|
||||||
|
|
||||||
hubConnection = new HubConnectionBuilder()
|
|
||||||
.WithUrl($"{AddressHub}chatNotificationHub", options =>
|
|
||||||
{
|
|
||||||
options.AccessTokenProvider = () => Task.FromResult(token);
|
|
||||||
})
|
|
||||||
.WithAutomaticReconnect()
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
hubConnection.On<ChatItemResponseDto>("ReceiveNewChatItemFromCompany",async (chatitem) =>
|
|
||||||
{
|
|
||||||
if (LastOpenChat.ID == chatitem.ChatItemID)
|
|
||||||
{
|
|
||||||
LastOpenChat.Responses.Add(chatitem);
|
|
||||||
StateHasChanged();
|
|
||||||
await MarkAsRead(chatitem.ID);
|
|
||||||
// Scroll to target if exists, otherwise scroll to bottom
|
|
||||||
await JS.InvokeVoidAsync("scrollToTargetOrBottom");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//-------------------------------------
|
|
||||||
hubConnection.On<int>("CheckMarkAsRead", async (chatresponseid) =>
|
|
||||||
{
|
|
||||||
if (LastOpenChat.Responses.Any(a=>a.ID==chatresponseid && !a.IsRead && a.Type==Common.Enums.ConversationType.UE))
|
|
||||||
{
|
|
||||||
LastOpenChat.Responses.First(a => a.ID == chatresponseid).IsRead = true;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
await hubConnection.StartAsync();
|
|
||||||
//---------end hub
|
|
||||||
await base.OnInitializedAsync();
|
|
||||||
}
|
|
||||||
async Task IsOnline()
|
|
||||||
{
|
|
||||||
var token = await localStorageService.GetItem<string>("U/key");
|
|
||||||
if (string.IsNullOrEmpty(token))
|
|
||||||
{
|
|
||||||
IsLogin = false;
|
|
||||||
IsEndFirstProcess = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await baseController.RemoveToken();
|
|
||||||
await baseController.SetToken(token);
|
|
||||||
if (!await authService.IsOnline())
|
|
||||||
{
|
|
||||||
await baseController.RemoveToken();
|
|
||||||
IsLogin = false;
|
|
||||||
IsEndFirstProcess = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IsEndFirstProcess = true;
|
|
||||||
await Afterlogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
async Task Afterlogin()
|
|
||||||
{
|
|
||||||
IsLogin = true;
|
|
||||||
CurrentUser = await userService.GetCurrentUserInfo();
|
|
||||||
await IsCompany();
|
|
||||||
}
|
|
||||||
async Task IsCompany()
|
|
||||||
{
|
|
||||||
CompanyInfo = await companyService.GetCompany(CompanyID);
|
|
||||||
if (CompanyInfo != null)
|
|
||||||
{ CompanyGroups = await groupService.GetGroupsCompany(CompanyID);
|
|
||||||
await IsLastChat();}
|
|
||||||
}
|
|
||||||
async Task IsLastChat()
|
|
||||||
{
|
|
||||||
if (CompanyInfo != null)
|
|
||||||
{
|
|
||||||
if (ChatID.HasValue) LastOpenChat = await ChatService.Getchat(ChatID.GetValueOrDefault());
|
|
||||||
else LastOpenChat = LastOpenChat = await ChatService.GetLastOpenChatInCompany(CompanyID);
|
|
||||||
|
|
||||||
if (LastOpenChat != null)
|
|
||||||
{
|
|
||||||
GroupID = LastOpenChat.GroupID;
|
|
||||||
// Always set up visibility observation for chat bubbles
|
|
||||||
_shouldObserveVisibility = true;
|
|
||||||
StateHasChanged();
|
|
||||||
|
|
||||||
// Wait for render to complete
|
|
||||||
await Task.Delay(200);
|
|
||||||
|
|
||||||
// Scroll to target if exists, otherwise scroll to bottom
|
|
||||||
await JS.InvokeVoidAsync("scrollToTargetOrBottom");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[JSInvokable]
|
|
||||||
public async Task MarkAsRead(int id)
|
|
||||||
{
|
|
||||||
if (LastOpenChat == null) return;
|
|
||||||
var msg = LastOpenChat.Responses.FirstOrDefault(m => m.ID == id);
|
|
||||||
if (msg != null && !msg.IsRead && msg.Type != Common.Enums.ConversationType.UE)
|
|
||||||
{
|
|
||||||
msg.IsRead = true;
|
|
||||||
await chatService.MarkAsReadChatItemAsync(id);
|
|
||||||
// StateHasChanged();
|
|
||||||
}
|
|
||||||
await Task.CompletedTask;
|
|
||||||
}
|
|
||||||
// Method to handle new messages from other users
|
|
||||||
public async Task HandleNewMessage()
|
|
||||||
{
|
|
||||||
if (LastOpenChat?.Responses != null)
|
|
||||||
{
|
|
||||||
var hasUnreadMessages = LastOpenChat.Responses.Any(m => !m.IsRead && m.Type != Common.Enums.ConversationType.UE);
|
|
||||||
if (hasUnreadMessages)
|
|
||||||
{
|
|
||||||
await JS.InvokeVoidAsync("autoScrollToNewMessage");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async Task NewChat()
|
|
||||||
{
|
|
||||||
LastOpenChat = null;
|
|
||||||
GroupID = null;
|
|
||||||
}
|
|
||||||
async Task CloseChat()
|
|
||||||
{
|
|
||||||
var options = new ConfirmDialogOptions
|
|
||||||
{
|
|
||||||
YesButtonText = "بله",
|
|
||||||
YesButtonColor = ButtonColor.Success,
|
|
||||||
NoButtonText = "انصراف",
|
|
||||||
NoButtonColor = ButtonColor.Danger
|
|
||||||
};
|
|
||||||
|
|
||||||
var confirmation = await dialog.ShowAsync(
|
|
||||||
title: "پایان دادن به گفتگو",
|
|
||||||
message1: "اطمینان دارید ؟",
|
|
||||||
confirmDialogOptions: options);
|
|
||||||
|
|
||||||
if (confirmation)
|
|
||||||
{
|
|
||||||
if (await chatService.ChatIsFinishFromUser(LastOpenChat.ID))
|
|
||||||
{
|
|
||||||
LastOpenChat.status = Common.Enums.ConversationStatus.Finished;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
async Task Logout()
|
|
||||||
{
|
|
||||||
await baseController.RemoveToken();
|
|
||||||
await localStorageService.RemoveItem("U/key");
|
|
||||||
IsLogin = false;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
async Task SelectGroup(int groupId)
|
|
||||||
{
|
|
||||||
GroupID = groupId;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
private string GetImageSource(byte[] bytes)
|
|
||||||
=> $"data:image/jpeg;base64,{Convert.ToBase64String(bytes)}";
|
|
||||||
private async Task HandleKeyDown(KeyboardEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Key == "Enter") await OnClickSendMsg();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@functions {
|
|
||||||
private async Task OpenFileDialog()
|
private async Task OpenFileDialog()
|
||||||
{
|
{
|
||||||
await JS.InvokeVoidAsync("triggerClick", "chatImageInput");
|
await JS.InvokeVoidAsync("triggerClick", "chatImageInput");
|
||||||
@@ -701,7 +457,7 @@
|
|||||||
await file.OpenReadStream().CopyToAsync(memoryStream);
|
await file.OpenReadStream().CopyToAsync(memoryStream);
|
||||||
SelectedImageBytes = memoryStream.ToArray();
|
SelectedImageBytes = memoryStream.ToArray();
|
||||||
SelectedImagePreview = $"data:{file.ContentType};base64,{Convert.ToBase64String(SelectedImageBytes)}";
|
SelectedImagePreview = $"data:{file.ContentType};base64,{Convert.ToBase64String(SelectedImageBytes)}";
|
||||||
await ClearRecordedAudio();
|
await ClearRecordedAudio();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task ClearSelectedImage()
|
private Task ClearSelectedImage()
|
||||||
@@ -727,6 +483,58 @@
|
|||||||
}
|
}
|
||||||
return $"image_{DateTimeOffset.Now.ToUnixTimeSeconds()}{ext}";
|
return $"image_{DateTimeOffset.Now.ToUnixTimeSeconds()}{ext}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetImageSource(byte[] bytes)
|
||||||
|
=> $"data:image/jpeg;base64,{Convert.ToBase64String(bytes)}";
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
@functions {
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
if (_shouldObserveVisibility)
|
||||||
|
{
|
||||||
|
_shouldObserveVisibility = false;
|
||||||
|
await JS.InvokeVoidAsync("observeVisibility", DotNetObjectReference.Create(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
Error = string.Empty;
|
||||||
|
IsEndFirstProcess = false;
|
||||||
|
if (await CheckLogin())
|
||||||
|
{
|
||||||
|
await GetCurrentUser();
|
||||||
|
if (await ExsistCompany())
|
||||||
|
{
|
||||||
|
await GetGroups();
|
||||||
|
|
||||||
|
if (ChatID.HasValue) await GetChatByID();
|
||||||
|
|
||||||
|
else if (GroupID.HasValue && !await ExsistGroup()) Error = $"گروه با شناسه {GroupID.Value} یافت برای شرکت {CompanyInfo.FullName} یافت نشد";
|
||||||
|
|
||||||
|
else await GetLastChat();
|
||||||
|
}
|
||||||
|
else Error = $"شرکت با شناسه {CompanyID} یافت نشد";
|
||||||
|
|
||||||
|
}
|
||||||
|
else await Login();
|
||||||
|
|
||||||
|
if (Chat != null)
|
||||||
|
{
|
||||||
|
GroupID = Chat.GroupID;
|
||||||
|
_shouldObserveVisibility = true;
|
||||||
|
StateHasChanged();
|
||||||
|
await Task.Delay(200);
|
||||||
|
await JS.InvokeVoidAsync("scrollToTargetOrBottom");
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(Error))
|
||||||
|
{
|
||||||
|
await ConectedToHub();
|
||||||
|
}
|
||||||
|
|
||||||
|
IsEndFirstProcess = true;
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
public async ValueTask DisposeAsync()
|
public async ValueTask DisposeAsync()
|
||||||
{
|
{
|
||||||
if (hubConnection is not null)
|
if (hubConnection is not null)
|
||||||
@@ -736,6 +544,254 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@functions {
|
||||||
|
//Login
|
||||||
|
async Task<bool> CheckLogin()
|
||||||
|
{
|
||||||
|
var token = await localStorageService.GetItem<string>("U/key");
|
||||||
|
if (string.IsNullOrEmpty(token)) return false;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await baseController.RemoveToken();
|
||||||
|
await baseController.SetToken(token);
|
||||||
|
if (!await authService.IsOnline())
|
||||||
|
{
|
||||||
|
await baseController.RemoveToken();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async Task Login()
|
||||||
|
{
|
||||||
|
await localStorageService.RemoveItem("CompanyID");
|
||||||
|
await localStorageService.RemoveItem("ChatID");
|
||||||
|
await localStorageService.RemoveItem("GroupID");
|
||||||
|
|
||||||
|
await localStorageService.SetItem("CompanyID", CompanyID);
|
||||||
|
if (ChatID.HasValue) await localStorageService.SetItem("ChatID", ChatID.Value);
|
||||||
|
if (GroupID.HasValue) await localStorageService.SetItem("GroupID",GroupID.Value);
|
||||||
|
|
||||||
|
NavigationManager.NavigateTo("UserPanelLogin");
|
||||||
|
}
|
||||||
|
async Task GetCurrentUser()
|
||||||
|
{
|
||||||
|
CurrentUser = await userService.GetCurrentUserInfo();
|
||||||
|
}
|
||||||
|
async Task<bool> ExsistCompany()
|
||||||
|
{
|
||||||
|
CompanyInfo = await companyService.GetCompany(CompanyID);
|
||||||
|
return CompanyInfo != null;
|
||||||
|
}
|
||||||
|
async Task GetGroups()
|
||||||
|
{
|
||||||
|
CompanyGroups = await groupService.GetGroupsCompany(CompanyID);
|
||||||
|
}
|
||||||
|
async Task<bool> ExsistGroup()
|
||||||
|
{
|
||||||
|
if (GroupID.HasValue) return (CompanyGroups.Count > 0 && CompanyGroups.Any(a => a.ID == GroupID.Value));
|
||||||
|
else return true;
|
||||||
|
}
|
||||||
|
async Task GetChatByID()
|
||||||
|
{
|
||||||
|
if (ChatID.HasValue) Chat = await ChatService.Getchat(ChatID.Value);
|
||||||
|
if (Chat == null)
|
||||||
|
{
|
||||||
|
Error = $"گفتگو با شناسه {ChatID.Value} یافت با شرکت {CompanyInfo.FullName} یافت نشد";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async Task GetLastChat()
|
||||||
|
{
|
||||||
|
Chat = await ChatService.GetLastOpenChatInCompany(CompanyID);
|
||||||
|
|
||||||
|
}
|
||||||
|
async Task OnClickSendMsg()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(MsgInput) || SelectedImageFile != null || RecordedAudioBytes != null)
|
||||||
|
{
|
||||||
|
if (Chat != null)
|
||||||
|
{
|
||||||
|
Common.Enums.ConversationType type = Common.Enums.ConversationType.UE;
|
||||||
|
ChatItemResponseDto? model;
|
||||||
|
|
||||||
|
if (SelectedImageFile != null)
|
||||||
|
{
|
||||||
|
var bytes = SelectedImageBytes ?? Array.Empty<byte>();
|
||||||
|
model = await chatService.ADDChatResponse(
|
||||||
|
Chat.ID,
|
||||||
|
MsgInput,
|
||||||
|
type,
|
||||||
|
SelectedImageFile.Name,
|
||||||
|
SelectedImageFile.ContentType,
|
||||||
|
bytes);
|
||||||
|
}
|
||||||
|
else if (RecordedAudioBytes != null)
|
||||||
|
{
|
||||||
|
// Send audio message
|
||||||
|
var fileName = $"audio_{DateTimeOffset.Now.ToUnixTimeSeconds()}.wav";
|
||||||
|
model = await chatService.ADDChatResponse(
|
||||||
|
Chat.ID,
|
||||||
|
MsgInput,
|
||||||
|
type,
|
||||||
|
fileName,
|
||||||
|
"audio/wav",
|
||||||
|
RecordedAudioBytes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
model = await chatService.ADDChatResponse(Chat.ID, MsgInput, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
Chat?.Responses.Add(model);
|
||||||
|
Chat.LastText = MsgInput;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//TODO New Chat
|
||||||
|
var model = await chatService.NewChatFromCurrentUser(new ADD_ConversationDto()
|
||||||
|
{
|
||||||
|
CompanyID = CompanyID,
|
||||||
|
GroupID = GroupID,
|
||||||
|
Question = MsgInput,
|
||||||
|
UserID = 0
|
||||||
|
});
|
||||||
|
if (model != null)
|
||||||
|
{
|
||||||
|
Chat = model;
|
||||||
|
}
|
||||||
|
else toastService.Notify(new ToastMessage(ToastType.Danger, "خطا در گفتگو جدید"));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
await Task.Yield();
|
||||||
|
// Scroll to bottom for user's own messages
|
||||||
|
await JS.InvokeVoidAsync("scrollToBottom", "B1");
|
||||||
|
MsgInput = string.Empty;
|
||||||
|
SelectedImageFile = null;
|
||||||
|
SelectedImageBytes = null;
|
||||||
|
SelectedImagePreview = null;
|
||||||
|
|
||||||
|
// Clear recorded audio after sending
|
||||||
|
RecordedAudioBytes = null;
|
||||||
|
RecordedAudioUrl = null;
|
||||||
|
RecordedAudioDuration = "00:00";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async Task ConectedToHub()
|
||||||
|
{
|
||||||
|
//-------------hub
|
||||||
|
var token = await localStorageService.GetItem<string>("U/key");
|
||||||
|
string AddressHub = _Http.BaseAddress.AbsoluteUri.Replace("api/", "");
|
||||||
|
|
||||||
|
hubConnection = new HubConnectionBuilder()
|
||||||
|
.WithUrl($"{AddressHub}chatNotificationHub", options =>
|
||||||
|
{
|
||||||
|
options.AccessTokenProvider = () => Task.FromResult(token);
|
||||||
|
})
|
||||||
|
.WithAutomaticReconnect()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
hubConnection.On<ChatItemResponseDto>("ReceiveNewChatItemFromCompany", async (chatitem) =>
|
||||||
|
{
|
||||||
|
if (Chat.ID == chatitem.ChatItemID)
|
||||||
|
{
|
||||||
|
Chat.Responses.Add(chatitem);
|
||||||
|
StateHasChanged();
|
||||||
|
await MarkAsRead(chatitem.ID);
|
||||||
|
// Scroll to target if exists, otherwise scroll to bottom
|
||||||
|
await JS.InvokeVoidAsync("scrollToTargetOrBottom");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//-------------------------------------
|
||||||
|
hubConnection.On<int>("CheckMarkAsRead", async (chatresponseid) =>
|
||||||
|
{
|
||||||
|
if (Chat.Responses.Any(a => a.ID == chatresponseid && !a.IsRead && a.Type == Common.Enums.ConversationType.UE))
|
||||||
|
{
|
||||||
|
Chat.Responses.First(a => a.ID == chatresponseid).IsRead = true;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await hubConnection.StartAsync();
|
||||||
|
//---------end hub
|
||||||
|
}
|
||||||
|
async Task SelectGroup(int groupId)
|
||||||
|
{
|
||||||
|
GroupID = groupId;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
[JSInvokable]
|
||||||
|
public async Task MarkAsRead(int id)
|
||||||
|
{
|
||||||
|
if (Chat == null) return;
|
||||||
|
var msg = Chat.Responses.FirstOrDefault(m => m.ID == id);
|
||||||
|
if (msg != null && !msg.IsRead && msg.Type != Common.Enums.ConversationType.UE)
|
||||||
|
{
|
||||||
|
msg.IsRead = true;
|
||||||
|
await chatService.MarkAsReadChatItemAsync(id);
|
||||||
|
// StateHasChanged();
|
||||||
|
}
|
||||||
|
await Task.CompletedTask;
|
||||||
|
}
|
||||||
|
// Method to handle new messages from other users
|
||||||
|
public async Task HandleNewMessage()
|
||||||
|
{
|
||||||
|
if (Chat?.Responses != null)
|
||||||
|
{
|
||||||
|
var hasUnreadMessages =Chat.Responses.Any(m => !m.IsRead && m.Type != Common.Enums.ConversationType.UE);
|
||||||
|
if (hasUnreadMessages)
|
||||||
|
{
|
||||||
|
await JS.InvokeVoidAsync("autoScrollToNewMessage");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async Task NewChat()
|
||||||
|
{
|
||||||
|
Chat = null;
|
||||||
|
GroupID = null;
|
||||||
|
}
|
||||||
|
async Task CloseChat()
|
||||||
|
{
|
||||||
|
var options = new ConfirmDialogOptions
|
||||||
|
{
|
||||||
|
YesButtonText = "بله",
|
||||||
|
YesButtonColor = ButtonColor.Success,
|
||||||
|
NoButtonText = "انصراف",
|
||||||
|
NoButtonColor = ButtonColor.Danger
|
||||||
|
};
|
||||||
|
|
||||||
|
var confirmation = await dialog.ShowAsync(
|
||||||
|
title: "پایان دادن به گفتگو",
|
||||||
|
message1: "اطمینان دارید ؟",
|
||||||
|
confirmDialogOptions: options);
|
||||||
|
|
||||||
|
if (confirmation)
|
||||||
|
{
|
||||||
|
if (await chatService.ChatIsFinishFromUser(Chat.ID))
|
||||||
|
{
|
||||||
|
Chat.status = Common.Enums.ConversationStatus.Finished;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
async Task Logout()
|
||||||
|
{
|
||||||
|
await baseController.RemoveToken();
|
||||||
|
await localStorageService.RemoveItem("U/key");
|
||||||
|
NavigationManager.NavigateTo("UserPanelLogin");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task HandleKeyDown(KeyboardEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == "Enter") await OnClickSendMsg();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.chat-bubble {
|
.chat-bubble {
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
|
|||||||
@@ -142,16 +142,16 @@ namespace HushianWebApp.Service
|
|||||||
}
|
}
|
||||||
else if (result.StatusCode == System.Net.HttpStatusCode.Forbidden)
|
else if (result.StatusCode == System.Net.HttpStatusCode.Forbidden)
|
||||||
_ToastService.Notify(new ToastMessage(ToastType.Danger, "به این بخش دسترسی ندارید"));
|
_ToastService.Notify(new ToastMessage(ToastType.Danger, "به این بخش دسترسی ندارید"));
|
||||||
else if (result.StatusCode == System.Net.HttpStatusCode.NotFound)
|
//else if (result.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||||
{
|
//{
|
||||||
string From ="" ;
|
// string From ="" ;
|
||||||
|
|
||||||
if (result.RequestMessage.RequestUri.AbsolutePath.ToString().Contains("GetCompany")) From = "شرکت";
|
// if (result.RequestMessage.RequestUri.AbsolutePath.ToString().Contains("GetCompany")) From = "شرکت";
|
||||||
|
|
||||||
_ToastService.Notify(new ToastMessage(ToastType.Danger, $"{From} یافت نشد"));
|
//_ToastService.Notify(new ToastMessage(ToastType.Danger, $"{From} یافت نشد"));
|
||||||
|
|
||||||
}
|
//}
|
||||||
else if (!result.IsSuccessStatusCode)
|
else if (!result.IsSuccessStatusCode && (result.StatusCode != System.Net.HttpStatusCode.NotFound))
|
||||||
{
|
{
|
||||||
|
|
||||||
_NavigationManager.NavigateTo("Unhandled");
|
_NavigationManager.NavigateTo("Unhandled");
|
||||||
|
|||||||
@@ -113,11 +113,19 @@ namespace HushianWebApp.Service
|
|||||||
{
|
{
|
||||||
var response = await _baseController.Get($"{BaseRoute}User/LastOpenChatInCompany/{CompanyID}");
|
var response = await _baseController.Get($"{BaseRoute}User/LastOpenChatInCompany/{CompanyID}");
|
||||||
if (response.StatusCode==System.Net.HttpStatusCode.OK)
|
if (response.StatusCode==System.Net.HttpStatusCode.OK)
|
||||||
return await response.Content.ReadFromJsonAsync<ChatItemDto>();
|
return await response.Content.ReadFromJsonAsync<ChatItemDto?>();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public async Task<ChatItemDto?> Getchat(int ChatID)
|
public async Task<(int,int)?> GetLastChat()
|
||||||
|
{
|
||||||
|
var response = await _baseController.Get($"{BaseRoute}User/LastChat");
|
||||||
|
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||||
|
return await response.Content.ReadFromJsonAsync<(int, int)?>();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public async Task<ChatItemDto?> Getchat(int ChatID)
|
||||||
{
|
{
|
||||||
var response = await _baseController.Get($"{BaseRoute}User/Chat/{ChatID}");
|
var response = await _baseController.Get($"{BaseRoute}User/Chat/{ChatID}");
|
||||||
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||||
|
|||||||
@@ -57,14 +57,15 @@ namespace HushianWebApp.Service
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public async Task<List<Read_GroupDto>?> GetGroupsCompany(int CompanyID)
|
public async Task<List<Read_GroupDto>> GetGroupsCompany(int CompanyID)
|
||||||
{
|
{
|
||||||
var response = await _baseController.Get($"{BaseRoute}GetGroupsCompany?CompanyID={CompanyID}");
|
var response = await _baseController.Get($"{BaseRoute}GetGroupsCompany?CompanyID={CompanyID}");
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
return await response.Content.ReadFromJsonAsync<List<Read_GroupDto>>();
|
var data= await response.Content.ReadFromJsonAsync<List<Read_GroupDto>>();
|
||||||
|
return data==null ?new() : data;
|
||||||
}
|
}
|
||||||
return null;
|
return new();
|
||||||
}
|
}
|
||||||
public async Task<List<Read_GroupDto>?> GetGroupsFromExperID(int ExperID)
|
public async Task<List<Read_GroupDto>?> GetGroupsFromExperID(int ExperID)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"BaseAddress": "http://192.168.1.14:2201/api/",
|
"BaseAddress": "http://localhost:5089/api/",
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
|
|||||||
@@ -34,7 +34,15 @@
|
|||||||
<span class="dismiss">🗙</span>
|
<span class="dismiss">🗙</span>
|
||||||
</div>
|
</div>
|
||||||
<script src="_framework/blazor.webassembly.js"></script>
|
<script src="_framework/blazor.webassembly.js"></script>
|
||||||
<script>navigator.serviceWorker.register('service-worker.js');</script>
|
<script>
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
window.addEventListener('load', () => {
|
||||||
|
navigator.serviceWorker.register('/service-worker.js')
|
||||||
|
.then(reg => console.log('Service Worker registered', reg))
|
||||||
|
.catch(err => console.error('Service Worker registration failed:', err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||||
<!-- Add chart.js reference if chart components are used in your application. -->
|
<!-- Add chart.js reference if chart components are used in your application. -->
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.0.1/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.0.1/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user