You need to sign in or sign up before continuing.
Commit 01585b9a authored by Ali's avatar Ali

Initial commit

parents

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JobPortalAPI", "JobPortalAPI\JobPortalAPI.csproj", "{59AB2A1F-3E6B-44E1-9267-2B59B23BD412}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{59AB2A1F-3E6B-44E1-9267-2B59B23BD412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59AB2A1F-3E6B-44E1-9267-2B59B23BD412}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59AB2A1F-3E6B-44E1-9267-2B59B23BD412}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59AB2A1F-3E6B-44E1-9267-2B59B23BD412}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {63FF4631-7611-4D17-B20C-95084CAF3E2E}
EndGlobalSection
EndGlobal
namespace JobPortalAPI.Configurations
{
public class JwtConfig
{
public String Secret { get; set; }
}
}
using JobPortalAPI.UnitOfWork;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace JobPortalAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class BaseController : ControllerBase
{
protected IUnitOfWork _unitOfWork;
public BaseController(IUnitOfWork unitOfWork)
{
_unitOfWork = unitOfWork;
}
}
}
using AutoMapper;
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
using JobPortalAPI.Notifications;
using JobPortalAPI.UnitOfWork;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore;
namespace JobPortalAPI.Controllers
{
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
[Route("api/[controller]")]
[ApiController]
public class NotificationsController : BaseController
{
private readonly IMapper _mapper;
protected readonly JobPortalDBContext Context;
private readonly UserManager<IdentityUser> _userManager;
private readonly IHubContext<NotificationHub> _hubContext;
private readonly IConfiguration _configuration;
private DbSet<Notification> _dbSet;
public NotificationsController(IUnitOfWork unitOfWork, IMapper mapper, JobPortalDBContext context, UserManager<IdentityUser> userManager, IConfiguration configuration, IHubContext<NotificationHub> hubContext)
: base(unitOfWork)
{
_mapper = mapper;
Context = context;
_dbSet = Context.Set<Notification>();
_userManager = userManager;
_configuration = configuration;
_hubContext = hubContext;
}
[HttpGet("GetCompanyNotificationById/{id}")]
public IActionResult GetCompanyNotificationById(int id)
{
var notifications = _unitOfWork.NotificationRepo.GetAll().Where(n => n.CompanyId == id && n.ToCompany == true);
if (notifications != null)
{
List<NotificationDto> x = new List<NotificationDto>();
NotificationDto y = new NotificationDto();
foreach (var not in notifications)
{
not.IsRead = true;
_unitOfWork.NotificationRepo.Update(not);
_unitOfWork.SaveChanges();
y = _mapper.Map<NotificationDto>(not);
var person = _unitOfWork.PersonRepo.Get(not.JobSeekerId);
y.Name = person.Name;
var filePath = Path.Combine("Images", person.Image);
y.Image = filePath;
x.Add(y);
}
List<NotificationDto> z = new List<NotificationDto>();
for(int i = x.Count - 1 ; i >= 0; i--)
{
z.Add(x[i]);
}
return Ok(z); }
else
{
return NotFound("you don't have any notifications");
}
}
[HttpGet("GetJobseekerNotificationById/{id}")]
public IActionResult GetJobseekerNotificationById(int id)
{
var notifications = _unitOfWork.NotificationRepo.GetAll().Where(n => n.JobSeekerId == id && n.ToCompany== false);
if (notifications != null)
{
List<NotificationDto> x = new List<NotificationDto>();
NotificationDto y = new NotificationDto();
foreach (var not in notifications)
{
not.IsRead = true;
_unitOfWork.NotificationRepo.Update(not);
_unitOfWork.SaveChanges();
y = _mapper.Map<NotificationDto>(not);
var person = _unitOfWork.PersonRepo.Get(not.CompanyId);
y.Name = person.Name;
//string currentDirectory = Directory.GetCurrentDirectory();
var filePath = Path.Combine("Images", person.Image);
//var fullPath = Path.Combine(currentDirectory, filePath);
//byte[] myimage = System.IO.File.ReadAllBytes(fullPath);
y.Image = filePath;
x.Add(y);
}
List<NotificationDto> z = new List<NotificationDto>();
for(int i = x.Count - 1 ; i >= 0; i--)
{
z.Add(x[i]);
}
return Ok(z);
}
else
{
return NotFound("you don't have any notifications");
}
}
[HttpGet("GetNumberOfCompanyNotifications/{id}")]
public IActionResult GetNumberOfCompanyNotifications(int id)
{
var entries = _unitOfWork.NotificationRepo.GetAll().Where(e => e.CompanyId == id && e.IsRead == false && e.ToCompany==true);
int x = entries.Count();
return Ok(x);
}
[HttpGet("GetNumberOfJobseekerNotifications/{id}")]
public IActionResult GetNumberOfJobseekerNotifications(int id)
{
var entries = _unitOfWork.NotificationRepo.GetAll().Where(e => e.JobSeekerId == id && e.IsRead == false && e.ToCompany == false);
int x = entries.Count();
return Ok(x);
}
}
}
using AutoMapper;
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
using JobPortalAPI.UnitOfWork;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Build.Tasks.Deployment.Bootstrapper;
using Microsoft.EntityFrameworkCore;
using System.Xml;
using static System.Net.Mime.MediaTypeNames;
namespace JobPortalAPI.Controllers
{
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
[Route("api/[controller]")]
[ApiController]
public class PersonsController : BaseController
{
private readonly IMapper _mapper;
public PersonsController(IUnitOfWork unitOfWork, IMapper mapper)
: base(unitOfWork)
{
_mapper = mapper;
}
[HttpGet]
public IActionResult GetAll()
{
var persons = _unitOfWork.PersonRepo.GetAll().ToList();
//var persons = _unitOfWork.PersonRepo.GetAllWithJobSeekers().ToList();
return Ok(persons);
}
[HttpGet("{id}")]
public IActionResult Get(int id)
{
var person = _unitOfWork.PersonRepo.Get(id);
if (person == null)
{
return NotFound();
}
return Ok(person);
}
[HttpPost]
public IActionResult Create([FromForm] PersonDto dto)
{
if (ModelState.IsValid)
{
var person = _mapper.Map<Person>(dto);
if (dto.Image != null && dto.Image.Length > 0)
{
var fileName = Guid.NewGuid().ToString() + Path.GetExtension(dto.Image.FileName);
var filePath = fileName;
var fullPath = Path.Combine(@"A:\\Mobile_Application\\JobPortalAPI\\JobPortalAPI\\Images", filePath);
using (var stream = new FileStream(fullPath, FileMode.Create))
{
dto.Image.CopyTo(stream);
}
person.Image = filePath;
}
else
{
return BadRequest("Image is required");
}
_unitOfWork.PersonRepo.Add(person);
_unitOfWork.SaveChanges();
return Ok(person);
}
else
{
return BadRequest("Invalid Request");
}
}
[HttpPut("{id}")]
public IActionResult Update(int id, [FromForm] PersonDto dto)
{
var person = _unitOfWork.PersonRepo.Get(id);
if (person == null)
{
return NotFound();
}
else
{
var currentImage = Path.Combine(@"A:\\Mobile_Application\\JobPortalAPI\\JobPortalAPI\\Images", person.Image);
_mapper.Map<PersonDto, Person>(dto, person);
if (dto.Image != null && dto.Image.Length > 0)
{
var fileName = Guid.NewGuid().ToString() + Path.GetExtension(dto.Image.FileName);
var filePath = fileName;
var fullPath = Path.Combine(@"A:\\Mobile_Application\\JobPortalAPI\\JobPortalAPI\\Images", filePath);
using (var stream = new FileStream(fullPath, FileMode.Create))
{
dto.Image.CopyTo(stream);
}
if (!string.IsNullOrEmpty(currentImage) && System.IO.File.Exists(currentImage))
{
System.IO.File.Delete(currentImage);
}
person.Image = filePath;
}
else if (!string.IsNullOrEmpty(currentImage))
{
person.Image = currentImage;
}
else
{
return BadRequest("Image is required");
}
_unitOfWork.PersonRepo.Update(person);
_unitOfWork.SaveChanges();
return Ok(person);
}
}
[HttpDelete("{id}")]
public IActionResult Delete(int id)
{
var person = _unitOfWork.PersonRepo.Get(id);
if (person == null)
{
return NotFound();
}
_unitOfWork.PersonRepo.Remove(person);
_unitOfWork.SaveChanges();
return Ok();
}
}
}
using AutoMapper;
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
using JobPortalAPI.UnitOfWork;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace JobPortalAPI.Controllers
{
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
[Route("api/[controller]")]
[ApiController]
public class SkillsController : BaseController
{
private readonly IMapper _mapper;
public SkillsController(IUnitOfWork unitOfWork, IMapper mapper)
: base(unitOfWork)
{
_mapper = mapper;
}
[HttpGet]
public IActionResult GetAll()
{
var skills = _unitOfWork.SkillRepo.GetAll().ToList();
return Ok(skills);
}
[HttpGet("{id}")]
public IActionResult Get(int id)
{
var skill = _unitOfWork.SkillRepo.Get(id);
if (skill == null)
{
return NotFound();
}
return Ok(skill);
}
[HttpPost]
public IActionResult Create(String skillname)
{
if (ModelState.IsValid)
{
Skill skill = new Skill();
skill.Name = skillname.ToUpper();
_unitOfWork.SkillRepo.Add(skill);
_unitOfWork.SaveChanges();
return Ok(skill);
}
else
{
return BadRequest("Invalid Request");
}
}
[HttpPut("{id}")]
public IActionResult Update(int id, String skillname)
{
var skill = _unitOfWork.SkillRepo.Get(id);
if (skill == null)
{
return NotFound();
}
else
{
skill.Name = skillname.ToUpper();
_unitOfWork.SkillRepo.Update(skill);
_unitOfWork.SaveChanges();
return Ok(skill);
}
}
[HttpDelete("{id}")]
public IActionResult Delete(int id)
{
var skill = _unitOfWork.SkillRepo.Get(id);
if (skill == null)
{
return NotFound();
}
_unitOfWork.SkillRepo.Remove(skill);
_unitOfWork.SaveChanges();
return Ok();
}
//[HttpGet("test")]
//public IActionResult test()
//{
// return Ok("success");
//}
}
}
using AutoMapper;
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
using JobPortalAPI.UnitOfWork;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace JobPortalAPI.Controllers
{
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
[Route("api/[controller]")]
[ApiController]
public class SpecificationsController : BaseController
{
private readonly IMapper _mapper;
public SpecificationsController(IUnitOfWork unitOfWork, IMapper mapper)
: base(unitOfWork)
{
_mapper = mapper;
}
[AllowAnonymous]
[HttpGet]
public IActionResult GetAll()
{
var specifications = _unitOfWork.SpecificationRepo.GetAll().ToList();
return Ok(specifications);
}
[HttpGet("{id}")]
public IActionResult Get(int id)
{
var specification = _unitOfWork.SpecificationRepo.Get(id);
if (specification == null)
{
return NotFound();
}
return Ok(specification);
}
[AllowAnonymous]
[HttpPost]
public IActionResult Create(String specificationName)
{
if (ModelState.IsValid)
{
var x = _unitOfWork.SpecificationRepo.GetAll().FirstOrDefault(s => s.Name.ToUpper().Contains(specificationName.ToUpper()));
if(x == null)
{
Specification specification = new Specification();
specification.Name = specificationName.ToUpper();
_unitOfWork.SpecificationRepo.Add(specification);
_unitOfWork.SaveChanges();
return Ok(specification);
}
return BadRequest("this specification is already exist");
}
else
{
return BadRequest(new AuthResult() { Errors = new List<string>() { "Enter valid values" } });
}
}
[HttpPut("{id}")]
public IActionResult Update(int id, String specificationName)
{
var specification = _unitOfWork.SpecificationRepo.Get(id);
if (specification == null)
{
return NotFound();
}
else
{
specification.Name = specificationName.ToUpper();
_unitOfWork.SpecificationRepo.Update(specification);
_unitOfWork.SaveChanges();
return Ok(specification);
}
}
[HttpDelete("{id}")]
public IActionResult Delete(int id)
{
var specification = _unitOfWork.SpecificationRepo.Get(id);
if (specification == null)
{
return NotFound();
}
_unitOfWork.SpecificationRepo.Remove(specification);
_unitOfWork.SaveChanges();
return Ok();
}
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class BookInterviewDto
{
[Required]
public int JobSeekerId { get; set; }
[Required]
public int CompanyId { get; set; }
[Required]
public int JobId { get; set; }
[Required]
[DataType(DataType.DateTime)]
public DateTime Date { get; set; }
[Required]
public string Address { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class ChangePasswordDto
{
[Required]
[DataType(DataType.EmailAddress)]
public string email { get; set; } = null!;
[Required]
[DataType(DataType.Password)]
public string oldPassword { get; set; } = null!;
[Required]
[DataType(DataType.Password)]
public string newPassword { get; set; } = null!;
[Required]
[DataType(DataType.Password)]
[Compare("newPassword", ErrorMessage = "Password and confirmation password do not match")]
public string confirmedPassword { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class CompanyDto
{
public int Id { get; set; }
[Required]
public string Name { get; set; } = null!;
[Required]
public string Phone { get; set; } = null!;
[Required]
public string Email { get; set; } = null!;
[Required]
public String Image { get; set; } = null!;
[Required]
public string Address { get; set; } = null!;
[Required]
public string Description { get; set; } = null!;
}
}
namespace JobPortalAPI.DTOs
{
public class CvDto
{
public CvDto()
{
skills = new List<SkillDto>();
}
public int Id { get; set; }
public string Gender { get; set; } = null!;
public DateTime Birthdate { get; set; }
public string SpecificationName { get; set; } = null!;
public string Certificate { get; set; } = null!;
public string Stages { get; set; } = null!;
public string PreviousWorks { get; set; } = null!;
public string Languages { get; set; } = null!;
public string Name { get; set; } = null!;
public string Password { get; set; } = null!;
public string Token { get; set; } = null!;
public string Phone { get; set; } = null!;
public string Image { get; set; } = null!;
public string Email { get; set; } = null!;
public string Address { get; set; } = null!;
public List<SkillDto> skills { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class CvSkillDto
{
[Required]
public string Name { get; set; } = null!;
[Required]
public string PracticePeriod { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class InterviewDto
{
[Required]
public int Id { get; set; }
[Required]
public int JobSeekerId { get; set; }
[Required]
public int CompanyId { get; set; }
[Required]
public int JobId { get; set; }
public DateTime Date { get; set; }
public string? JobName { get; set; }
public string Address { get; set; } = null!;
public string Name { get; set; } = null!;
public string Image { get; set; } = null!;
}
}
namespace JobPortalAPI.DTOs
{
public class JobDetailsDto
{
public JobDetailsDto()
{
skills = new List<SkillDto>();
}
public int Id { get; set; }
public string CompanyName { get; set; } = null!;
public string TimeType { get; set; } = null!;
public string Name { get; set; } = null!;
public string Description { get; set; } = null!;
public int Sallary { get; set; }
public int CompanyId { get; set; }
public String SpecificationName { get; set; }
public string Status { get; set; } = null!;
public string Phone { get; set; } = null!;
public string Email { get; set; } = null!;
public String Image { get; set; } = null!;
public List<SkillDto> skills { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class JobDto
{
[Required]
public string TimeType { get; set; } = null!;
[Required]
public string Name { get; set; } = null!;
[Required]
public string Description { get; set; } = null!;
[Required]
public int Sallary { get; set; }
[Required]
public int CompanyId { get; set; }
[Required]
public String SpecificationName { get; set; }
[Required]
public string Status { get; set; } = null!;
}
}
namespace JobPortalAPI.DTOs
{
public class JobEntryDto
{
public int JobSeekerId { get; set; }
public int JobId { get; set; }
public DateTime Date { get; set; }
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class JobRequestDto
{
[Required]
public int JobSeekerId { get; set; }
[Required]
public int JobId { get; set; }
}
}
using JobPortalAPI.Models;
namespace JobPortalAPI.DTOs
{
public class JobSeekerDto
{
public int Id { get; set; }
public string Gender { get; set; } = null!;
public DateTime Birthdate { get; set; }
public string SpecificationName { get; set; } = null!;
public string Name { get; set; } = null!;
public string Phone { get; set; } = null!;
public string Email { get; set; } = null!;
public string Image { get; set; } = null!;
public string Address { get; set; } = null!;
}
}
namespace JobPortalAPI.DTOs
{
public class JobSkillDto
{
public string Name { get; set; } = null!;
public string PracticePeriod { get; set; } = null!;
}
}
using Microsoft.Build.Framework;
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class LogInDto
{
[System.ComponentModel.DataAnnotations.Required]
[DataType(DataType.EmailAddress)]
[RegularExpression(@"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$",
ErrorMessage = "Invalid email format")]
public String email { get; set; }
[System.ComponentModel.DataAnnotations.Required]
[DataType(DataType.Password)]
public String password { get; set; }
}
}
namespace JobPortalAPI.DTOs
{
public class NotificationDto
{
public int id { get; set; }
public int CompanyId { get; set; }
public int JobSeekerId { get; set; }
public int JobId { get; set; }
public String Name { get; set; } = null!;
public String Image { get; set; } = null!;
public bool ToCompany { get; set; }
public string Details { get; set; } = null!;
public DateTime Date { get; set; }
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class PersonCompanyDto
{
[Required]
public string Name { get; set; } = null!;
[Required]
public string Phone { get; set; } = null!;
[Required]
[DataType(DataType.Password)]
public string Password { get; set; } = null!;
[Required]
[DataType(DataType.EmailAddress)]
public string Email { get; set; } = null!;
[Required]
public IFormFile? Image { get; set; } = null!;
[Required]
public string Address { get; set; } = null!;
[Required]
public string Description { get; set; } = null!;
}
}
namespace JobPortalAPI.DTOs
{
public class PersonDto
{
public string Name { get; set; } = null!;
public string Phone { get; set; } = null!;
public string Email { get; set; } = null!;
public IFormFile? Image { get; set; } = null!;
public string Address { get; set; } = null!;
}
}
using JobPortalAPI.Models;
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class PersonJobSeekerDto
{
[Required]
public string Name { get; set; } = null!;
[Required]
[DataType(DataType.Password)]
public string Password { get; set; } = null!;
[Required]
public string Phone { get; set; } = null!;
[Required]
[DataType(DataType.EmailAddress)]
public string Email { get; set; } = null!;
[Required]
public IFormFile? Image { get; set; } = null!;
[Required]
public string Address { get; set; } = null!;
[Required]
public string Gender { get; set; } = null!;
[Required]
public DateTime Birthdate { get; set; }
[Required]
public String SpecificationName { get; set; } = null!;
[Required]
public string Certificate { get; set; } = null!;
[Required]
public string Stages { get; set; } = null!;
[Required]
public string PreviousWorks { get; set; } = null!;
[Required]
public string Languages { get; set; } = null!;
}
}
\ No newline at end of file
using System.ComponentModel.DataAnnotations;
using System.Xml.Linq;
namespace JobPortalAPI.DTOs
{
public class RegisterUserDto
{
//[Required]
//[EmailAddress]
public string Email { get; set; }
//[Required]
//[DataType(DataType.Password)]
public string Password { get; set; }
public String Name { get; set; }
//[DataType(DataType.Password)]
//[Display(Name = "Confirm password")]
//[Compare("Password",
// ErrorMessage = "Password and confirmation password do not match.")]
//public string ConfirmPassword { get; set; }
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class SkillDto
{
[Required]
public int SkillId { get; set; }
[Required]
public string Name { get; set; } = null!;
[Required]
public string PracticePeriod { get; set; } = null!;
}
}
namespace JobPortalAPI.DTOs
{
public class SpecificationDto
{
public string Name { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class UpdateCompanyDto
{
[Required]
public string Name { get; set; } = null!;
[Required]
public string Phone { get; set; } = null!;
[Required]
[DataType(DataType.EmailAddress)]
public string Email { get; set; } = null!;
public IFormFile? Image { get; set; }
[Required]
public string Address { get; set; } = null!;
[Required]
public string Description { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class UpdateInterviewDto
{
[Required]
public int Id { get; set; }
[Required]
public DateTime Date { get; set; }
[Required]
public string Address { get; set; } = null!;
}
}
using System.ComponentModel.DataAnnotations;
namespace JobPortalAPI.DTOs
{
public class UpdateJobseekerDto
{
[Required]
public string Name { get; set; } = null!;
[Required]
public string Phone { get; set; } = null!;
[Required]
[DataType(DataType.EmailAddress)]
public string Email { get; set; } = null!;
public IFormFile? Image { get; set; } = null!;
[Required]
public string Address { get; set; } = null!;
[Required]
public string Gender { get; set; } = null!;
[Required]
public DateTime Birthdate { get; set; }
[Required]
public String SpecificationName { get; set; } = null!;
[Required]
public string Certificate { get; set; } = null!;
[Required]
public string Stages { get; set; } = null!;
[Required]
public string PreviousWorks { get; set; } = null!;
[Required]
public string Languages { get; set; } = null!;
}
}
using AutoMapper;
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.Helpers
{
public class MappingProfile : Profile
{
public MappingProfile()
{
// from , to
CreateMap<Person, PersonDto>();
CreateMap<JobSeeker, JobSeekerDto>()
.ForMember(dest => dest.SpecificationName, opt => opt.MapFrom(src => src.Specification.Name))
.ForMember(dest => dest.Address, opt => opt.MapFrom(src => src.IdNavigation.Address))
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.IdNavigation.Name))
.ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.IdNavigation.Email))
.ForMember(dest => dest.Image, opt => opt.MapFrom(src => src.IdNavigation.Image))
.ForMember(dest => dest.Phone, opt => opt.MapFrom(src => src.IdNavigation.Phone));
CreateMap<PersonJobSeekerDto, Cv>();
CreateMap<Notification, NotificationDto>();
CreateMap<BookInterviewDto, Interview>();
CreateMap<Interview, InterviewDto>();
CreateMap<PersonDto, Person>().ForMember(src => src.Image, opt => opt.Ignore());
CreateMap<PersonJobSeekerDto, Person>()
.ForMember(src => src.Image, opt => opt.Ignore());
CreateMap<PersonCompanyDto, Person>()
.ForMember(src => src.Image, opt => opt.Ignore());
CreateMap<SkillDto, Skill>()
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name.ToUpper()));
CreateMap<PersonJobSeekerDto, JobSeeker>()
.ForMember(dest => dest.Gender, opt => opt.MapFrom(src => src.Gender))
.ForMember(dest => dest.Birthdate, opt => opt.MapFrom(src => src.Birthdate));
CreateMap<PersonCompanyDto, Company>()
.ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description));
CreateMap<JobDto, Job>();
}
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface ICompanyRepository : IRepository<Company>
{
public List<Company> GetCompaniesDetails();
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface ICvRepository : IRepository<Cv>
{
public Cv GetAllCvDetails(int id);
public List<Cv> GetAllCvsDetails();
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface ICvSkillRepository : IRepository<Cvskill>
{
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface IInterviewRepository : IRepository<Interview>
{
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface IJobEntryRepository : IRepository<JobEntry>
{
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface IJobRepository : IRepository<Job>
{
public Job GetAllJobDetails(int id);
public List<Job> GetAllJobsDetails();
public List<Job> GetAllJobsDetailsByCompanyId(int id);
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface IJobSeekerRepository : IRepository<JobSeeker>
{
public List<JobSeeker> GetAllDetails();
public IEnumerable<JobSeeker> GetAllWithSpecification();
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface IJobSkillRepository : IRepository<JobSkill>
{
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface INotificationRepository : IRepository<Notification>
{
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface IPersonRepository : IRepository<Person>
{
}
}
using JobPortalAPI.Models;
using System.Linq.Expressions;
namespace JobPortalAPI.IRepository
{
public interface IRepository<T> where T : class
{
// Finding Objects
T Get(int id);
IEnumerable<T> GetAll();
IEnumerable<T> Find(Expression<Func<T, bool>> predicate);
// Adding Objects
void Add(T entity);
void AddRange(IEnumerable<T> entities);
void Update(T entity);
// Removing Objects
void Remove(T entity);
void RemoveRange(IEnumerable<T> entities);
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface ISkillRepository : IRepository<Skill>
{
}
}
using JobPortalAPI.DTOs;
using JobPortalAPI.Models;
namespace JobPortalAPI.IRepository
{
public interface ISpecificationRepository : IRepository<Specification>
{
}
}
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Core" Version="1.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration" Version="6.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\Images\" />
<Folder Include="wwwroot\Audios\" />
</ItemGroup>
<ItemGroup>
<None Include="wwwroot\Images\5ade8e8a-c8d0-43b5-ac6b-66116f407d16.jpg" />
<None Include="wwwroot\Images\cdabe486-13ee-44ed-9a6f-b45c3d3e5020.jpg" />
<None Include="wwwroot\Images\decfd062-71e9-4fc4-8627-63917e06df1f.jpg" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>650</WebStackScaffolding_ControllerDialogWidth>
</PropertyGroup>
</Project>
\ No newline at end of file
namespace JobPortalAPI.Models
{
public class AuthResult
{
public int Id { get; set; }
public String Token { get; set; }
public bool result { get; set; }
public bool isCompany { get; set; }
public List<String> Errors { get; set; }
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
job_portal_app @ 968babca
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment