└── hrms ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ ├── maven-wrapper.properties │ └── MavenWrapperDownloader.java ├── src ├── main │ ├── java │ │ └── com │ │ │ └── jobForEveryone │ │ │ └── hrms │ │ │ ├── verification │ │ │ ├── abstracts │ │ │ │ ├── EmailCheckService.java │ │ │ │ ├── HrmsCheckService.java │ │ │ │ └── MernisCheckService.java │ │ │ └── concrete │ │ │ │ ├── EmailCheckManager.java │ │ │ │ ├── HrmsCheckManager.java │ │ │ │ └── MernisCheckManager.java │ │ │ ├── dataAccess │ │ │ └── abstracts │ │ │ │ ├── CityDao.java │ │ │ │ ├── ResumeDao.java │ │ │ │ ├── UserDao.java │ │ │ │ ├── EducationInfoDao.java │ │ │ │ ├── JobExperienceDao.java │ │ │ │ ├── ForeignLanguageDao.java │ │ │ │ ├── JobTitleDao.java │ │ │ │ ├── EmployerDao.java │ │ │ │ ├── CandidateDao.java │ │ │ │ └── JobAdvertisementDao.java │ │ │ ├── core │ │ │ └── utilities │ │ │ │ └── results │ │ │ │ ├── ErrorResult.java │ │ │ │ ├── SuccessResult.java │ │ │ │ ├── ErrorDataResult.java │ │ │ │ ├── DataResult.java │ │ │ │ ├── SuccessDataResult.java │ │ │ │ └── Result.java │ │ │ ├── business │ │ │ ├── abstracts │ │ │ │ ├── CityService.java │ │ │ │ ├── ResumeService.java │ │ │ │ ├── JobTitleService.java │ │ │ │ ├── EmployerService.java │ │ │ │ ├── CandidateService.java │ │ │ │ ├── ForeignLanguageService.java │ │ │ │ ├── EducationInfoService.java │ │ │ │ ├── JobExperienceService.java │ │ │ │ ├── JobAdvertisementService.java │ │ │ │ └── ResumeManager.java │ │ │ └── concretes │ │ │ │ ├── CityManager.java │ │ │ │ ├── ForeignLanguageManager.java │ │ │ │ ├── JobTitleManager.java │ │ │ │ ├── EducationInfoManager.java │ │ │ │ ├── JobExperienceManager.java │ │ │ │ ├── JobAdvertisementManager.java │ │ │ │ ├── EmployerManager.java │ │ │ │ └── CandidateManager.java │ │ │ ├── HrmsApplication.java │ │ │ ├── entities │ │ │ ├── concretes │ │ │ │ ├── User.java │ │ │ │ ├── City.java │ │ │ │ ├── JobTitle.java │ │ │ │ ├── ForeignLanguage.java │ │ │ │ ├── Employer.java │ │ │ │ ├── Candidate.java │ │ │ │ ├── JobExperience.java │ │ │ │ ├── EducationInfo.java │ │ │ │ ├── JobAdvertisement.java │ │ │ │ └── Resume.java │ │ │ └── dtos │ │ │ │ └── JobAdvertisementDetailsDto.java │ │ │ └── api │ │ │ └── controllers │ │ │ ├── CitiesController.java │ │ │ ├── ResumesController.java │ │ │ ├── EmployersController.java │ │ │ ├── JobTitlesController.java │ │ │ ├── ForeignLanguagesController.java │ │ │ ├── CandidatesController.java │ │ │ ├── JobExperiencesController.java │ │ │ ├── EducationInfosController.java │ │ │ └── JobAdvertisementsController.java │ └── resources │ │ └── application.properties └── test │ └── java │ └── com │ └── jobForEveryone │ └── hrms │ └── HrmsApplicationTests.java ├── .gitignore ├── pom.xml ├── mvnw.cmd └── mvnw /hrms/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Marulov/hrms-Backend/HEAD/hrms/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /hrms/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/verification/abstracts/EmailCheckService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.verification.abstracts; 2 | 3 | import com.jobForEveryone.hrms.entities.concretes.User; 4 | 5 | public interface EmailCheckService { 6 | boolean CheckIfRealEmail(User user); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/verification/abstracts/HrmsCheckService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.verification.abstracts; 2 | 3 | import com.jobForEveryone.hrms.entities.concretes.User; 4 | 5 | public interface HrmsCheckService { 6 | boolean checkIfConfirmHrms(User user); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/verification/abstracts/MernisCheckService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.verification.abstracts; 2 | 3 | import com.jobForEveryone.hrms.entities.concretes.User; 4 | 5 | public interface MernisCheckService { 6 | 7 | boolean checkIfRealPerson(User user); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/test/java/com/jobForEveryone/hrms/HrmsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HrmsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/CityDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.City; 6 | 7 | public interface CityDao extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/ResumeDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.Resume; 6 | 7 | public interface ResumeDao extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.User; 6 | 7 | public interface UserDao extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/core/utilities/results/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.core.utilities.results; 2 | 3 | public class ErrorResult extends Result{ 4 | 5 | public ErrorResult() { 6 | super(false); 7 | } 8 | 9 | public ErrorResult(String message) { 10 | super(false, message); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/core/utilities/results/SuccessResult.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.core.utilities.results; 2 | 3 | public class SuccessResult extends Result { 4 | 5 | public SuccessResult() { 6 | super(true); 7 | } 8 | 9 | public SuccessResult(String message) { 10 | super(true, message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/EducationInfoDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.EducationInfo; 6 | 7 | public interface EducationInfoDao extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/JobExperienceDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.JobExperience; 6 | 7 | public interface JobExperienceDao extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/ForeignLanguageDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.ForeignLanguage; 6 | 7 | public interface ForeignLanguageDao extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/hrms 5 | spring.datasource.username=postgres 6 | spring.datasource.password=415263 7 | spring.jpa.properties.javax.persistence.validation.mode = none -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/JobTitleDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import com.jobForEveryone.hrms.entities.concretes.JobTitle; 5 | 6 | public interface JobTitleDao extends JpaRepository { 7 | 8 | JobTitle getByTitle(String title); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/EmployerDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.Employer; 6 | 7 | public interface EmployerDao extends JpaRepository{ 8 | 9 | Employer getByEmail(String email); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/CityService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.City; 8 | 9 | public interface CityService { 10 | DataResult> getAll(); 11 | Result add(City city); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/CandidateDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.Candidate; 6 | 7 | public interface CandidateDao extends JpaRepository { 8 | Candidate getByEmail(String email); 9 | Candidate getByIdentityNumber(String identityNumber); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/ResumeService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.Resume; 8 | 9 | public interface ResumeService { 10 | 11 | DataResult> getAll(); 12 | Result add(Resume resume); 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/JobTitleService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.JobTitle; 8 | 9 | public interface JobTitleService { 10 | DataResult> getAll(); 11 | Result add(JobTitle jobTitle); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/EmployerService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.Employer; 8 | 9 | public interface EmployerService { 10 | 11 | DataResult> getAll(); 12 | Result add(Employer employer); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/CandidateService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.Candidate; 8 | 9 | public interface CandidateService { 10 | 11 | DataResult> getAll(); 12 | Result add(Candidate candidate); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/ForeignLanguageService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.ForeignLanguage; 8 | 9 | public interface ForeignLanguageService { 10 | 11 | DataResult> getAll(); 12 | Result add(ForeignLanguage foreignLanguage); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /hrms/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/verification/concrete/EmailCheckManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.verification.concrete; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.User; 6 | import com.jobForEveryone.hrms.verification.abstracts.EmailCheckService; 7 | 8 | @Service 9 | public class EmailCheckManager implements EmailCheckService{ 10 | 11 | @Override 12 | public boolean CheckIfRealEmail(User user) { 13 | 14 | return true; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/verification/concrete/HrmsCheckManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.verification.concrete; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.User; 6 | import com.jobForEveryone.hrms.verification.abstracts.HrmsCheckService; 7 | 8 | @Service 9 | public class HrmsCheckManager implements HrmsCheckService { 10 | 11 | @Override 12 | public boolean checkIfConfirmHrms(User user) { 13 | 14 | return true; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/verification/concrete/MernisCheckManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.verification.concrete; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import com.jobForEveryone.hrms.entities.concretes.User; 6 | import com.jobForEveryone.hrms.verification.abstracts.MernisCheckService; 7 | 8 | 9 | @Service 10 | public class MernisCheckManager implements MernisCheckService { 11 | 12 | @Override 13 | public boolean checkIfRealPerson(User user) { 14 | 15 | return true; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/core/utilities/results/ErrorDataResult.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.core.utilities.results; 2 | 3 | public class ErrorDataResult extends DataResult { 4 | 5 | public ErrorDataResult(T data) { 6 | super(data, false); 7 | } 8 | 9 | public ErrorDataResult(T data, String message) { 10 | super(data, false, message); 11 | } 12 | 13 | public ErrorDataResult() { 14 | super(null, false); 15 | } 16 | 17 | public ErrorDataResult(String message) { 18 | super(null, false, message); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/core/utilities/results/DataResult.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.core.utilities.results; 2 | 3 | public class DataResult extends Result { 4 | 5 | private T data; 6 | 7 | public DataResult(T data, boolean success) { 8 | super(success); 9 | this.data = data; 10 | 11 | } 12 | 13 | public DataResult(T data, boolean success, String message) { 14 | super(success, message); 15 | this.data = data; 16 | 17 | } 18 | 19 | public T getData() { 20 | return this.data; 21 | } 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/core/utilities/results/SuccessDataResult.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.core.utilities.results; 2 | 3 | public class SuccessDataResult extends DataResult { 4 | 5 | public SuccessDataResult(T data) { 6 | super(data, true); 7 | } 8 | 9 | public SuccessDataResult(T data, String message) { 10 | super(data, true, message); 11 | } 12 | 13 | public SuccessDataResult() { 14 | super(null, true); 15 | } 16 | 17 | public SuccessDataResult(String message) { 18 | super(null, true, message); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/core/utilities/results/Result.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.core.utilities.results; 2 | 3 | public class Result { 4 | private boolean success; 5 | private String message; 6 | 7 | public Result(boolean success) { 8 | this.success = success; 9 | } 10 | 11 | public Result(boolean success, String message) { 12 | this(success); 13 | this.message = message; 14 | } 15 | 16 | public boolean isSuccess() { 17 | return this.success; 18 | } 19 | 20 | public String getMessage() { 21 | return this.message; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/EducationInfoService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.EducationInfo; 8 | 9 | public interface EducationInfoService { 10 | 11 | DataResult> getAll(); 12 | DataResult> getAllSortedByCompletionDate(); 13 | Result add(EducationInfo educationInfo); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/JobExperienceService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.JobExperience; 8 | 9 | public interface JobExperienceService { 10 | 11 | DataResult> getAll(); 12 | DataResult> getAllSortedByCompletionDate(); 13 | Result add(JobExperience jobExperience); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/dataAccess/abstracts/JobAdvertisementDao.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import com.jobForEveryone.hrms.entities.concretes.JobAdvertisement; 9 | 10 | public interface JobAdvertisementDao extends JpaRepository{ 11 | 12 | @Query("From JobAdvertisement where status = true") 13 | List getAllStatusTrue(); 14 | 15 | @Query("From JobAdvertisement where employer.companyName=:companyName and status = true") 16 | List getAllEmployerAndStatusTrue(String companyName); 17 | 18 | 19 | } -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/JobAdvertisementService.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 6 | import com.jobForEveryone.hrms.core.utilities.results.Result; 7 | import com.jobForEveryone.hrms.entities.concretes.JobAdvertisement; 8 | 9 | 10 | public interface JobAdvertisementService { 11 | 12 | Result add(JobAdvertisement jobAdvertisement); 13 | 14 | DataResult> getAll(); 15 | 16 | DataResult> getAllStatusTrue(); 17 | 18 | DataResult> getAllSortedByLastDate(); 19 | 20 | DataResult> getAllEmployerAndStatusTrue(String companyName); 21 | 22 | Result update(int id , boolean status); 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/HrmsApplication.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.Bean; 6 | 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.spi.DocumentationType; 9 | import springfox.documentation.spring.web.plugins.Docket; 10 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 11 | 12 | 13 | @SpringBootApplication 14 | @EnableSwagger2 15 | public class HrmsApplication { 16 | 17 | public static void main(String[] args) { 18 | SpringApplication.run(HrmsApplication.class, args); 19 | } 20 | 21 | // Swagger ı projeye dahil ettik. 22 | @Bean 23 | public Docket api() { 24 | return new Docket(DocumentationType.SWAGGER_2) 25 | .select() 26 | .apis(RequestHandlerSelectors.basePackage("com.jobForEveryone.hrms")) 27 | .build(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/abstracts/ResumeManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 10 | import com.jobForEveryone.hrms.core.utilities.results.Result; 11 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 12 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 13 | import com.jobForEveryone.hrms.dataAccess.abstracts.ResumeDao; 14 | import com.jobForEveryone.hrms.entities.concretes.Resume; 15 | 16 | @Service 17 | public class ResumeManager implements ResumeService{ 18 | 19 | private ResumeDao resumeDao; 20 | 21 | @Autowired 22 | public ResumeManager(ResumeDao resumeDao) { 23 | super(); 24 | this.resumeDao = resumeDao; 25 | } 26 | 27 | @Override 28 | public DataResult> getAll() { 29 | 30 | return new SuccessDataResult>(this.resumeDao.findAll(), "Cv ler listelendi."); 31 | } 32 | 33 | @Override 34 | public Result add(Resume resume) { 35 | 36 | this.resumeDao.save(resume); 37 | return new SuccessResult("Cv eklendi."); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/CityManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.jobForEveryone.hrms.business.abstracts.CityService; 9 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 10 | import com.jobForEveryone.hrms.core.utilities.results.Result; 11 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 12 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 13 | import com.jobForEveryone.hrms.dataAccess.abstracts.CityDao; 14 | import com.jobForEveryone.hrms.entities.concretes.City; 15 | 16 | @Service 17 | public class CityManager implements CityService { 18 | 19 | private CityDao cityDao; 20 | 21 | @Autowired 22 | public CityManager(CityDao cityDao) { 23 | super(); 24 | this.cityDao = cityDao; 25 | } 26 | 27 | @Override 28 | public DataResult> getAll() { 29 | 30 | return new SuccessDataResult>(this.cityDao.findAll(), "Şehirler listelendi"); 31 | } 32 | 33 | @Override 34 | public Result add(City city) { 35 | 36 | this.cityDao.save(city); 37 | return new SuccessResult("Şehir eklendi"); 38 | } 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/User.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | @Entity 11 | @Table(name="users") 12 | public class User { 13 | 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.IDENTITY) 16 | @Column(name="id") 17 | private int id; 18 | 19 | @Column(name="email") 20 | private String email; 21 | 22 | @Column(name="password") 23 | private String password; 24 | 25 | public User() { 26 | 27 | } 28 | 29 | public User(int id, String email, String password) { 30 | super(); 31 | this.id = id; 32 | this.email = email; 33 | this.password = password; 34 | } 35 | 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | public void setId(int id) { 41 | this.id = id; 42 | } 43 | 44 | public String getEmail() { 45 | return email; 46 | } 47 | 48 | public void setEmail(String email) { 49 | this.email = email; 50 | } 51 | 52 | public String getPassword() { 53 | return password; 54 | } 55 | 56 | public void setPassword(String password) { 57 | this.password = password; 58 | } 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/ForeignLanguageManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.jobForEveryone.hrms.business.abstracts.ForeignLanguageService; 9 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 10 | import com.jobForEveryone.hrms.core.utilities.results.Result; 11 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 12 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 13 | import com.jobForEveryone.hrms.dataAccess.abstracts.ForeignLanguageDao; 14 | import com.jobForEveryone.hrms.entities.concretes.ForeignLanguage; 15 | 16 | @Service 17 | public class ForeignLanguageManager implements ForeignLanguageService{ 18 | 19 | private ForeignLanguageDao foreignLanguageDao; 20 | 21 | @Autowired 22 | public ForeignLanguageManager(ForeignLanguageDao foreignLanguageDao) { 23 | super(); 24 | this.foreignLanguageDao = foreignLanguageDao; 25 | } 26 | 27 | @Override 28 | public DataResult> getAll() { 29 | 30 | return new SuccessDataResult>(this.foreignLanguageDao.findAll(), "Yabancı diller listelendi."); 31 | } 32 | 33 | @Override 34 | public Result add(ForeignLanguage foreignLanguage) { 35 | 36 | this.foreignLanguageDao.save(foreignLanguage); 37 | return new SuccessResult("Yabancı dil eklendi"); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/City.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.OneToMany; 11 | import javax.persistence.Table; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | 15 | 16 | @Entity 17 | @Table(name="cities") 18 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobAdvertisements"}) 19 | public class City { 20 | 21 | @Id 22 | @Column(name="id") 23 | @GeneratedValue(strategy = GenerationType.IDENTITY) 24 | private int id; 25 | 26 | @Column(name="city_name") 27 | private String cityName; 28 | 29 | @OneToMany(mappedBy = "city") 30 | private List jobAdvertisements; 31 | 32 | 33 | public City() { 34 | 35 | } 36 | 37 | public City(int id, String cityName, List jobAdvertisements) { 38 | super(); 39 | this.id = id; 40 | this.cityName = cityName; 41 | this.jobAdvertisements = jobAdvertisements; 42 | 43 | } 44 | 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | public void setId(int id) { 50 | this.id = id; 51 | } 52 | 53 | public String getCityName() { 54 | return cityName; 55 | } 56 | 57 | public void setCityName(String cityName) { 58 | this.cityName = cityName; 59 | } 60 | 61 | public List getJobAdvertisements() { 62 | return jobAdvertisements; 63 | } 64 | 65 | public void setJobAdvertisements(List jobAdvertisements) { 66 | this.jobAdvertisements = jobAdvertisements; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/CitiesController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.jobForEveryone.hrms.business.abstracts.CityService; 13 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.Result; 15 | import com.jobForEveryone.hrms.entities.concretes.City; 16 | 17 | @RestController 18 | @RequestMapping("api/cities") 19 | public class CitiesController { 20 | 21 | private CityService cityService; 22 | 23 | @Autowired 24 | public CitiesController(CityService cityService) { 25 | super(); 26 | this.cityService = cityService; 27 | } 28 | 29 | @GetMapping("/getall") 30 | public ResponseEntity getAll(){ 31 | 32 | DataResult result= this.cityService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | } 39 | 40 | @PostMapping("/add") 41 | public ResponseEntity add(@RequestBody City city) { 42 | 43 | Result result = this.cityService.add(city); 44 | 45 | if(result.isSuccess()){ 46 | return ResponseEntity.ok(result); 47 | } 48 | return ResponseEntity.badRequest().body(result); 49 | 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/ResumesController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.jobForEveryone.hrms.business.abstracts.ResumeService; 13 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.Result; 15 | import com.jobForEveryone.hrms.entities.concretes.Resume; 16 | 17 | @RestController 18 | @RequestMapping("api/resumes") 19 | public class ResumesController { 20 | 21 | private ResumeService resumeService; 22 | 23 | @Autowired 24 | public ResumesController(ResumeService resumeService) { 25 | super(); 26 | this.resumeService = resumeService; 27 | } 28 | 29 | @GetMapping("/getall") 30 | public ResponseEntity getAll(){ 31 | 32 | DataResult result = this.resumeService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | 39 | } 40 | 41 | @PostMapping("/add") 42 | public ResponseEntity add(@RequestBody Resume resume) { 43 | 44 | Result result = this.resumeService.add(resume); 45 | 46 | if(result.isSuccess()){ 47 | return ResponseEntity.ok(result); 48 | } 49 | return ResponseEntity.badRequest().body(result); 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/JobTitle.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.OneToMany; 11 | import javax.persistence.Table; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | 15 | @Entity 16 | @Table(name="job_titles") 17 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobAdvertisements"}) 18 | public class JobTitle { 19 | 20 | @Id 21 | @GeneratedValue(strategy = GenerationType.IDENTITY) 22 | @Column(name="id") 23 | private int id; 24 | 25 | @Column(name="title") 26 | private String title; 27 | 28 | @OneToMany(mappedBy = "jobTitle") 29 | private List jobAdvertisements; 30 | 31 | public JobTitle() { 32 | 33 | } 34 | 35 | public JobTitle(int id, String title, List jobAdvertisements) { 36 | super(); 37 | this.id = id; 38 | this.title = title; 39 | this.jobAdvertisements = jobAdvertisements; 40 | } 41 | 42 | public int getId() { 43 | return id; 44 | } 45 | 46 | public void setId(int id) { 47 | this.id = id; 48 | } 49 | 50 | public String getTitle() { 51 | return title; 52 | } 53 | 54 | public void setTitle(String title) { 55 | this.title = title; 56 | } 57 | 58 | public List getJobAdvertisements() { 59 | return jobAdvertisements; 60 | } 61 | 62 | public void setJobAdvertisements(List jobAdvertisements) { 63 | this.jobAdvertisements = jobAdvertisements; 64 | } 65 | 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/JobTitleManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.jobForEveryone.hrms.business.abstracts.JobTitleService; 9 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 10 | import com.jobForEveryone.hrms.core.utilities.results.ErrorResult; 11 | import com.jobForEveryone.hrms.core.utilities.results.Result; 12 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 13 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 14 | import com.jobForEveryone.hrms.dataAccess.abstracts.JobTitleDao; 15 | import com.jobForEveryone.hrms.entities.concretes.JobTitle; 16 | 17 | @Service 18 | public class JobTitleManager implements JobTitleService{ 19 | 20 | private JobTitleDao jobTitleDao; 21 | 22 | @Autowired 23 | public JobTitleManager(JobTitleDao jobTitleDao) { 24 | super(); 25 | this.jobTitleDao = jobTitleDao; 26 | } 27 | 28 | @Override 29 | public DataResult> getAll() { 30 | 31 | return new SuccessDataResult>(this.jobTitleDao.findAll(), "İş pozisyonları listelendi."); 32 | } 33 | 34 | @Override 35 | public Result add(JobTitle jobTitle) { 36 | 37 | if(!CheckTitle(jobTitle.getTitle())) { 38 | return new ErrorResult("Title tekrar edemez!"); 39 | } 40 | 41 | this.jobTitleDao.save(jobTitle); 42 | return new SuccessResult("Pozisyon eklendi."); 43 | } 44 | 45 | private boolean CheckTitle(String title) { 46 | if(this.jobTitleDao.getByTitle(title) == null) { 47 | return true; 48 | } 49 | return false; 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/EmployersController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.jobForEveryone.hrms.business.abstracts.EmployerService; 13 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.Result; 15 | import com.jobForEveryone.hrms.entities.concretes.Employer; 16 | 17 | @RestController 18 | @RequestMapping("api/employers") 19 | public class EmployersController { 20 | 21 | private EmployerService employerService; 22 | 23 | @Autowired 24 | public EmployersController(EmployerService employerService) { 25 | super(); 26 | this.employerService = employerService; 27 | } 28 | 29 | @GetMapping("/getall") 30 | public ResponseEntity getAll(){ 31 | 32 | DataResult result = this.employerService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | } 39 | 40 | @PostMapping("/add") 41 | public ResponseEntity add(@RequestBody Employer employer) { 42 | 43 | Result result = this.employerService.add(employer); 44 | 45 | if(result.isSuccess()){ 46 | return ResponseEntity.ok(result); 47 | } 48 | return ResponseEntity.badRequest().body(result); 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/JobTitlesController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.jobForEveryone.hrms.business.abstracts.JobTitleService; 13 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.Result; 15 | import com.jobForEveryone.hrms.entities.concretes.JobTitle; 16 | 17 | @RestController 18 | @RequestMapping("/api/jobtitles") 19 | public class JobTitlesController { 20 | 21 | private JobTitleService jobTitleService; 22 | 23 | @Autowired 24 | public JobTitlesController(JobTitleService jobTitleService) { 25 | super(); 26 | this.jobTitleService = jobTitleService; 27 | } 28 | 29 | @GetMapping("/getall") 30 | public ResponseEntity getAll(){ 31 | 32 | DataResult result = this.jobTitleService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | } 39 | 40 | @PostMapping("add") 41 | public ResponseEntity add(@RequestBody JobTitle jobTitle) { 42 | 43 | Result result = this.jobTitleService.add(jobTitle); 44 | 45 | if(result.isSuccess()){ 46 | return ResponseEntity.ok(result); 47 | } 48 | return ResponseEntity.badRequest().body(result); 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/EducationInfoManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.domain.Sort; 7 | import org.springframework.data.domain.Sort.Direction; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.jobForEveryone.hrms.business.abstracts.EducationInfoService; 11 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 12 | import com.jobForEveryone.hrms.core.utilities.results.Result; 13 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 15 | import com.jobForEveryone.hrms.dataAccess.abstracts.EducationInfoDao; 16 | import com.jobForEveryone.hrms.entities.concretes.EducationInfo; 17 | 18 | @Service 19 | public class EducationInfoManager implements EducationInfoService { 20 | 21 | private EducationInfoDao educationInfoDao; 22 | 23 | @Autowired 24 | public EducationInfoManager(EducationInfoDao educationInfoDao) { 25 | super(); 26 | this.educationInfoDao = educationInfoDao; 27 | } 28 | 29 | @Override 30 | public DataResult> getAll() { 31 | 32 | return new SuccessDataResult>(this.educationInfoDao.findAll(), "Eğitimler listelendi."); 33 | } 34 | 35 | @Override 36 | public DataResult> getAllSortedByCompletionDate() { 37 | 38 | Sort sort = Sort.by(Direction.ASC, "completionDate"); 39 | return new SuccessDataResult>(this.educationInfoDao.findAll(sort), "Bitiş yılına göre listelendi."); 40 | } 41 | 42 | @Override 43 | public Result add(EducationInfo educationInfo) { 44 | 45 | this.educationInfoDao.save(educationInfo); 46 | return new SuccessResult("Eğitim eklendi."); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/JobExperienceManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.domain.Sort; 7 | import org.springframework.data.domain.Sort.Direction; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.jobForEveryone.hrms.business.abstracts.JobExperienceService; 11 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 12 | import com.jobForEveryone.hrms.core.utilities.results.Result; 13 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 15 | import com.jobForEveryone.hrms.dataAccess.abstracts.JobExperienceDao; 16 | import com.jobForEveryone.hrms.entities.concretes.JobExperience; 17 | 18 | @Service 19 | public class JobExperienceManager implements JobExperienceService{ 20 | 21 | private JobExperienceDao jobExperienceDao; 22 | 23 | @Autowired 24 | public JobExperienceManager(JobExperienceDao jobExperienceDao) { 25 | super(); 26 | this.jobExperienceDao = jobExperienceDao; 27 | } 28 | 29 | @Override 30 | public DataResult> getAll() { 31 | 32 | return new SuccessDataResult>(this.jobExperienceDao.findAll(), "İş tecrübesi listeledi."); 33 | } 34 | 35 | @Override 36 | public DataResult> getAllSortedByCompletionDate() { 37 | 38 | Sort sort = Sort.by(Direction.ASC, "completionDate"); 39 | return new SuccessDataResult>(this.jobExperienceDao.findAll(sort), "İş tecrübeleri sıralı olarak listelendi."); 40 | } 41 | 42 | @Override 43 | public Result add(JobExperience jobExperience) { 44 | 45 | this.jobExperienceDao.save(jobExperience); 46 | return new SuccessResult("İş tecrübesi eklendi."); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/ForeignLanguagesController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.jobForEveryone.hrms.business.abstracts.ForeignLanguageService; 13 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.Result; 15 | import com.jobForEveryone.hrms.entities.concretes.ForeignLanguage; 16 | 17 | @RestController 18 | @RequestMapping("api/foreignlanguages") 19 | public class ForeignLanguagesController { 20 | 21 | private ForeignLanguageService foreignLanguageService; 22 | 23 | @Autowired 24 | public ForeignLanguagesController(ForeignLanguageService foreignLanguageService) { 25 | super(); 26 | this.foreignLanguageService = foreignLanguageService; 27 | } 28 | 29 | @GetMapping("/getall") 30 | public ResponseEntity getAll(){ 31 | 32 | DataResult result = this.foreignLanguageService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | } 39 | 40 | @PostMapping("/add") 41 | public ResponseEntity add(@RequestBody ForeignLanguage foreignLanguage) { 42 | 43 | Result result = this.foreignLanguageService.add(foreignLanguage); 44 | 45 | if(result.isSuccess()){ 46 | return ResponseEntity.ok(result); 47 | } 48 | return ResponseEntity.badRequest().body(result); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/CandidatesController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import javax.validation.Valid; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.http.ResponseEntity; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import com.jobForEveryone.hrms.business.abstracts.CandidateService; 15 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 16 | import com.jobForEveryone.hrms.core.utilities.results.Result; 17 | import com.jobForEveryone.hrms.entities.concretes.Candidate; 18 | 19 | @RestController 20 | @RequestMapping("api/candidates") 21 | public class CandidatesController { 22 | 23 | private CandidateService candidateService; 24 | 25 | @Autowired 26 | public CandidatesController(CandidateService candidateService) { 27 | super(); 28 | this.candidateService = candidateService; 29 | } 30 | 31 | @GetMapping("/getall") 32 | public ResponseEntity getAll(){ 33 | 34 | DataResult result = this.candidateService.getAll(); 35 | 36 | if(result.isSuccess()){ 37 | return ResponseEntity.ok(result); 38 | } 39 | return ResponseEntity.badRequest().body(result); 40 | 41 | } 42 | 43 | @PostMapping("/add") 44 | public ResponseEntity add(@Valid @RequestBody Candidate candidate) { 45 | 46 | Result result = this.candidateService.add(candidate); 47 | 48 | if(result.isSuccess()){ 49 | return ResponseEntity.ok(result); 50 | } 51 | return ResponseEntity.badRequest().body(result); 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/ForeignLanguage.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.OneToMany; 11 | import javax.persistence.Table; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | 15 | @Entity 16 | @Table(name = "foreign_languages") 17 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","resumes","foreignLanguages"}) 18 | public class ForeignLanguage { 19 | 20 | @Id 21 | @GeneratedValue(strategy = GenerationType.IDENTITY) 22 | @Column(name = "id") 23 | private int id; 24 | 25 | @Column(name = "language_name") 26 | private String languageName; 27 | 28 | @Column(name = "language_level") 29 | private String languageLevel; 30 | 31 | @OneToMany(mappedBy = "foreignLanguage") 32 | private List resumes; 33 | 34 | 35 | public ForeignLanguage(int id, String languageName, String languageLevel, List resumes) { 36 | super(); 37 | this.id = id; 38 | this.languageName = languageName; 39 | this.languageLevel = languageLevel; 40 | this.resumes = resumes; 41 | } 42 | 43 | 44 | 45 | public ForeignLanguage() { 46 | 47 | } 48 | 49 | 50 | 51 | public int getId() { 52 | return id; 53 | } 54 | 55 | public void setId(int id) { 56 | this.id = id; 57 | } 58 | 59 | public String getLanguageName() { 60 | return languageName; 61 | } 62 | 63 | public void setLanguageName(String languageName) { 64 | this.languageName = languageName; 65 | } 66 | 67 | public String getLanguageLevel() { 68 | return languageLevel; 69 | } 70 | 71 | public void setLanguageLevel(String languageLevel) { 72 | this.languageLevel = languageLevel; 73 | } 74 | 75 | 76 | 77 | public List getForeignLanguages() { 78 | return resumes; 79 | } 80 | 81 | 82 | 83 | public void setForeignLanguages(List resumes) { 84 | this.resumes = resumes; 85 | } 86 | 87 | 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/JobExperiencesController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.jobForEveryone.hrms.business.abstracts.JobExperienceService; 13 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.Result; 15 | import com.jobForEveryone.hrms.entities.concretes.JobExperience; 16 | 17 | @RestController 18 | @RequestMapping("/api/jobexperience") 19 | public class JobExperiencesController { 20 | 21 | private JobExperienceService jobExperienceService; 22 | 23 | @Autowired 24 | public JobExperiencesController(JobExperienceService jobExperienceService) { 25 | super(); 26 | this.jobExperienceService = jobExperienceService; 27 | } 28 | 29 | @GetMapping("/getall") 30 | public ResponseEntity getAll(){ 31 | 32 | DataResult result = this.jobExperienceService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | } 39 | 40 | @GetMapping("/getAllSortedByCompletionDate") 41 | public ResponseEntity getAllSortedByCompletionDate(){ 42 | 43 | DataResult result = this.jobExperienceService.getAllSortedByCompletionDate(); 44 | 45 | if(result.isSuccess()){ 46 | return ResponseEntity.ok(result); 47 | } 48 | return ResponseEntity.badRequest().body(result); 49 | } 50 | 51 | @PostMapping("/add") 52 | public ResponseEntity add(@RequestBody JobExperience jobExperience) { 53 | 54 | Result result = this.jobExperienceService.add(jobExperience); 55 | 56 | if(result.isSuccess()){ 57 | return ResponseEntity.ok(result); 58 | } 59 | return ResponseEntity.badRequest().body(result); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/EducationInfosController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.jobForEveryone.hrms.business.abstracts.EducationInfoService; 13 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 14 | import com.jobForEveryone.hrms.core.utilities.results.Result; 15 | import com.jobForEveryone.hrms.entities.concretes.EducationInfo; 16 | 17 | @RestController 18 | @RequestMapping("/api/educationinfo") 19 | public class EducationInfosController { 20 | 21 | private EducationInfoService educationInfoService; 22 | 23 | @Autowired 24 | public EducationInfosController(EducationInfoService educationInfoService) { 25 | super(); 26 | this.educationInfoService = educationInfoService; 27 | } 28 | 29 | @GetMapping("/getall") 30 | public ResponseEntity getAll(){ 31 | 32 | DataResult result = this.educationInfoService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | } 39 | 40 | @GetMapping("/getAllSortedByCompletionDate") 41 | public ResponseEntity getAllSortedByCompletionDate(){ 42 | 43 | DataResult result = this.educationInfoService.getAllSortedByCompletionDate(); 44 | 45 | if(result.isSuccess()){ 46 | return ResponseEntity.ok(result); 47 | } 48 | return ResponseEntity.badRequest().body(result); 49 | 50 | } 51 | 52 | @PostMapping("/add") 53 | public ResponseEntity add(@RequestBody EducationInfo educationInfo) { 54 | 55 | Result result = this.educationInfoService.add(educationInfo); 56 | 57 | if(result.isSuccess()){ 58 | return ResponseEntity.ok(result); 59 | } 60 | return ResponseEntity.badRequest().body(result); 61 | 62 | } 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/Employer.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.OneToMany; 11 | import javax.persistence.Table; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | 15 | @Entity 16 | @Table(name = "employers") 17 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobAdvertisements"}) 18 | public class Employer extends User{ 19 | 20 | @Id 21 | @GeneratedValue(strategy = GenerationType.IDENTITY) 22 | @Column(name = "id") 23 | private int id; 24 | 25 | @Column(name = "company_name") 26 | private String companyName; 27 | 28 | @Column(name = "web_address") 29 | private String webAddress; 30 | 31 | @Column(name = "phone_number") 32 | private String phoneNumber; 33 | 34 | @OneToMany(mappedBy = "employer") 35 | private List jobAdvertisements; 36 | 37 | public Employer() { 38 | 39 | } 40 | 41 | 42 | public Employer(int id, String companyName, String webAddress, String phoneNumber, 43 | List jobAdvertisements) { 44 | super(); 45 | this.id = id; 46 | this.companyName = companyName; 47 | this.webAddress = webAddress; 48 | this.phoneNumber = phoneNumber; 49 | this.jobAdvertisements = jobAdvertisements; 50 | } 51 | 52 | 53 | public int getId() { 54 | return id; 55 | } 56 | 57 | 58 | public void setId(int id) { 59 | this.id = id; 60 | } 61 | 62 | 63 | public String getCompanyName() { 64 | return companyName; 65 | } 66 | 67 | 68 | public void setCompanyName(String companyName) { 69 | this.companyName = companyName; 70 | } 71 | 72 | 73 | public String getWebAddress() { 74 | return webAddress; 75 | } 76 | 77 | 78 | public void setWebAddress(String webAddress) { 79 | this.webAddress = webAddress; 80 | } 81 | 82 | 83 | public String getPhoneNumber() { 84 | return phoneNumber; 85 | } 86 | 87 | 88 | public void setPhoneNumber(String phoneNumber) { 89 | this.phoneNumber = phoneNumber; 90 | } 91 | 92 | 93 | public List getJobAdvertisements() { 94 | return jobAdvertisements; 95 | } 96 | 97 | 98 | public void setJobAdvertisements(List jobAdvertisements) { 99 | this.jobAdvertisements = jobAdvertisements; 100 | } 101 | 102 | 103 | 104 | 105 | 106 | 107 | } 108 | -------------------------------------------------------------------------------- /hrms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.5.1 9 | 10 | 11 | com.jobForEveryone 12 | hrms 13 | 0.0.1-SNAPSHOT 14 | hrms 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.projectlombok 42 | lombok 43 | true 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | io.springfox 52 | springfox-swagger2 53 | 2.9.2 54 | 55 | 56 | io.springfox 57 | springfox-swagger-ui 58 | 2.9.2 59 | 60 | 61 | org.springframework.boot 62 | spring-boot-starter-validation 63 | 64 | 65 | 66 | 67 | 68 | 69 | org.springframework.boot 70 | spring-boot-maven-plugin 71 | 72 | 73 | 74 | org.projectlombok 75 | lombok 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/JobAdvertisementManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.domain.Sort; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.jobForEveryone.hrms.business.abstracts.JobAdvertisementService; 10 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 11 | import com.jobForEveryone.hrms.core.utilities.results.Result; 12 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 13 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 14 | import com.jobForEveryone.hrms.dataAccess.abstracts.JobAdvertisementDao; 15 | import com.jobForEveryone.hrms.entities.concretes.JobAdvertisement; 16 | 17 | 18 | @Service 19 | public class JobAdvertisementManager implements JobAdvertisementService{ 20 | 21 | private JobAdvertisementDao jobAdvertisementDao; 22 | 23 | @Autowired 24 | public JobAdvertisementManager(JobAdvertisementDao jobAdvertisementDao) { 25 | super(); 26 | this.jobAdvertisementDao = jobAdvertisementDao; 27 | } 28 | 29 | @Override 30 | public Result add(JobAdvertisement jobAdvertisement) { 31 | 32 | this.jobAdvertisementDao.save(jobAdvertisement); 33 | return new SuccessResult("İş ilanı eklendi"); 34 | } 35 | 36 | @Override 37 | public DataResult> getAll() { 38 | 39 | return new SuccessDataResult>(this.jobAdvertisementDao.findAll(), "İş ilanları listelendi."); 40 | } 41 | 42 | @Override 43 | public DataResult> getAllStatusTrue() { 44 | 45 | return new SuccessDataResult>(this.jobAdvertisementDao.getAllStatusTrue(), "Açık iş ilanları listelendi."); 46 | } 47 | 48 | @Override 49 | public DataResult> getAllSortedByLastDate() { 50 | 51 | Sort sort = Sort.by(Sort.Direction.ASC,"releaseDate"); 52 | return new SuccessDataResult>(this.jobAdvertisementDao.findAll(sort), "Tarihe göre sıralı bir şekilde listelendi."); 53 | } 54 | 55 | @Override 56 | public DataResult> getAllEmployerAndStatusTrue(String companyName) { 57 | 58 | return new SuccessDataResult>(this.jobAdvertisementDao.getAllEmployerAndStatusTrue(companyName), "iş verenlere göre iş ilanları listelendi."); 59 | } 60 | 61 | @Override 62 | public Result update(int id, boolean status) { 63 | 64 | JobAdvertisement jobAdvertisementUpdate = this.jobAdvertisementDao.findById(id).get(); 65 | jobAdvertisementUpdate.setStatus(status); 66 | this.jobAdvertisementDao.save(jobAdvertisementUpdate); 67 | return new SuccessResult("İş ilanının statüsü değiştirildi."); 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/EmployerManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.jobForEveryone.hrms.business.abstracts.EmployerService; 9 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 10 | import com.jobForEveryone.hrms.core.utilities.results.ErrorResult; 11 | import com.jobForEveryone.hrms.core.utilities.results.Result; 12 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 13 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 14 | import com.jobForEveryone.hrms.dataAccess.abstracts.EmployerDao; 15 | import com.jobForEveryone.hrms.entities.concretes.Employer; 16 | import com.jobForEveryone.hrms.verification.abstracts.EmailCheckService; 17 | import com.jobForEveryone.hrms.verification.abstracts.HrmsCheckService; 18 | 19 | @Service 20 | public class EmployerManager implements EmployerService{ 21 | 22 | private EmployerDao employerDao; 23 | private EmailCheckService emailCheckService; 24 | private HrmsCheckService hrmsCheckService; 25 | 26 | @Autowired 27 | public EmployerManager(EmployerDao employerDao,EmailCheckService emailCheckService,HrmsCheckService hrmsCheckService) { 28 | super(); 29 | this.employerDao = employerDao; 30 | this.emailCheckService = emailCheckService; 31 | this.hrmsCheckService = hrmsCheckService; 32 | } 33 | 34 | @Override 35 | public DataResult> getAll() { 36 | 37 | return new SuccessDataResult>(this.employerDao.findAll(), "İş verenler listelendi"); 38 | } 39 | 40 | @Override 41 | public Result add(Employer employer) { 42 | 43 | if(employer.getCompanyName() == null || employer.getEmail() == null 44 | || employer.getPassword() == null || employer.getPhoneNumber() == null 45 | || employer.getWebAddress() == null) { 46 | return new ErrorResult("Tüm alanları doldurunuz!"); 47 | } 48 | 49 | else if(!checkEmail(employer.getEmail())) { 50 | return new ErrorResult("Email kullanılmaktadır!"); 51 | } 52 | 53 | else if(!this.emailCheckService.CheckIfRealEmail(employer)) { 54 | return new ErrorResult("Email geçerli değil!"); 55 | } 56 | 57 | else if(!this.hrmsCheckService.checkIfConfirmHrms(employer)) { 58 | return new ErrorResult("Hrms personeli onaylamadı!"); 59 | } 60 | 61 | this.employerDao.save(employer); 62 | return new SuccessResult("Kayıt başarılı"); 63 | 64 | 65 | } 66 | 67 | private boolean checkEmail(String email) { 68 | if(this.employerDao.getByEmail(email) == null) { 69 | return true; 70 | } 71 | return false; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/Candidate.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Id; 7 | import javax.persistence.OneToOne; 8 | import javax.persistence.Table; 9 | import javax.validation.constraints.NotBlank; 10 | import javax.validation.constraints.NotNull; 11 | 12 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 13 | 14 | @Entity 15 | @Table(name="candidates") 16 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","resume","candidates"}) 17 | public class Candidate extends User { 18 | 19 | @Id 20 | @Column(name="id") 21 | private int id; 22 | 23 | @Column(name="first_name") 24 | @NotBlank 25 | @NotNull 26 | private String firstName; 27 | 28 | @Column(name="last_name") 29 | @NotBlank 30 | @NotNull 31 | private String lastName; 32 | 33 | @Column(name="identity_number") 34 | @NotBlank 35 | @NotNull 36 | private String identityNumber; 37 | 38 | @Column(name="birth_year") 39 | private int birthYear; 40 | 41 | 42 | @OneToOne(mappedBy = "candidate") 43 | private Resume resume; 44 | 45 | public Candidate(int id, String firstName, String lastName, String identityNumber, int birthYear, 46 | Resume resume) { 47 | super(); 48 | this.id = id; 49 | this.firstName = firstName; 50 | this.lastName = lastName; 51 | this.identityNumber = identityNumber; 52 | this.birthYear = birthYear; 53 | this.resume = resume; 54 | } 55 | 56 | 57 | public Candidate() { 58 | 59 | } 60 | 61 | 62 | public int getId() { 63 | return id; 64 | } 65 | 66 | public void setId(int id) { 67 | this.id = id; 68 | } 69 | 70 | public String getFirstName() { 71 | return firstName; 72 | } 73 | 74 | public void setFirstName(String firstName) { 75 | this.firstName = firstName; 76 | } 77 | 78 | public String getLastName() { 79 | return lastName; 80 | } 81 | 82 | public void setLastName(String lastName) { 83 | this.lastName = lastName; 84 | } 85 | 86 | public String getIdentityNumber() { 87 | return identityNumber; 88 | } 89 | 90 | public void setIdentityNumber(String identityNumber) { 91 | this.identityNumber = identityNumber; 92 | } 93 | 94 | public int getBirthYear() { 95 | return birthYear; 96 | } 97 | 98 | public void setBirthYear(int birthYear) { 99 | this.birthYear = birthYear; 100 | } 101 | 102 | 103 | 104 | 105 | public Resume getCandidates() { 106 | return resume; 107 | } 108 | 109 | 110 | 111 | 112 | public void setCandidates(Resume resume) { 113 | this.resume = resume; 114 | } 115 | 116 | 117 | 118 | } 119 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/dtos/JobAdvertisementDetailsDto.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.dtos; 2 | 3 | import java.util.Date; 4 | 5 | 6 | public class JobAdvertisementDetailsDto { 7 | 8 | private int id; 9 | private String cityName; 10 | private String companyName; 11 | private String title; 12 | private String jobDescription; 13 | private int salaryMin; 14 | private int salaryMax; 15 | private int positionNumber; 16 | private Date lastDate; 17 | private Date releaseDate; 18 | private boolean status; 19 | 20 | public JobAdvertisementDetailsDto() { 21 | 22 | } 23 | 24 | public JobAdvertisementDetailsDto(int id, String cityName, String companyName, String title, String jobDescription, 25 | int salaryMin, int salaryMax, int positionNumber, Date lastDate, Date releaseDate, boolean status) { 26 | super(); 27 | this.id = id; 28 | this.cityName = cityName; 29 | this.companyName = companyName; 30 | this.title = title; 31 | this.jobDescription = jobDescription; 32 | this.salaryMin = salaryMin; 33 | this.salaryMax = salaryMax; 34 | this.positionNumber = positionNumber; 35 | this.lastDate = lastDate; 36 | this.releaseDate = releaseDate; 37 | this.status = status; 38 | } 39 | 40 | public int getId() { 41 | return id; 42 | } 43 | 44 | public void setId(int id) { 45 | this.id = id; 46 | } 47 | 48 | public String getCityName() { 49 | return cityName; 50 | } 51 | 52 | public void setCityName(String cityName) { 53 | this.cityName = cityName; 54 | } 55 | 56 | public String getCompanyName() { 57 | return companyName; 58 | } 59 | 60 | public void setCompanyName(String companyName) { 61 | this.companyName = companyName; 62 | } 63 | 64 | public String getTitle() { 65 | return title; 66 | } 67 | 68 | public void setTitle(String title) { 69 | this.title = title; 70 | } 71 | 72 | public String getJobDescription() { 73 | return jobDescription; 74 | } 75 | 76 | public void setJobDescription(String jobDescription) { 77 | this.jobDescription = jobDescription; 78 | } 79 | 80 | public int getSalaryMin() { 81 | return salaryMin; 82 | } 83 | 84 | public void setSalaryMin(int salaryMin) { 85 | this.salaryMin = salaryMin; 86 | } 87 | 88 | public int getSalaryMax() { 89 | return salaryMax; 90 | } 91 | 92 | public void setSalaryMax(int salaryMax) { 93 | this.salaryMax = salaryMax; 94 | } 95 | 96 | public int getPositionNumber() { 97 | return positionNumber; 98 | } 99 | 100 | public void setPositionNumber(int positionNumber) { 101 | this.positionNumber = positionNumber; 102 | } 103 | 104 | public Date getLastDate() { 105 | return lastDate; 106 | } 107 | 108 | public void setLastDate(Date lastDate) { 109 | this.lastDate = lastDate; 110 | } 111 | 112 | public Date getReleaseDate() { 113 | return releaseDate; 114 | } 115 | 116 | public void setReleaseDate(Date releaseDate) { 117 | this.releaseDate = releaseDate; 118 | } 119 | 120 | public boolean isStatus() { 121 | return status; 122 | } 123 | 124 | public void setStatus(boolean status) { 125 | this.status = status; 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/JobExperience.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.OneToMany; 12 | import javax.persistence.Table; 13 | 14 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 15 | 16 | @Entity 17 | @Table(name = "job_experience") 18 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","resumes","jobExperiences"}) 19 | public class JobExperience { 20 | 21 | @Id 22 | @GeneratedValue(strategy = GenerationType.IDENTITY) 23 | @Column(name = "id") 24 | private int id; 25 | 26 | @Column(name = "company_name") 27 | private String companyName; 28 | 29 | @Column(name = "position_name") 30 | private String positionName; 31 | 32 | @Column(name = "starting_date") 33 | private Date startingDate; 34 | 35 | @Column(name = "completion_date") 36 | private Date completionDate; 37 | 38 | @Column(name = "is_still_work") 39 | private boolean isStillWork; 40 | 41 | @OneToMany(mappedBy = "jobExperience") 42 | private List resumes; 43 | 44 | public JobExperience() { 45 | 46 | } 47 | 48 | 49 | 50 | public JobExperience(int id, String companyName, String positionName, Date startingDate, Date completionDate, 51 | boolean isStillWork, List resumes) { 52 | super(); 53 | this.id = id; 54 | this.companyName = companyName; 55 | this.positionName = positionName; 56 | this.startingDate = startingDate; 57 | this.completionDate = completionDate; 58 | this.isStillWork = isStillWork; 59 | this.resumes = resumes; 60 | } 61 | 62 | 63 | 64 | public int getId() { 65 | return id; 66 | } 67 | 68 | public void setId(int id) { 69 | this.id = id; 70 | } 71 | 72 | public String getCompanyName() { 73 | return companyName; 74 | } 75 | 76 | public void setCompanyName(String companyName) { 77 | this.companyName = companyName; 78 | } 79 | 80 | public List getJobExperiences() { 81 | return resumes; 82 | } 83 | 84 | 85 | 86 | public void setJobExperiences(List resumes) { 87 | this.resumes = resumes; 88 | } 89 | 90 | 91 | 92 | public String getPositionName() { 93 | return positionName; 94 | } 95 | 96 | public void setPositionName(String positionName) { 97 | this.positionName = positionName; 98 | } 99 | 100 | public Date getStartingDate() { 101 | return startingDate; 102 | } 103 | 104 | public void setStartingDate(Date startingDate) { 105 | this.startingDate = startingDate; 106 | } 107 | 108 | public Date getCompletionDate() { 109 | return completionDate; 110 | } 111 | 112 | public void setCompletionDate(Date completionDate) { 113 | this.completionDate = completionDate; 114 | } 115 | 116 | public boolean isStillWork() { 117 | return isStillWork; 118 | } 119 | 120 | public void setStillWork(boolean isStillWork) { 121 | this.isStillWork = isStillWork; 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/EducationInfo.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.OneToMany; 12 | import javax.persistence.Table; 13 | 14 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 15 | 16 | @Entity 17 | @Table(name ="education_info") 18 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","resumes","educationInfos"}) 19 | public class EducationInfo { 20 | 21 | @Id 22 | @GeneratedValue(strategy = GenerationType.IDENTITY) 23 | @Column(name = "id") 24 | private int id; 25 | 26 | @Column(name = "university_name") 27 | private String universityName; 28 | 29 | @Column(name = "departman_name") 30 | private String departmanName; 31 | 32 | @Column(name = "starting_date") 33 | private Date startingDate; 34 | 35 | @Column(name = "completion_date") 36 | private Date completionDate; 37 | 38 | @Column(name = "is_active_student") 39 | private boolean is_active_student; 40 | 41 | @OneToMany(mappedBy = "educationInfo") 42 | private List resumes; 43 | 44 | public EducationInfo(int id, String universityName, String departmanName, Date startingDate, Date completionDate, 45 | boolean is_active_student, List resumes) { 46 | super(); 47 | this.id = id; 48 | this.universityName = universityName; 49 | this.departmanName = departmanName; 50 | this.startingDate = startingDate; 51 | this.completionDate = completionDate; 52 | this.is_active_student = is_active_student; 53 | this.resumes = resumes; 54 | } 55 | 56 | 57 | 58 | public EducationInfo() { 59 | 60 | } 61 | 62 | 63 | 64 | public int getId() { 65 | return id; 66 | } 67 | 68 | public void setId(int id) { 69 | this.id = id; 70 | } 71 | 72 | public String getUniversityName() { 73 | return universityName; 74 | } 75 | 76 | public void setUniversityName(String universityName) { 77 | this.universityName = universityName; 78 | } 79 | 80 | public String getDepartmanName() { 81 | return departmanName; 82 | } 83 | 84 | public void setDepartmanName(String departmanName) { 85 | this.departmanName = departmanName; 86 | } 87 | 88 | public Date getStartingDate() { 89 | return startingDate; 90 | } 91 | 92 | public void setStartingDate(Date startingDate) { 93 | this.startingDate = startingDate; 94 | } 95 | 96 | public Date getCompletionDate() { 97 | return completionDate; 98 | } 99 | 100 | public void setCompletionDate(Date completionDate) { 101 | this.completionDate = completionDate; 102 | } 103 | 104 | public boolean isIs_active_student() { 105 | return is_active_student; 106 | } 107 | 108 | public List getEducationInfos() { 109 | return resumes; 110 | } 111 | 112 | 113 | 114 | public void setEducationInfos(List resumes) { 115 | this.resumes = resumes; 116 | } 117 | 118 | 119 | 120 | public void setIs_active_student(boolean is_active_student) { 121 | this.is_active_student = is_active_student; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/business/concretes/CandidateManager.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.jobForEveryone.hrms.business.abstracts.CandidateService; 9 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 10 | import com.jobForEveryone.hrms.core.utilities.results.ErrorResult; 11 | import com.jobForEveryone.hrms.core.utilities.results.Result; 12 | import com.jobForEveryone.hrms.core.utilities.results.SuccessDataResult; 13 | import com.jobForEveryone.hrms.core.utilities.results.SuccessResult; 14 | import com.jobForEveryone.hrms.dataAccess.abstracts.CandidateDao; 15 | import com.jobForEveryone.hrms.entities.concretes.Candidate; 16 | import com.jobForEveryone.hrms.verification.abstracts.EmailCheckService; 17 | import com.jobForEveryone.hrms.verification.abstracts.MernisCheckService; 18 | 19 | 20 | @Service 21 | public class CandidateManager implements CandidateService{ 22 | 23 | private CandidateDao candidateDao; 24 | private MernisCheckService mernisCheckService; 25 | private EmailCheckService emailCheckService; 26 | 27 | @Autowired 28 | public CandidateManager(CandidateDao candidateDao,MernisCheckService mernisCheckService,EmailCheckService emailCheckService) { 29 | super(); 30 | this.candidateDao = candidateDao; 31 | this.mernisCheckService = mernisCheckService; 32 | this.emailCheckService = emailCheckService; 33 | 34 | } 35 | 36 | @Override 37 | public DataResult> getAll() { 38 | 39 | return new SuccessDataResult>(this.candidateDao.findAll(), "İş arayanlar listelendi."); 40 | } 41 | 42 | @Override 43 | public Result add(Candidate candidate) { 44 | 45 | if(candidate.getFirstName() == null || candidate.getLastName() == null 46 | || candidate.getEmail() == null || candidate.getPassword() == null 47 | || candidate.getIdentityNumber() == null || candidate.getBirthYear() == 0) 48 | { 49 | 50 | return new ErrorResult("Tüm alanları doldurunuz!"); 51 | } 52 | 53 | if(!checkEmail(candidate.getEmail())) { 54 | return new ErrorResult("Email kullanılmaktadır!"); 55 | } 56 | 57 | else if(!checkIdentityNumber(candidate.getIdentityNumber())) { 58 | return new ErrorResult("TC kimlik numarası kullanılmaktadır!"); 59 | } 60 | 61 | else if(!this.mernisCheckService.checkIfRealPerson(candidate)) { 62 | return new ErrorResult("Mernis doğrulamasından geçemedi!"); 63 | } 64 | 65 | else if(!this.emailCheckService.CheckIfRealEmail(candidate)) { 66 | return new ErrorResult("Email gerçek değil!"); 67 | } 68 | 69 | this.candidateDao.save(candidate); 70 | return new SuccessResult("Kayıt başarılı"); 71 | 72 | 73 | } 74 | 75 | private boolean checkEmail(String email) { 76 | if (this.candidateDao.getByEmail(email) == null) { 77 | return true; 78 | } 79 | return false; 80 | } 81 | 82 | private boolean checkIdentityNumber(String identityNumber) { 83 | if(this.candidateDao.getByIdentityNumber(identityNumber) == null) { 84 | return true; 85 | } 86 | return false; 87 | } 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | } 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/api/controllers/JobAdvertisementsController.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.api.controllers; 2 | 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import com.jobForEveryone.hrms.business.abstracts.JobAdvertisementService; 14 | import com.jobForEveryone.hrms.core.utilities.results.DataResult; 15 | import com.jobForEveryone.hrms.core.utilities.results.Result; 16 | import com.jobForEveryone.hrms.entities.concretes.JobAdvertisement; 17 | 18 | @RestController 19 | @RequestMapping("/api/jobAdvertisement") 20 | public class JobAdvertisementsController { 21 | 22 | private JobAdvertisementService jobAdvertisementService; 23 | 24 | @Autowired 25 | public JobAdvertisementsController(JobAdvertisementService jobAdvertisementService) { 26 | super(); 27 | this.jobAdvertisementService = jobAdvertisementService; 28 | } 29 | 30 | @GetMapping("/getAll") 31 | public ResponseEntity getAll(){ 32 | DataResult result = this.jobAdvertisementService.getAll(); 33 | 34 | if(result.isSuccess()){ 35 | return ResponseEntity.ok(result); 36 | } 37 | return ResponseEntity.badRequest().body(result); 38 | 39 | } 40 | 41 | @GetMapping("/getAllStatusTrue") 42 | public ResponseEntity getAllStatusTrue(){ 43 | 44 | DataResult result = this.jobAdvertisementService.getAllStatusTrue(); 45 | 46 | if(result.isSuccess()){ 47 | return ResponseEntity.ok(result); 48 | } 49 | return ResponseEntity.badRequest().body(result); 50 | } 51 | 52 | @PostMapping("/add") 53 | public ResponseEntity add(@RequestBody JobAdvertisement jobAdvertisement) { 54 | 55 | Result result = this.jobAdvertisementService.add(jobAdvertisement); 56 | 57 | if(result.isSuccess()){ 58 | return ResponseEntity.ok(result); 59 | } 60 | return ResponseEntity.badRequest().body(result); 61 | } 62 | 63 | @GetMapping("/getAllSortedByLastDate") 64 | public ResponseEntity getAllSortedByLastDate(){ 65 | 66 | DataResult result = this.jobAdvertisementService.getAllSortedByLastDate(); 67 | 68 | if(result.isSuccess()){ 69 | return ResponseEntity.ok(result); 70 | } 71 | return ResponseEntity.badRequest().body(result); 72 | } 73 | 74 | @GetMapping("/getAllEmployerAndStatusTrue") 75 | public ResponseEntity getAllEmployerAndStatusTrue(@RequestParam("companyName") String companyName){ 76 | 77 | DataResult result = this.jobAdvertisementService.getAllEmployerAndStatusTrue(companyName); 78 | 79 | if(result.isSuccess()){ 80 | return ResponseEntity.ok(result); 81 | } 82 | return ResponseEntity.badRequest().body(result); 83 | 84 | } 85 | 86 | @PostMapping("/setStatus") 87 | public ResponseEntity update(int id , boolean status) { 88 | 89 | Result result = this.jobAdvertisementService.update(id, status); 90 | 91 | if(result.isSuccess()){ 92 | return ResponseEntity.ok(result); 93 | } 94 | return ResponseEntity.badRequest().body(result); 95 | } 96 | 97 | 98 | 99 | 100 | 101 | } 102 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/JobAdvertisement.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToOne; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name = "job_advertisements") 16 | public class JobAdvertisement { 17 | 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.IDENTITY) 20 | @Column(name = "id") 21 | private int id; 22 | 23 | @Column(name = "job_description") 24 | private String jobDescription; 25 | 26 | @Column(name="salary_min") 27 | private int salaryMin; 28 | 29 | @Column(name="salary_max") 30 | private int salaryMax; 31 | 32 | @Column(name = "position_number") 33 | private int positionNumber; 34 | 35 | @Column(name = "last_date") 36 | private Date lastDate; 37 | 38 | @Column(name="release_date") 39 | private Date releaseDate; 40 | 41 | @Column(name="status") 42 | private boolean status; 43 | 44 | 45 | @ManyToOne() 46 | @JoinColumn(name = "city_id") 47 | private City city; 48 | 49 | @ManyToOne() 50 | @JoinColumn(name = "employer_id") 51 | private Employer employer; 52 | 53 | @ManyToOne() 54 | @JoinColumn(name = "job_title_id") 55 | private JobTitle jobTitle; 56 | 57 | public JobAdvertisement() { 58 | 59 | } 60 | 61 | public JobAdvertisement(int id, String jobDescription, int salaryMin, int salaryMax, int positionNumber, 62 | Date lastDate, Date releaseDate, boolean status, City city, Employer employer, JobTitle jobTitle) { 63 | super(); 64 | this.id = id; 65 | this.jobDescription = jobDescription; 66 | this.salaryMin = salaryMin; 67 | this.salaryMax = salaryMax; 68 | this.positionNumber = positionNumber; 69 | this.lastDate = lastDate; 70 | this.releaseDate = releaseDate; 71 | this.status = status; 72 | this.city = city; 73 | this.employer = employer; 74 | this.jobTitle = jobTitle; 75 | } 76 | 77 | public int getId() { 78 | return id; 79 | } 80 | 81 | public void setId(int id) { 82 | this.id = id; 83 | } 84 | 85 | public String getJobDescription() { 86 | return jobDescription; 87 | } 88 | 89 | public void setJobDescription(String jobDescription) { 90 | this.jobDescription = jobDescription; 91 | } 92 | 93 | public int getSalaryMin() { 94 | return salaryMin; 95 | } 96 | 97 | public void setSalaryMin(int salaryMin) { 98 | this.salaryMin = salaryMin; 99 | } 100 | 101 | public int getSalaryMax() { 102 | return salaryMax; 103 | } 104 | 105 | public void setSalaryMax(int salaryMax) { 106 | this.salaryMax = salaryMax; 107 | } 108 | 109 | public int getPositionNumber() { 110 | return positionNumber; 111 | } 112 | 113 | public void setPositionNumber(int positionNumber) { 114 | this.positionNumber = positionNumber; 115 | } 116 | 117 | public Date getLastDate() { 118 | return lastDate; 119 | } 120 | 121 | public void setLastDate(Date lastDate) { 122 | this.lastDate = lastDate; 123 | } 124 | 125 | public Date getReleaseDate() { 126 | return releaseDate; 127 | } 128 | 129 | public void setReleaseDate(Date releaseDate) { 130 | this.releaseDate = releaseDate; 131 | } 132 | 133 | public boolean isStatus() { 134 | return status; 135 | } 136 | 137 | public void setStatus(boolean status) { 138 | this.status = status; 139 | } 140 | 141 | public City getCity() { 142 | return city; 143 | } 144 | 145 | public void setCity(City city) { 146 | this.city = city; 147 | } 148 | 149 | public Employer getEmployer() { 150 | return employer; 151 | } 152 | 153 | public void setEmployer(Employer employer) { 154 | this.employer = employer; 155 | } 156 | 157 | public JobTitle getJobTitle() { 158 | return jobTitle; 159 | } 160 | 161 | public void setJobTitle(JobTitle jobTitle) { 162 | this.jobTitle = jobTitle; 163 | } 164 | 165 | 166 | 167 | 168 | } 169 | -------------------------------------------------------------------------------- /hrms/src/main/java/com/jobForEveryone/hrms/entities/concretes/Resume.java: -------------------------------------------------------------------------------- 1 | package com.jobForEveryone.hrms.entities.concretes; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToOne; 12 | import javax.persistence.OneToOne; 13 | import javax.persistence.Table; 14 | 15 | @Entity 16 | @Table(name ="resumes") 17 | public class Resume { 18 | 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.IDENTITY) 21 | @Column(name = "id") 22 | private int id; 23 | 24 | @OneToOne 25 | @JoinColumn(name = "candidate_id") 26 | private Candidate candidate; 27 | 28 | @ManyToOne() 29 | @JoinColumn(name = "education_info_id") 30 | private EducationInfo educationInfo; 31 | 32 | @ManyToOne() 33 | @JoinColumn(name = "foreign_language_id") 34 | private ForeignLanguage foreignLanguage; 35 | 36 | @ManyToOne() 37 | @JoinColumn(name = "job_experience_id") 38 | private JobExperience jobExperience; 39 | 40 | @Column(name = "creation_date") 41 | private Date creationDate; 42 | 43 | @Column(name = "github_link" ) 44 | private String githubLink; 45 | 46 | @Column(name = "linkedin_link") 47 | private String linkedinLink; 48 | 49 | @Column(name = "cover_letter") 50 | private String coverLetter; 51 | 52 | @Column(name = "programming_language") 53 | private String programmingLanguage; 54 | 55 | public Resume() { 56 | 57 | } 58 | 59 | public Resume(int id, Candidate candidate, EducationInfo educationInfo, ForeignLanguage foreignLanguage, 60 | JobExperience jobExperience, Date creationDate, String githubLink, String linkedinLink, String coverLetter, 61 | String programmingLanguage) { 62 | super(); 63 | this.id = id; 64 | this.candidate = candidate; 65 | this.educationInfo = educationInfo; 66 | this.foreignLanguage = foreignLanguage; 67 | this.jobExperience = jobExperience; 68 | this.creationDate = creationDate; 69 | this.githubLink = githubLink; 70 | this.linkedinLink = linkedinLink; 71 | this.coverLetter = coverLetter; 72 | this.programmingLanguage = programmingLanguage; 73 | } 74 | 75 | public int getId() { 76 | return id; 77 | } 78 | 79 | public void setId(int id) { 80 | this.id = id; 81 | } 82 | 83 | public Candidate getCandidate() { 84 | return candidate; 85 | } 86 | 87 | public void setCandidate(Candidate candidate) { 88 | this.candidate = candidate; 89 | } 90 | 91 | public EducationInfo getEducationInfo() { 92 | return educationInfo; 93 | } 94 | 95 | public void setEducationInfo(EducationInfo educationInfo) { 96 | this.educationInfo = educationInfo; 97 | } 98 | 99 | public ForeignLanguage getForeignLanguage() { 100 | return foreignLanguage; 101 | } 102 | 103 | public void setForeignLanguage(ForeignLanguage foreignLanguage) { 104 | this.foreignLanguage = foreignLanguage; 105 | } 106 | 107 | public JobExperience getJobExperience() { 108 | return jobExperience; 109 | } 110 | 111 | public void setJobExperience(JobExperience jobExperience) { 112 | this.jobExperience = jobExperience; 113 | } 114 | 115 | public Date getCreationDate() { 116 | return creationDate; 117 | } 118 | 119 | public void setCreationDate(Date creationDate) { 120 | this.creationDate = creationDate; 121 | } 122 | 123 | public String getGithubLink() { 124 | return githubLink; 125 | } 126 | 127 | public void setGithubLink(String githubLink) { 128 | this.githubLink = githubLink; 129 | } 130 | 131 | public String getLinkedinLink() { 132 | return linkedinLink; 133 | } 134 | 135 | public void setLinkedinLink(String linkedinLink) { 136 | this.linkedinLink = linkedinLink; 137 | } 138 | 139 | public String getCoverLetter() { 140 | return coverLetter; 141 | } 142 | 143 | public void setCoverLetter(String coverLetter) { 144 | this.coverLetter = coverLetter; 145 | } 146 | 147 | public String getProgrammingLanguage() { 148 | return programmingLanguage; 149 | } 150 | 151 | public void setProgrammingLanguage(String programmingLanguage) { 152 | this.programmingLanguage = programmingLanguage; 153 | } 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | } 162 | -------------------------------------------------------------------------------- /hrms/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /hrms/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /hrms/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | --------------------------------------------------------------------------------