...
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Common.Dtos
|
|||||||
public class aiNewResponseDto
|
public class aiNewResponseDto
|
||||||
{
|
{
|
||||||
public int companyId { get; set; }
|
public int companyId { get; set; }
|
||||||
public int userId { get; set; }
|
public string aiKeyUser { get; set; }
|
||||||
public string requestText { get; set; }
|
public string requestText { get; set; }
|
||||||
}
|
}
|
||||||
public class aiResponseDto
|
public class aiResponseDto
|
||||||
|
@@ -32,7 +32,7 @@ namespace Hushian.Application.Services
|
|||||||
var entity = new AIA
|
var entity = new AIA
|
||||||
{
|
{
|
||||||
CompanyID = dto.companyId,
|
CompanyID = dto.companyId,
|
||||||
UserID = dto.userId,
|
aiKeyUser = dto.aiKeyUser,
|
||||||
Request = dto.requestText,
|
Request = dto.requestText,
|
||||||
Response = responeai,
|
Response = responeai,
|
||||||
Cdatetime = DateTime.Now
|
Cdatetime = DateTime.Now
|
||||||
@@ -50,11 +50,11 @@ namespace Hushian.Application.Services
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<aiResponseDto>> GetCurrent(int companyId, int userId)
|
public async Task<List<aiResponseDto>> GetCurrent(int companyId, string aiKeyUser)
|
||||||
{
|
{
|
||||||
return await _aiaRepository
|
return await _aiaRepository
|
||||||
.Get()
|
.Get()
|
||||||
.Where(w => w.CompanyID == companyId && w.UserID == userId && w.Cdatetime.AddHours(3) >= DateTime.Now)
|
.Where(w => w.CompanyID == companyId && w.aiKeyUser == aiKeyUser && w.Cdatetime.AddHours(3) >= DateTime.Now)
|
||||||
.OrderBy(o => o.ID)
|
.OrderBy(o => o.ID)
|
||||||
.Select(s=>new aiResponseDto() { responseText = s.Response, requestText = s.Request,dateTime=s.Cdatetime})
|
.Select(s=>new aiResponseDto() { responseText = s.Response, requestText = s.Request,dateTime=s.Cdatetime})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using Hushian.Domain.Abstracts;
|
using Hushian.Domain.Abstracts;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -13,9 +14,11 @@ namespace Hushian.Domain.Entites
|
|||||||
public DateTime Cdatetime { get; set; } = DateTime.Now;
|
public DateTime Cdatetime { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
public int CompanyID { get; set; }
|
public int CompanyID { get; set; }
|
||||||
public int UserID { get; set; }
|
public string aiKeyUser { get; set; }
|
||||||
public string Request { get; set; }
|
public string Request { get; set; }
|
||||||
public string Response { get; set; }
|
public string Response { get; set; }
|
||||||
|
[ForeignKey("CompanyID")]
|
||||||
|
public Company company { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
534
Infrastructure/Persistence/Migrations/20250818094257_chngrtbai.Designer.cs
generated
Normal file
534
Infrastructure/Persistence/Migrations/20250818094257_chngrtbai.Designer.cs
generated
Normal file
@@ -0,0 +1,534 @@
|
|||||||
|
// <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("20250818094257_chngrtbai")]
|
||||||
|
partial class chngrtbai
|
||||||
|
{
|
||||||
|
/// <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<string>("aiKeyUser")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("ID");
|
||||||
|
|
||||||
|
b.HasIndex("CompanyID");
|
||||||
|
|
||||||
|
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.AIA", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CompanyID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("company");
|
||||||
|
});
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,61 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -44,11 +44,14 @@ namespace Hushian.Persistence.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<int>("UserID")
|
b.Property<string>("aiKeyUser")
|
||||||
.HasColumnType("int");
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
|
b.HasIndex("CompanyID");
|
||||||
|
|
||||||
b.ToTable("AIAs");
|
b.ToTable("AIAs");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -374,6 +377,17 @@ namespace Hushian.Persistence.Migrations
|
|||||||
b.ToTable("verificationCodes");
|
b.ToTable("verificationCodes");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hushian.Domain.Entites.AIA", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CompanyID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("company");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||||
|
@@ -11,7 +11,7 @@ namespace Hushian.WebApi.Controllers.v1
|
|||||||
{
|
{
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v1/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize]
|
// [Authorize]
|
||||||
public class ConversationController : ControllerBase
|
public class ConversationController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly ConversationService _conversationService;
|
private readonly ConversationService _conversationService;
|
||||||
@@ -80,6 +80,7 @@ namespace Hushian.WebApi.Controllers.v1
|
|||||||
}
|
}
|
||||||
//*
|
//*
|
||||||
[HttpPost("NewConversationFromCurrentUser")]
|
[HttpPost("NewConversationFromCurrentUser")]
|
||||||
|
[Authorize(Roles = "User")]
|
||||||
public async Task<ActionResult> NewConversationFromCurrentUser(ADD_ConversationDto conversation)
|
public async Task<ActionResult> NewConversationFromCurrentUser(ADD_ConversationDto conversation)
|
||||||
{
|
{
|
||||||
conversation.UserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => Convert.ToInt32( s.Value)).First();
|
conversation.UserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => Convert.ToInt32( s.Value)).First();
|
||||||
@@ -168,21 +169,21 @@ namespace Hushian.WebApi.Controllers.v1
|
|||||||
return Ok(response) ;
|
return Ok(response) ;
|
||||||
}
|
}
|
||||||
[HttpPost("ai/NewResponse")]
|
[HttpPost("ai/NewResponse")]
|
||||||
[Authorize(Roles = "User")]
|
//[Authorize(Roles = "User")]
|
||||||
public async Task<ActionResult> ainewresponse(aiNewResponseDto dto)
|
public async Task<ActionResult> ainewresponse(aiNewResponseDto dto)
|
||||||
{
|
{
|
||||||
string strUserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
//string strUserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
||||||
dto.userId = Convert.ToInt32(strUserID);
|
//dto.userId = Convert.ToInt32(strUserID);
|
||||||
var response = await _aIService.NewRequest(dto);
|
var response = await _aIService.NewRequest(dto);
|
||||||
return response.Success ? Ok(response.Value):BadRequest(response.Errors);
|
return response.Success ? Ok(response.Value):BadRequest(response.Errors);
|
||||||
}
|
}
|
||||||
[HttpGet("ai/CurrentResponse/{companyID}")]
|
[HttpGet("ai/CurrentResponse/{companyID}/{aiKeyUser}")]
|
||||||
[Authorize(Roles = "User")]
|
//[Authorize(Roles = "User")]
|
||||||
public async Task<ActionResult> aiCurrentResponse(int companyID)
|
public async Task<ActionResult> aiCurrentResponse(int companyID,string aiKeyUser)
|
||||||
{
|
{
|
||||||
string strUserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
//string strUserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
||||||
var UserId = Convert.ToInt32(strUserID);
|
//var UserId = Convert.ToInt32(strUserID);
|
||||||
var response = await _aIService.GetCurrent(companyID,UserId);
|
var response = await _aIService.GetCurrent(companyID, aiKeyUser);
|
||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="left-side" style="align-self: center;">
|
<div class="left-side" style="align-self: center;">
|
||||||
<div>
|
<div>
|
||||||
<img src="/before/assets/images/Hushian-logo.svg" alt="Hushian" class="hidden lg:block">
|
<img src="/before/assets/images/logofilehushian.png" width="130" alt="Hushian" class="hidden lg:block">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-right py-5">
|
<div class="text-right py-5">
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
IconName="IconName.BootstrapFill"
|
IconName="IconName.BootstrapFill"
|
||||||
Title="هوشــیان"
|
Title="هوشــیان"
|
||||||
BadgeText="v1.3.1"
|
BadgeText="v1.3.1"
|
||||||
ImageSrc="/before/assets/images/hushian-logo.svg"
|
ImageSrc="/before/assets/images/logofilehushian.png"
|
||||||
DataProvider="SidebarDataProvider"
|
DataProvider="SidebarDataProvider"
|
||||||
Width="200"
|
Width="200"
|
||||||
WidthUnit="Unit.Px" />
|
WidthUnit="Unit.Px" />
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="header-form">
|
<div class="header-form">
|
||||||
<img src="/Before/assets/images/Hushian-logo.svg" width="133" alt="Hushian" class="lg:hidden mb-3">
|
<img src="/Before/assets/images/logofilehushian.png" width="130" alt="Hushian" class="lg:hidden mb-3">
|
||||||
<span>
|
<span>
|
||||||
بازیابی کلمه عبور
|
بازیابی کلمه عبور
|
||||||
</span>
|
</span>
|
||||||
|
@@ -7,14 +7,14 @@
|
|||||||
<Modal @ref="modal" />
|
<Modal @ref="modal" />
|
||||||
@inject AuthService auth;
|
@inject AuthService auth;
|
||||||
@inject NavigationManager navigationManager;
|
@inject NavigationManager navigationManager;
|
||||||
<PageTitle>هوشیان / ورود بخش شرکت ها</PageTitle>
|
<PageTitle>هوشیان / ورود بخش مدیریت</PageTitle>
|
||||||
<ConfirmDialog @ref="dialog" />
|
<ConfirmDialog @ref="dialog" />
|
||||||
|
|
||||||
<div class="header-form">
|
<div class="header-form">
|
||||||
<img src="/before/assets/images/Hushian-logo.svg" width="133" alt="Hushian" class="lg:hidden mb-3">
|
<img src="/before/assets/images/logofilehushian.png" width="130" alt="Hushian" class="lg:hidden mb-3">
|
||||||
|
|
||||||
<span>ورود</span>
|
<span>ورود</span>
|
||||||
<span>به هوشیان</span>
|
<span>بخش مدیریت</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<EditForm id="primary_form" class="form" Model="model" OnSubmit="onClick" FormName="LoginForm">
|
<EditForm id="primary_form" class="form" Model="model" OnSubmit="onClick" FormName="LoginForm">
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<PageTitle>هوشیان / ثبت نام</PageTitle>
|
<PageTitle>هوشیان / ثبت نام</PageTitle>
|
||||||
<div class="header-form">
|
<div class="header-form">
|
||||||
<img src="/Before/assets/images/Hushian-logo.svg" width="133" alt="Hushian" class="lg:hidden mb-3">
|
<img src="/Before/assets/images/logofilehushian.png" width="133" alt="Hushian" class="lg:hidden mb-3">
|
||||||
<span>حساب کاربری خود را در هوشیان بسازید</span>
|
<span>حساب کاربری خود را در هوشیان بسازید</span>
|
||||||
</div>
|
</div>
|
||||||
<div class=" flex justify-center text-start gap-2 items-center bg-yellow-300 bg-opacity-30 py-3 px-2 rounded-md text-yellow-800 text-sm">
|
<div class=" flex justify-center text-start gap-2 items-center bg-yellow-300 bg-opacity-30 py-3 px-2 rounded-md text-yellow-800 text-sm">
|
||||||
|
@@ -7,21 +7,27 @@
|
|||||||
@inject ToastService toastService
|
@inject ToastService toastService
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
@layout UserPanelLayout
|
@layout UserPanelLayout
|
||||||
|
@using Common.Dtos.Company
|
||||||
@using HushianWebApp.Service
|
@using HushianWebApp.Service
|
||||||
@using HushianWebApp.Services
|
@using HushianWebApp.Services
|
||||||
@using Microsoft.AspNetCore.Components.Web
|
@using Microsoft.AspNetCore.Components.Web
|
||||||
|
@inject CompanyService companyService
|
||||||
|
@inject ToastService toastService
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row" style="height:85vh">
|
<div class="row" style="height:85vh">
|
||||||
@if (isReady)
|
@if (isReady)
|
||||||
{
|
{
|
||||||
@if (isLogin)
|
@if (isLogin)
|
||||||
{
|
{
|
||||||
<div class="col-md-12 d-flex flex-column">
|
<div class="col-md-12 d-flex flex-column" style="margin-top:10px">
|
||||||
<div class="input-group mb-2">
|
<div class="input-group">
|
||||||
<p class="form-control fw-bold text-primary" style="border:none;align-self:center">گفتگو هوش مصنوعی</p>
|
<p type="text" class="form-control fw-bold text-primary" style="border:none;align-self: center;" aria-describedby="basic-addon1">دستیار هوشمند @CompanyInfo.FullName</p>
|
||||||
|
|
||||||
<div class="d-flex gap-2 ms-auto">
|
<div class="d-flex gap-2 ms-auto">
|
||||||
<Button Color="ButtonColor.Secondary" Size=ButtonSize.ExtraSmall Outline="true" @onclick="Logout">خروج</Button>
|
|
||||||
|
<Button Color="ButtonColor.Secondary" Size=ButtonSize.ExtraSmall Outline="true" @onclick="Logout" Class="logout-btn">
|
||||||
|
<Icon Name="IconName.BoxArrowRight" Class="me-1" /> خروج
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-fill chat-area-container" id="ai-chat">
|
<div class="flex-fill chat-area-container" id="ai-chat">
|
||||||
@@ -32,7 +38,7 @@
|
|||||||
{
|
{
|
||||||
<div class="d-flex mb-2 justify-content-start">
|
<div class="d-flex mb-2 justify-content-start">
|
||||||
<div class="chat-bubble chat-other">
|
<div class="chat-bubble chat-other">
|
||||||
@msg.requestText
|
@msg.requestText
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -79,39 +85,44 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
ReadANDUpdate_CompanyDto? CompanyInfo = new();
|
||||||
[Parameter] public int CompanyID { get; set; }
|
[Parameter] public int CompanyID { get; set; }
|
||||||
List<aiResponseDto> messages = new();
|
List<aiResponseDto> messages = new();
|
||||||
string inputText = string.Empty;
|
string inputText = string.Empty;
|
||||||
bool isLogin = false;
|
bool isLogin = false;
|
||||||
bool isReady = false;
|
bool isReady = false;
|
||||||
|
public string aikeyUser { get; set; }
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
await EnsureAuth();
|
await EnsureAuth();
|
||||||
if (isLogin)
|
if (isLogin)
|
||||||
{
|
{
|
||||||
await LoadMessages();
|
CompanyInfo = await companyService.GetCompany(CompanyID);
|
||||||
|
if (CompanyInfo != null)
|
||||||
|
await LoadMessages();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toastService.Notify(new ToastMessage(ToastType.Danger, "شناسه شرکت صحیح نمی باشد"));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task EnsureAuth()
|
private async Task EnsureAuth()
|
||||||
{
|
{
|
||||||
var token = await localStorageService.GetItem<string>("U/key");
|
aikeyUser = await localStorageService.GetItem<string>("aikeyUser");
|
||||||
if (string.IsNullOrEmpty(token))
|
if (string.IsNullOrEmpty(aikeyUser))
|
||||||
{
|
{
|
||||||
isLogin = false;
|
aikeyUser = Guid.NewGuid().ToString();
|
||||||
isReady = true;
|
await localStorageService.SetItem("aikeyUser", aikeyUser);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
await baseController.RemoveToken();
|
isLogin = true;
|
||||||
await baseController.SetToken(token);
|
|
||||||
isLogin = await authService.IsOnline();
|
|
||||||
isReady = true;
|
isReady = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadMessages()
|
private async Task LoadMessages()
|
||||||
{
|
{
|
||||||
messages = await conversationService.GetAiCurrentResponses(CompanyID);
|
messages = await conversationService.GetAiCurrentResponses(CompanyID,aikeyUser);
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
await JS.InvokeVoidAsync("scrollToBottom", "ai-chat");
|
await JS.InvokeVoidAsync("scrollToBottom", "ai-chat");
|
||||||
}
|
}
|
||||||
@@ -119,13 +130,8 @@
|
|||||||
private async Task Send()
|
private async Task Send()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(inputText)) return;
|
if (string.IsNullOrWhiteSpace(inputText)) return;
|
||||||
var token = await localStorageService.GetItem<string>("U/key");
|
|
||||||
if (!isLogin || string.IsNullOrEmpty(token))
|
var dto = new aiNewResponseDto { companyId = CompanyID, aiKeyUser = aikeyUser, requestText = inputText };
|
||||||
{
|
|
||||||
toastService.Notify(new ToastMessage(ToastType.Warning, "ابتدا وارد شوید"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var dto = new aiNewResponseDto { companyId = CompanyID, userId = 0, requestText = inputText };
|
|
||||||
var okmodel = await conversationService.AiNewResponse(dto);
|
var okmodel = await conversationService.AiNewResponse(dto);
|
||||||
if (okmodel!=null)
|
if (okmodel!=null)
|
||||||
{
|
{
|
||||||
@@ -147,8 +153,7 @@
|
|||||||
|
|
||||||
private async Task Logout()
|
private async Task Logout()
|
||||||
{
|
{
|
||||||
await baseController.RemoveToken();
|
await localStorageService.RemoveItem("aiKeyUser");
|
||||||
await localStorageService.RemoveItem("U/key");
|
|
||||||
isLogin = false;
|
isLogin = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,6 +201,43 @@
|
|||||||
.input-wrapper { display:flex; align-items:center; gap:.75rem; }
|
.input-wrapper { display:flex; align-items:center; gap:.75rem; }
|
||||||
.message-input { flex:1; border:none; background:transparent; padding:.5rem .75rem; font-size:.95rem; color:#495057; outline:none; border-radius:20px; }
|
.message-input { flex:1; border:none; background:transparent; padding:.5rem .75rem; font-size:.95rem; color:#495057; outline:none; border-radius:20px; }
|
||||||
.send-btn { border-radius:50%; width:38px; height:38px; padding:0; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#0d6efd 0%,#0b5ed7 100%); border:none; box-shadow:0 4px 12px rgba(13,110,253,.3); color:white; }
|
.send-btn { border-radius:50%; width:38px; height:38px; padding:0; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#0d6efd 0%,#0b5ed7 100%); border:none; box-shadow:0 4px 12px rgba(13,110,253,.3); color:white; }
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
border-radius: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
padding: 0.375rem 0.75rem;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
border-width: 2px;
|
||||||
|
box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
|
||||||
|
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout-btn:hover {
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
|
||||||
|
border-color: #6c757d;
|
||||||
|
background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Improved input group styling */
|
||||||
|
.input-group {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
@using HushianWebApp.Services
|
@using HushianWebApp.Services
|
||||||
@using Microsoft.AspNetCore.SignalR.Client;
|
@using Microsoft.AspNetCore.SignalR.Client;
|
||||||
@using System.Threading;
|
@using System.Threading;
|
||||||
|
<PageTitle>گفتگو با @CompanyInfo.FullName</PageTitle>
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject ChatService ChatService
|
@inject ChatService ChatService
|
||||||
@inject ILocalStorageService localStorageService;
|
@inject ILocalStorageService localStorageService;
|
||||||
|
@@ -98,9 +98,9 @@ namespace HushianWebApp.Service
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AI conversation endpoints
|
// AI conversation endpoints
|
||||||
public async Task<List<aiResponseDto>> GetAiCurrentResponses(int companyId)
|
public async Task<List<aiResponseDto>> GetAiCurrentResponses(int companyId,string aiKeyUser)
|
||||||
{
|
{
|
||||||
var response = await _baseController.Get($"{BaseRoute}ai/CurrentResponse/{companyId}");
|
var response = await _baseController.Get($"{BaseRoute}ai/CurrentResponse/{companyId}/{aiKeyUser}");
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
return await response.Content.ReadFromJsonAsync<List<aiResponseDto>>();
|
return await response.Content.ReadFromJsonAsync<List<aiResponseDto>>();
|
||||||
|
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
Binary file not shown.
After Width: | Height: | Size: 555 KiB |
5
Presentation/HushianWebApp/wwwroot/favicon.svg
Normal file
5
Presentation/HushianWebApp/wwwroot/favicon.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="250" height="250">
|
||||||
|
<path d="M0 0 C82.5 0 165 0 250 0 C250 82.5 250 165 250 250 C167.5 250 85 250 0 250 C0 167.5 0 85 0 0 Z " fill="#004F8D" transform="translate(0,0)"/>
|
||||||
|
<path d="M0 0 C16.17 0 32.34 0 49 0 C49.01458252 4.21370361 49.02916504 8.42740723 49.04418945 12.76879883 C49.09457584 26.70674526 49.16102937 40.64458109 49.23571491 54.58241749 C49.28059619 63.03108786 49.32002836 71.47971681 49.34643555 79.9284668 C49.36947793 87.29618341 49.40294513 94.66376806 49.44870156 102.03137988 C49.47255003 105.92905428 49.49133346 109.82659867 49.49761391 113.72434425 C49.50370298 117.40078543 49.52383876 121.07689431 49.55427551 124.75321198 C49.56712022 126.72987998 49.56549631 128.70662586 49.5632782 130.68333435 C49.68344397 142.19869043 51.63837021 152.82207291 59 162 C67.59080561 169.94896381 77.9881894 170.56434422 89.2421875 170.37109375 C96.97734493 169.60722685 103.578718 166.97498311 109 161.3125 C115.03058658 153.53157244 117.09771611 144.62321705 117.15821838 134.92556763 C117.1680072 133.73092392 117.17779602 132.53628021 117.18788147 131.30543518 C117.19363693 130.0085527 117.1993924 128.71167023 117.20532227 127.37548828 C117.21491036 125.98545547 117.22492098 124.59542553 117.23532104 123.20539856 C117.2622753 119.4434955 117.28333596 115.68158001 117.30332303 111.91963434 C117.3252413 107.98382479 117.35260133 104.04805312 117.37937927 100.11227417 C117.42922737 92.66451683 117.47419534 85.21673837 117.51740164 77.76893985 C117.56684152 69.28767952 117.62173455 60.80645722 117.67708123 52.3252337 C117.79078022 34.88352291 117.89692561 17.44177704 118 0 C134.5 0 151 0 168 0 C168.11326462 18.98593884 168.20520234 37.97160028 168.25906086 56.95779228 C168.28474308 65.77520802 168.31970031 74.59239753 168.37719727 83.40966797 C168.42734049 91.10295692 168.45936336 98.79608188 168.47044247 106.48952973 C168.47690948 110.55584742 168.49189464 114.62169634 168.52865028 118.6878624 C168.75848226 145.14912449 167.26381554 168.69654997 148 189 C131.35378986 205.27629436 108.54491768 212.39088523 85.69458008 212.31567383 C83.70062801 212.31252076 81.70669474 212.33683422 79.71289062 212.36132812 C57.1397995 212.37248635 36.78169045 204.81434569 20.27734375 189.30078125 C7.11347042 176.00143066 -0.13638515 158.34315833 -0.12025452 139.61549377 C-0.12162918 138.37740463 -0.12300385 137.13931549 -0.12442017 135.8637085 C-0.120882 134.51013159 -0.11724721 133.15655493 -0.11352539 131.80297852 C-0.11324302 130.36354067 -0.11340223 128.92410268 -0.1139679 127.48466492 C-0.11425392 123.59262885 -0.10838874 119.70062382 -0.10139394 115.80859494 C-0.0951279 111.73534889 -0.09455403 107.66210206 -0.09336853 103.58885193 C-0.09026479 95.88256373 -0.08206432 88.17628977 -0.07201904 80.47000784 C-0.06082817 71.69371457 -0.05533996 62.91742061 -0.05032361 54.14112198 C-0.03988089 36.09407161 -0.02154732 18.04704076 0 0 Z " fill="#FEFEFE" transform="translate(41,20)"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
@@ -4,13 +4,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Hushian</title>
|
<title>هوشیان</title>
|
||||||
<base href="/" />
|
<base href="/" />
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet" />
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||||
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
||||||
<link rel="stylesheet" href="css/app.css" />
|
<link rel="stylesheet" href="css/app.css" />
|
||||||
<link rel="icon" type="image/png" href="favicon.png" />
|
<link rel="icon" type="image/png" href="favicon.svg" />
|
||||||
<link href="HushianWebApp.styles.css" rel="stylesheet" />
|
<link href="HushianWebApp.styles.css" rel="stylesheet" />
|
||||||
<link href="manifest.webmanifest" rel="manifest" />
|
<link href="manifest.webmanifest" rel="manifest" />
|
||||||
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
|
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
|
||||||
|
Reference in New Issue
Block a user