This commit is contained in:
mmrbnjd
2025-08-18 14:18:08 +03:30
parent 7ce8812098
commit 067607d98a
19 changed files with 715 additions and 55 deletions

View File

@@ -32,7 +32,7 @@ namespace Hushian.Application.Services
var entity = new AIA
{
CompanyID = dto.companyId,
UserID = dto.userId,
aiKeyUser = dto.aiKeyUser,
Request = dto.requestText,
Response = responeai,
Cdatetime = DateTime.Now
@@ -50,11 +50,11 @@ namespace Hushian.Application.Services
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
.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)
.Select(s=>new aiResponseDto() { responseText = s.Response, requestText = s.Request,dateTime=s.Cdatetime})
.ToListAsync();