This commit is contained in:
mmrbnjd
2025-07-28 17:41:14 +03:30
parent 43b6e4e746
commit ea152671d6
13 changed files with 691 additions and 12 deletions

View File

@@ -82,6 +82,27 @@ namespace Hushian.WebApi.Controllers.v1
var response = await _experService.GetInfoExper(ExperID);
return response != null ? Ok(response) : BadRequest(new List<string> { "یافت نشد" });
}
[HttpGet("GetCurrentUserInfo")]
[Authorize(Roles = "Exper,Company")]
public async Task<ActionResult> GetCurrentUserInfo()
{
int CompanyID = 0;
int? ExperID = null;
if (User.IsInRole("Exper"))
{
string strExperID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
ExperID = Convert.ToInt32(strExperID);
}
else if (User.IsInRole("Company"))
{
string strCompanyID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
CompanyID = Convert.ToInt32(strCompanyID);
}
var response = await _experService.GetCurrentUserInfo(CompanyID,ExperID);
return response != null ? Ok(response) : BadRequest(new List<string> { "یافت نشد" });
}
[HttpPut("ExperEditingFromManager/{ExperID}")] //ویرایش کارشناس توسط مدیرش
[Authorize(Roles = "Company")]
public async Task<ActionResult> ExperEditingFromManager(int ExperID, [FromBody] Update_ExperDto editUser)