...
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Hushian.WebApi;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
@@ -13,6 +15,11 @@ namespace Hushian.Application
|
||||
IConfiguration configuration)
|
||||
{
|
||||
services.AddAutoMapper(Assembly.GetExecutingAssembly());
|
||||
services.AddSignalR()
|
||||
.AddHubOptions<ChatNotificationHub>(options =>
|
||||
{
|
||||
options.ClientTimeoutInterval = TimeSpan.FromMinutes(5);
|
||||
});
|
||||
services.AddAuthentication(options =>
|
||||
{
|
||||
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
@@ -31,6 +38,25 @@ namespace Hushian.Application
|
||||
ValidAudience = configuration["JwtSettings:Audience"],
|
||||
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["JwtSettings:Key"]))
|
||||
};
|
||||
|
||||
// ✅ لازم برای SignalR (WebSocket + توکن از query string یا header)
|
||||
o.Events = new JwtBearerEvents
|
||||
{
|
||||
OnMessageReceived = context =>
|
||||
{
|
||||
var accessToken = context.Request.Query["access_token"];
|
||||
|
||||
// فقط برای مسیرهای SignalR
|
||||
var path = context.HttpContext.Request.Path;
|
||||
if (!string.IsNullOrEmpty(accessToken) &&
|
||||
path.StartsWithSegments("/chatNotificationHub"))
|
||||
{
|
||||
context.Token = accessToken;
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
|
@@ -7,12 +7,12 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.7" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||
<PackageReference Include="FluentValidation" Version="11.11.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.6" />
|
||||
<PackageReference Include="FluentValidation" Version="12.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.3.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@@ -52,7 +52,8 @@ namespace Hushian.Application.Services
|
||||
if (auth.Username.StartsWith("09"))
|
||||
{
|
||||
// in Company Search
|
||||
var Company = await _CompanyRepository.Get().FirstOrDefaultAsync(f => f.Mobile == auth.Username && f.Password == auth.Password.GetHash());
|
||||
var Company = await _CompanyRepository.Get()
|
||||
.FirstOrDefaultAsync(f => f.Mobile == auth.Username && f.Password == auth.Password.GetHash() && f.Verified);
|
||||
if (Company == null)
|
||||
{
|
||||
Response.Errors.Add("کاربری یافت نشد");
|
||||
@@ -64,14 +65,17 @@ namespace Hushian.Application.Services
|
||||
{
|
||||
Fullname = Company.FullName,
|
||||
Id = Company.ID,
|
||||
Role="Company",
|
||||
img=Company.logo,
|
||||
MobileOrUserName = Company.Mobile,
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await GenerateToken(Company.Mobile, Company.ID))
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await GenerateToken(Company.Mobile, Company.ID, "Company"))
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var exper = await _ExperRepository.Get().FirstOrDefaultAsync(f => f.UserName == auth.Username && f.Password == auth.Password.GetHash());
|
||||
var exper = await _ExperRepository.Get().FirstOrDefaultAsync(f => f.UserName == auth.Username
|
||||
&& f.Password == auth.Password.GetHash() && f.Available);
|
||||
if (exper == null)
|
||||
{
|
||||
Response.Errors.Add("کاربری یافت نشد");
|
||||
@@ -83,8 +87,10 @@ namespace Hushian.Application.Services
|
||||
{
|
||||
Fullname = exper.FullName,
|
||||
Id = exper.ID,
|
||||
CompanyId = exper.CompanyID,
|
||||
MobileOrUserName = exper.UserName,
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await GenerateToken(exper.UserName, exper.ID))
|
||||
Role="Exper",
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await GenerateToken(exper.UserName, exper.ID, "Exper"))
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -121,12 +127,14 @@ namespace Hushian.Application.Services
|
||||
return Response;
|
||||
}
|
||||
|
||||
public async Task<JwtSecurityToken> GenerateToken(string UserName, int userId)
|
||||
public async Task<JwtSecurityToken> GenerateToken(string UserName, int userId, string Role)
|
||||
{
|
||||
var claims = new[]
|
||||
{
|
||||
new Claim(JwtRegisteredClaimNames.Sub,UserName),
|
||||
new Claim(CustomClaimTypes.Uid,userId.ToString())
|
||||
new Claim(ClaimTypes.NameIdentifier, UserName),
|
||||
new Claim(CustomClaimTypes.Uid,userId.ToString()),
|
||||
new Claim(ClaimTypes.Role, Role)
|
||||
};
|
||||
|
||||
|
||||
|
9
Hushian.Application/Services/ChatNotificationHub.cs
Normal file
9
Hushian.Application/Services/ChatNotificationHub.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
namespace Hushian.WebApi
|
||||
{
|
||||
// Hubs/ChatNotificationHub.cs
|
||||
public class ChatNotificationHub : Hub
|
||||
{
|
||||
// انتخابی: نگهداری کاربران متصل (اختیاری برای این کاربرد)
|
||||
}
|
||||
}
|
@@ -45,9 +45,10 @@ namespace Hushian.Application.Services
|
||||
|
||||
return Response;
|
||||
}
|
||||
public async Task<ReadANDUpdate_CompanyDto> GETCompanyinformation(int CompanyID)
|
||||
public async Task<ReadANDUpdate_CompanyDto?> GETCompanyinformation(int CompanyID)
|
||||
{
|
||||
var company = await _CompanyRepository.Get().FirstOrDefaultAsync(f => f.ID == CompanyID);
|
||||
if (company == null) return null;
|
||||
return _mapper.Map<ReadANDUpdate_CompanyDto>(company);
|
||||
}
|
||||
public async Task<ResponseBase<bool>> EditCompany(ReadANDUpdate_CompanyDto model, int CompanyID)
|
||||
|
@@ -4,6 +4,8 @@ using Common.Enums;
|
||||
using Hushian.Application.Contracts.Persistence;
|
||||
using Hushian.Application.Models;
|
||||
using Hushian.Domain.Entites;
|
||||
using Hushian.WebApi;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
@@ -22,12 +24,13 @@ namespace Hushian.Application.Services
|
||||
private readonly UserService _userService;
|
||||
private readonly GroupService _groupService;
|
||||
private readonly ExperService _experService;
|
||||
private readonly IHubContext<ChatNotificationHub> _hubContext;
|
||||
|
||||
public ConversationService(
|
||||
IGenericRepository<Conversation> conversationRepository
|
||||
, IGenericRepository<ConversationResponse> conversationResponseRepository
|
||||
, CompanyService companyService, UserService userService, GroupService groupService
|
||||
, ExperService experService)
|
||||
, ExperService experService, IHubContext<ChatNotificationHub> hubContext)
|
||||
{
|
||||
_ConversationRepository = conversationRepository;
|
||||
_ConversationResponseRepository = conversationResponseRepository;
|
||||
@@ -35,6 +38,7 @@ namespace Hushian.Application.Services
|
||||
_userService = userService;
|
||||
_groupService = groupService;
|
||||
_experService = experService;
|
||||
_hubContext = hubContext;
|
||||
}
|
||||
|
||||
public async Task<ResponseBase<int>> NewConversation(ADD_ConversationDto dto, ConversationType type = ConversationType.UE)
|
||||
@@ -112,17 +116,23 @@ namespace Hushian.Application.Services
|
||||
};
|
||||
Response.Value = (await _ConversationResponseRepository.ADD(response)).ID;
|
||||
Response.Success = Response.Value > 0;
|
||||
|
||||
if (convModel.Status == ConversationStatus.Recorded && Response.Success)
|
||||
{
|
||||
convModel.Status = ConversationStatus.InProgress;
|
||||
await _ConversationRepository.UPDATE(convModel);
|
||||
}
|
||||
}
|
||||
else Response.Errors.Add("گفتگویی یافت نشد");
|
||||
}
|
||||
|
||||
return Response;
|
||||
}
|
||||
public async Task<List<Read_ConversationDto>> MyConversation(int UserID)
|
||||
public async Task<List<Read_ConversationDto>> GEtConversation(int UserID,int CompanyID)
|
||||
=> await _ConversationRepository.Get()
|
||||
.Include(inc => inc.Group)
|
||||
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
||||
.Where(w => w.UserID == UserID)
|
||||
.Where(w => w.UserID == UserID && w.CompanyID==CompanyID)
|
||||
.Select(s => new Read_ConversationDto()
|
||||
{
|
||||
ExperID = s.ConversationResponses.Last().ExperID,
|
||||
@@ -139,11 +149,32 @@ namespace Hushian.Application.Services
|
||||
UserFullName = s.User.FullName
|
||||
|
||||
}).ToListAsync();
|
||||
public async Task<List<Read_ConversationDto>> MyConversationIsFinished(int ExperID)
|
||||
public async Task<List<Read_ConversationResponseDto>> GetConversationItems(int ConversationID, int? ExperID)
|
||||
{
|
||||
return await _ConversationResponseRepository.Get()
|
||||
.Include(inc=>inc.Exper)
|
||||
.Where(w => w.ConversationID == ConversationID)
|
||||
.Select(s => new Read_ConversationResponseDto()
|
||||
{
|
||||
ConversationID=s.ConversationID,
|
||||
ExperID=s.ExperID,
|
||||
ExperName=s.Exper.FullName,
|
||||
FileContent=s.FileContent,
|
||||
FileName=s.FileName,
|
||||
FileType=s.FileType,
|
||||
ID= s.ID,
|
||||
IsRead=s.IsRead,
|
||||
text=s.Text,
|
||||
Type = s.Type
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
}
|
||||
public async Task<List<Read_ConversationDto>> GetConversationByExperID(int ExperID , ConversationStatus status)
|
||||
=> await _ConversationRepository.Get()
|
||||
.Include(inc => inc.Group)
|
||||
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
||||
.Where(w => w.ConversationResponses.Any(a => a.ExperID == ExperID) && w.Status == ConversationStatus.Finished)
|
||||
.Where(w => w.ConversationResponses.Any(a => a.ExperID == ExperID) && w.Status == status)
|
||||
.Select(s => new Read_ConversationDto()
|
||||
{
|
||||
ExperID = s.ConversationResponses.Last().ExperID,
|
||||
@@ -160,11 +191,11 @@ namespace Hushian.Application.Services
|
||||
UserFullName = s.User.FullName
|
||||
|
||||
}).ToListAsync();
|
||||
public async Task<List<Read_ConversationDto>> MyConversationIsInProgress(int ExperID)
|
||||
public async Task<List<Read_ConversationDto>> GetConversationByCompanyID(int CompanyID, ConversationStatus status)
|
||||
=> await _ConversationRepository.Get()
|
||||
.Include(inc => inc.Group)
|
||||
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
||||
.Where(w => w.ConversationResponses.Any(a => a.ExperID == ExperID) && w.Status == ConversationStatus.InProgress)
|
||||
.Where(w => w.CompanyID==CompanyID && w.Status ==status)
|
||||
.Select(s => new Read_ConversationDto()
|
||||
{
|
||||
ExperID = s.ConversationResponses.Last().ExperID,
|
||||
@@ -185,7 +216,7 @@ namespace Hushian.Application.Services
|
||||
=> await _ConversationRepository.Get()
|
||||
.Include(inc => inc.Group)
|
||||
.Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper)
|
||||
.Where(w => w.ConversationResponses.Any(a => !a.ExperID.HasValue) && w.CompanyID == CompanyID)
|
||||
.Where(w => w.Status== ConversationStatus.Recorded && w.CompanyID == CompanyID)
|
||||
.Select(s => new Read_ConversationDto()
|
||||
{
|
||||
ExperID = s.ConversationResponses.Last().ExperID,
|
||||
@@ -211,10 +242,59 @@ namespace Hushian.Application.Services
|
||||
if (convModel != null && convModel.Status != ConversationStatus.Finished)
|
||||
{
|
||||
convModel.Status = ConversationStatus.Finished;
|
||||
convModel.FinishedDateTime = DateTime.Now;
|
||||
return await _ConversationRepository.UPDATEBool(convModel);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
public async Task<bool> MarkAsReadConversationItem(int ID, ConversationType Type , int? ExperID)
|
||||
{
|
||||
var item = await _ConversationResponseRepository.Get()
|
||||
.Include(inc => inc.conversation).FirstOrDefaultAsync(w => w.ID == ID && !w.ExperID.HasValue
|
||||
&& w.conversation.Status != ConversationStatus.Finished);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
if (Type != item.Type)
|
||||
{
|
||||
if (Type != ConversationType.UE && item.conversation.Status == ConversationStatus.Recorded)
|
||||
{
|
||||
item.conversation.Status = ConversationStatus.InProgress;
|
||||
await _ConversationRepository.UPDATE(item.conversation);
|
||||
}
|
||||
|
||||
if (!item.IsRead)
|
||||
{
|
||||
item.IsRead = true;
|
||||
item.ReadDateTime = DateTime.Now;
|
||||
item.ExperID = ExperID;
|
||||
return (await _ConversationResponseRepository.UPDATE(item)) != null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public async Task<int> GetCountQueueCompany(int CompanyID, int GroupID = 0)
|
||||
{
|
||||
var request = _ConversationRepository.Get()
|
||||
.Where(w => w.CompanyID == CompanyID && w.Status!=ConversationStatus.Finished);
|
||||
if (GroupID != 0)
|
||||
request = request.Where(w => w.GroupID == GroupID);
|
||||
return await request.CountAsync();
|
||||
}
|
||||
public async Task WriteInHub(ConversationResponse item)
|
||||
{
|
||||
// فرض: لیستی از کاربرانی که به گفتگو دسترسی دارند
|
||||
var usernames = new List<string>();
|
||||
|
||||
foreach (var usn in usernames)
|
||||
{
|
||||
//await _hubContext.Clients.User(usn)
|
||||
// .SendAsync("ReceiveNewConversation", conv.Id, conv.Title);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ using Hushian.Domain.Entites;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -67,7 +68,7 @@ namespace Hushian.Application.Services
|
||||
}
|
||||
public async Task<Read_ExperDto?> GetInfoExper(int ExperID)
|
||||
=> _mapper.Map<Read_ExperDto>(await _ExperRepository.Get().FirstOrDefaultAsync(w => w.ID == ExperID));
|
||||
public async Task<List<Read_ExperDto>?> GetExpersInCompany(int companyID)
|
||||
public async Task<List<Read_ExperDto>> GetExpersInCompany(int companyID)
|
||||
=> _mapper.Map<List<Read_ExperDto>>(await _ExperRepository.Get().Where(w => w.CompanyID == companyID).ToListAsync());
|
||||
public async Task<Read_ExperDto?> GetExpersInGroup(int GroupID)
|
||||
=> _mapper.Map<Read_ExperDto>(await _ExperRepository.Get().Where(w => w.EG.Any(a => a.GroupID == GroupID)).ToListAsync());
|
||||
@@ -77,8 +78,21 @@ namespace Hushian.Application.Services
|
||||
exper.FullName = model.FullName;
|
||||
return await _ExperRepository.UPDATEBool(exper);
|
||||
}
|
||||
public async Task<bool> ChangeAvailableExper(int ExperID,int CompanyID,bool Available)
|
||||
{
|
||||
var exper = await _ExperRepository.Get().FirstOrDefaultAsync(w => w.ID == ExperID && w.CompanyID==CompanyID);
|
||||
if (exper == null) return false;
|
||||
exper.Available = Available;
|
||||
return await _ExperRepository.UPDATEBool(exper);
|
||||
}
|
||||
public async Task<bool> CheckExperInCompany(int CompanyID, int ExperID)
|
||||
=>await _ExperRepository.Get().AnyAsync(w => w.ID == ExperID && w.CompanyID==CompanyID);
|
||||
public async Task<bool> DeleteExper(int ExperID, int CompanyID)
|
||||
{
|
||||
var exper = await _ExperRepository.Get().FirstOrDefaultAsync(w => w.ID == ExperID && w.CompanyID == CompanyID);
|
||||
if (exper == null) return false;
|
||||
return await _ExperRepository.DELETE(exper);
|
||||
}
|
||||
public async Task<ResponseBase<bool>> ChangePasswordExperFromExper(ChangePasswordDto model, int ExperID)
|
||||
{
|
||||
ResponseBase<bool> Response = new();
|
||||
@@ -135,5 +149,11 @@ namespace Hushian.Application.Services
|
||||
}
|
||||
return Response;
|
||||
}
|
||||
public async Task<int> GetCompanyIDExper(int ExperID)
|
||||
{
|
||||
var exper = await _ExperRepository.Get().FirstOrDefaultAsync(w => w.ID == ExperID);
|
||||
if (exper == null) return 0;
|
||||
return exper.CompanyID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,12 @@ namespace Hushian.Application.Services
|
||||
var entity = await _GroupRepository.Get().Where(f => f.CompanyID == CompanyID).ToListAsync();
|
||||
return _mapper.Map<List<Read_GroupDto>>(entity);
|
||||
}
|
||||
public async Task UpdateGroup(Update_GroupDto model, int CompanyID)
|
||||
public async Task<List<Read_GroupDto>> GetGroupsExper(int ExperID)
|
||||
{
|
||||
var entity = await _GroupRepository.Get().Where(f => f.EG.Any(a=>a.ExperID==ExperID)).ToListAsync();
|
||||
return _mapper.Map<List<Read_GroupDto>>(entity);
|
||||
}
|
||||
public async Task<ResponseBase<bool>> UpdateGroup(Update_GroupDto model, int CompanyID)
|
||||
{
|
||||
ResponseBase<bool> Response = new();
|
||||
if (!model.Name.IsOnlyPersianLetters())
|
||||
@@ -91,6 +96,8 @@ namespace Hushian.Application.Services
|
||||
Response.Errors.Add("خطای سیستمی");
|
||||
}
|
||||
}
|
||||
|
||||
return Response;
|
||||
}
|
||||
public async Task<bool> ChangeAvailableGroup(ChangeAvailable_GroupDto model, int CompanyID)
|
||||
{
|
||||
@@ -106,26 +113,70 @@ namespace Hushian.Application.Services
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public async Task<bool> JoinExperInGroup(int GroupID, int ExperID, int CompanyID)
|
||||
public async Task<ResponseBase<bool>> DeleteGroup(int GroupID,int CompanyID)
|
||||
{
|
||||
ResponseBase<bool> Response = new();
|
||||
|
||||
var Group = await _GroupRepository.Get().FirstOrDefaultAsync(a => a.CompanyID == CompanyID && a.ID == GroupID);
|
||||
if (Group!=null) Response.Value=Response.Success= await _GroupRepository.DELETE(Group);
|
||||
else Response.Errors.Add("یافت نشد");
|
||||
|
||||
return Response;
|
||||
}
|
||||
public async Task<ResponseBase<bool>> JoinExperInGroup(int GroupID, int ExperID, int CompanyID)
|
||||
{
|
||||
ResponseBase<bool> Response = new();
|
||||
|
||||
if (await CHeckGroupMemberCompany(GroupID,CompanyID))
|
||||
{
|
||||
if (await _experService.CheckExperInCompany(CompanyID,ExperID))
|
||||
{
|
||||
return await _EGRepository.ADDBool(new ExperGroup()
|
||||
Response.Value=Response.Success= await _EGRepository.ADDBool(new ExperGroup()
|
||||
{
|
||||
ExperID = ExperID,
|
||||
GroupID = GroupID
|
||||
});
|
||||
}
|
||||
else Response.Errors.Add("کارشناس یافت نشد");
|
||||
|
||||
}
|
||||
return false;
|
||||
else Response.Errors.Add("گروه یافت نشد");
|
||||
|
||||
return Response;
|
||||
}
|
||||
public async Task<ResponseBase<bool>> UnJoinExperInGroup(int GroupID, int ExperID, int CompanyID)
|
||||
{
|
||||
ResponseBase<bool> Response = new();
|
||||
|
||||
if (await CHeckGroupMemberCompany(GroupID, CompanyID))
|
||||
{
|
||||
if (await _experService.CheckExperInCompany(CompanyID, ExperID))
|
||||
{
|
||||
try
|
||||
{
|
||||
var eg =await _EGRepository.Get().FirstOrDefaultAsync(w=>w.GroupID==GroupID && w.ExperID==ExperID);
|
||||
Response.Value = Response.Success = eg==null ? true : await _EGRepository.DELETE(eg);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
else Response.Errors.Add("کارشناس یافت نشد");
|
||||
|
||||
}
|
||||
else Response.Errors.Add("گروه یافت نشد");
|
||||
|
||||
return Response;
|
||||
}
|
||||
public async Task<bool> AnyGroup(int GroupID) =>
|
||||
await _GroupRepository.Get().AnyAsync(a=>a.ID==GroupID);
|
||||
public async Task<bool> CHeckGroupMemberCompany(int GroupID, int CompanyID)=>
|
||||
await _GroupRepository.Get().AnyAsync(a => a.CompanyID == CompanyID && a.ID == GroupID);
|
||||
|
||||
public async Task<List<Read_ExperDto>> GetExpersFromGroupID(int GroupID)
|
||||
=> _mapper.Map<List<Read_ExperDto>>( await _EGRepository.Get().Where(w => w.GroupID == GroupID).Select(s=>s.Exper).ToListAsync());
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -96,7 +96,8 @@ namespace Hushian.Application.Services
|
||||
Fullname = User.FullName,
|
||||
Id = User.ID,
|
||||
MobileOrUserName = User.Mobile,
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await _authService.GenerateToken(User.Mobile, User.ID))
|
||||
Role="User",
|
||||
Token = new JwtSecurityTokenHandler().WriteToken(await _authService.GenerateToken(User.Mobile, User.ID, "User"))
|
||||
};
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user