chat implemented

This commit is contained in:
andrei-mihnea-cerbu
2024-04-08 11:41:48 +03:00
parent 48eb2adcbd
commit 90604e48ae
101 changed files with 1493 additions and 116 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace HealthcareManager.API.Controllers;
namespace API.Controllers;
[Route("api/v1/[controller]")]
[ApiController]
+30 -5
View File
@@ -1,13 +1,38 @@
using Infrastructure.Services.MongoDB;
using Application.Endpoints;
using Application.Endpoints.Chats;
using Application.Services.Database;
using Application.Services.Database.MongoDB;
using Microsoft.AspNetCore.Mvc;
namespace HealthcareManager.API.Controllers;
namespace API.Controllers;
public class ChatController : BaseApiController
{
private readonly MongoDbService _mongoDbService;
private readonly IChatMongoDbService _chatMongoDbService;
private readonly IPatientRepository _patientRepository;
private readonly IDoctorRepository _doctorRepository;
public ChatController(MongoDbService mongoDbService)
public ChatController(IChatMongoDbService chatMongoDbService, IPatientRepository patientRepository,
IDoctorRepository doctorRepository)
{
_mongoDbService = mongoDbService;
_chatMongoDbService = chatMongoDbService;
_patientRepository = patientRepository;
_doctorRepository = doctorRepository;
}
[HttpPost("send_message")]
public async Task<ActionResult<BaseResponse>> SendMessage(SendMessageDto sendMessageDto)
{
var handler = new ChatHandler(_chatMongoDbService, _patientRepository, _doctorRepository);
var response = await handler.HandleSendMessage(sendMessageDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
[HttpPost("get_conversation")]
public async Task<ActionResult<BaseResponse>> GetConversation(GetConversationDto getConversationDto)
{
var handler = new ChatHandler(_chatMongoDbService, _patientRepository, _doctorRepository);
var response = await handler.HandleGetConversation(getConversationDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
}
@@ -1,5 +1,4 @@
using Application.Endpoints;
using Application.Endpoints.MedicalHistories;
using Application.Endpoints.MedicalHistories.FileManagement;
using Application.Endpoints.MedicalHistories.ManageAuthorization;
using Application.Services.Database;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+8 -16
View File
@@ -14,14 +14,12 @@
"outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -71,7 +69,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"
}
}
},
@@ -85,14 +83,12 @@
"outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -140,7 +136,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"
}
}
},
@@ -154,14 +150,12 @@
"outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -201,7 +195,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"
}
}
},
@@ -215,14 +209,12 @@
"outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -299,7 +291,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"
}
}
}
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("API")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b4eca98e0a616e4db63ed57610d69f27f43f4765")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+48eb2adcbd149cd66c77ba558f492179d2bf29be")]
[assembly: System.Reflection.AssemblyProductAttribute("API")]
[assembly: System.Reflection.AssemblyTitleAttribute("API")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
ff25e4eabd78a6c8257b3187d0c0a6d7ce9f93113ce81c3dc173c29363b6a20a
cc7d9b4ecce8ad49edceb7e1fc600191ff73496bc5e8ba133547c9fecdb2ede7
@@ -1 +1 @@
3416e3272dd0e47374f982bfa273624c68a9149bad5e6bd93b7898d980bc8f46
06fc5bd1554959a9b32bbdb9ef6b3f86b090ac26bcc67914d438a39ee322e613
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/b4eca98e0a616e4db63ed57610d69f27f43f4765/*"}}
{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/48eb2adcbd149cd66c77ba558f492179d2bf29be/*"}}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -4
View File
@@ -2563,14 +2563,12 @@
"outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -2620,7 +2618,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "nH+v0/ZQ0hK0w3knyskezmqQzqvqCYUEVhsdP2suOMyzmw/bxzwSVgn9E+iUU+5wOUyeCGutEG5PTTU1y/XNwA==",
"dgSpecHash": "f284KYOFt8NNaBMtQ+GQr+AC+cYCvPu42AskbUFahjE7cUFhv9yDsDCBcW2s8rWAMLTjGLOSDrurjNp2Qc4qyA==",
"success": true,
"projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj",
"expectedPackageFiles": [
+1 -1
View File
@@ -1 +1 @@
"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","projectName":"API","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj"},"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"Swashbuckle.AspNetCore":{"target":"Package","version":"[6.5.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"}}
"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","projectName":"API","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj"},"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"Swashbuckle.AspNetCore":{"target":"Package","version":"[6.5.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"}}
@@ -1 +1 @@
17125194878710486
17125558124497896
+1 -1
View File
@@ -1 +1 @@
17125195144135930
17125584645920469