├── README.md ├── hrms ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ ├── maven-wrapper.properties │ │ └── MavenWrapperDownloader.java ├── src │ ├── test │ │ └── java │ │ │ └── kodlamaio │ │ │ └── hrms │ │ │ └── HrmsApplicationTests.java │ └── main │ │ ├── java │ │ ├── kodlamaio │ │ │ └── hrms │ │ │ │ ├── dataAccess │ │ │ │ └── abstracts │ │ │ │ │ ├── EmployerDao.java │ │ │ │ │ ├── SystemPersonnelDao.java │ │ │ │ │ ├── JobSeekerDao.java │ │ │ │ │ ├── LinkDao.java │ │ │ │ │ ├── SkillDao.java │ │ │ │ │ ├── LanguageDao.java │ │ │ │ │ ├── JobpositionDao.java │ │ │ │ │ ├── CoverLetterDao.java │ │ │ │ │ ├── WorkExperienceDao.java │ │ │ │ │ ├── EducationDao.java │ │ │ │ │ └── JobAdvertiseDao.java │ │ │ │ ├── core │ │ │ │ ├── dataAccess │ │ │ │ │ └── UserDao.java │ │ │ │ ├── adapters │ │ │ │ │ ├── UserValidationService.java │ │ │ │ │ └── MernisServiceAdapter.java │ │ │ │ ├── utilities │ │ │ │ │ └── results │ │ │ │ │ │ ├── ErrorResult.java │ │ │ │ │ │ ├── SuccessResult.java │ │ │ │ │ │ ├── ErrorDataResult.java │ │ │ │ │ │ ├── DataResult.java │ │ │ │ │ │ ├── SuccessDataResult.java │ │ │ │ │ │ └── Result.java │ │ │ │ ├── validations │ │ │ │ │ ├── ValidPassword.java │ │ │ │ │ └── PasswordConstraintValidator.java │ │ │ │ └── entities │ │ │ │ │ └── User.java │ │ │ │ ├── business │ │ │ │ ├── abstracts │ │ │ │ │ ├── EmployerService.java │ │ │ │ │ ├── UserService.java │ │ │ │ │ ├── LinkService.java │ │ │ │ │ ├── SystemPersonnelService.java │ │ │ │ │ ├── CoverLetterService.java │ │ │ │ │ ├── JobpositionService.java │ │ │ │ │ ├── SkillService.java │ │ │ │ │ ├── LanguageService.java │ │ │ │ │ ├── EducationService.java │ │ │ │ │ ├── JobSeekerService.java │ │ │ │ │ ├── WorkExperienceService.java │ │ │ │ │ └── JobAdvertiseService.java │ │ │ │ └── concretes │ │ │ │ │ ├── EmployerManager.java │ │ │ │ │ ├── UserManager.java │ │ │ │ │ ├── LinkManager.java │ │ │ │ │ ├── SystemPersonnelManager.java │ │ │ │ │ ├── SkillManager.java │ │ │ │ │ ├── LanguageManager.java │ │ │ │ │ ├── JobpositionManager.java │ │ │ │ │ ├── CoverLetterManager.java │ │ │ │ │ ├── EducationManager.java │ │ │ │ │ ├── WorkExperienceManager.java │ │ │ │ │ ├── JobAdvertiseManager.java │ │ │ │ │ └── JobSeekerManager.java │ │ │ │ ├── entities │ │ │ │ ├── concretes │ │ │ │ │ ├── Image.java │ │ │ │ │ ├── City.java │ │ │ │ │ ├── Jobposition.java │ │ │ │ │ ├── SystemPersonnel.java │ │ │ │ │ ├── Skill.java │ │ │ │ │ ├── CoverLetter.java │ │ │ │ │ ├── Link.java │ │ │ │ │ ├── Deneme.java │ │ │ │ │ ├── Language.java │ │ │ │ │ ├── Education.java │ │ │ │ │ ├── WorkExperience.java │ │ │ │ │ ├── Employer.java │ │ │ │ │ ├── JobAdvertise.java │ │ │ │ │ └── JobSeeker.java │ │ │ │ └── dtos │ │ │ │ │ └── ResumeDto.java │ │ │ │ ├── HrmsApplication.java │ │ │ │ └── api │ │ │ │ └── controllers │ │ │ │ ├── JobpositionsController.java │ │ │ │ ├── CoverLettersController.java │ │ │ │ ├── LinksController.java │ │ │ │ ├── SkillsController.java │ │ │ │ ├── EmployersController.java │ │ │ │ ├── LanguagesController.java │ │ │ │ ├── UsersController.java │ │ │ │ ├── SystemPersonnelsController.java │ │ │ │ ├── JobSeekersController.java │ │ │ │ ├── WorkExperiencesController.java │ │ │ │ ├── EducationsController.java │ │ │ │ └── JobAdvertisesController.java │ │ └── tr │ │ │ └── gov │ │ │ └── nvi │ │ │ └── tckimlik │ │ │ └── WS │ │ │ ├── KPSPublicSoap.java │ │ │ ├── KPSPublic.java │ │ │ ├── KPSPublicSoapProxy.java │ │ │ ├── KPSPublicLocator.java │ │ │ └── KPSPublicSoapStub.java │ │ └── resources │ │ └── application.properties ├── .gitignore ├── pom.xml ├── mvnw.cmd └── mvnw └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # HRMS-Human Resource Management System 2 | -------------------------------------------------------------------------------- /hrms/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahim1912/HRMS-Java-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/test/java/kodlamaio/hrms/HrmsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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/kodlamaio/hrms/dataAccess/abstracts/EmployerDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import kodlamaio.hrms.entities.concretes.Employer; 6 | 7 | public interface EmployerDao extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/dataAccess/UserDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.dataAccess; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import kodlamaio.hrms.core.entities.User; 6 | 7 | public interface UserDao extends JpaRepository { 8 | 9 | User findByEmail(String email); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/SystemPersonnelDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import kodlamaio.hrms.entities.concretes.SystemPersonnel; 6 | 7 | public interface SystemPersonnelDao extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/JobSeekerDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import kodlamaio.hrms.entities.concretes.JobSeeker; 6 | 7 | public interface JobSeekerDao extends JpaRepository { 8 | 9 | JobSeeker getById(int id); 10 | } 11 | -------------------------------------------------------------------------------- /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/Hrms8 5 | spring.datasource.username=postgres 6 | spring.datasource.password=789456 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/adapters/UserValidationService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.adapters; 2 | 3 | 4 | import org.springframework.stereotype.Service; 5 | 6 | import kodlamaio.hrms.entities.concretes.JobSeeker; 7 | 8 | @Service 9 | public interface UserValidationService { 10 | 11 | boolean validation (JobSeeker jobSeeker); 12 | public boolean fakeValidation(JobSeeker jobSeeker); 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/utilities/results/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.utilities.results; 2 | 3 | public class ErrorResult extends Result { 4 | 5 | public ErrorResult() { // işlem sonucu başarısız ama mesaj döndürmek istemiyoruz 6 | super(false); 7 | } 8 | 9 | public ErrorResult(String message) { // işlem sonucu başarısız mesaj döndürmek istiyoruz 10 | super(false, message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/utilities/results/SuccessResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.utilities.results; 2 | 3 | public class SuccessResult extends Result { 4 | 5 | public SuccessResult() { // işlem sonucu başarılı ama mesaj döndürmek istemiyoruz 6 | super(true); 7 | } 8 | 9 | public SuccessResult(String message) { // işlem sonucu başarılı mesaj döndürmek istiyoruz 10 | super(true, message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/LinkDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import kodlamaio.hrms.entities.concretes.Link; 8 | 9 | 10 | 11 | public interface LinkDao extends JpaRepository{ 12 | 13 | Link getById(int id); 14 | List getByJobSeekerId(int jobSeekerId); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/SkillDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import kodlamaio.hrms.entities.concretes.Skill; 8 | 9 | 10 | 11 | public interface SkillDao extends JpaRepository { 12 | 13 | Skill getById(int id); 14 | List getByJobSeekerId(int jobSeekerId); 15 | } 16 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/LanguageDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import kodlamaio.hrms.entities.concretes.Language; 8 | 9 | public interface LanguageDao extends JpaRepository { 10 | 11 | Language getById(int id); 12 | List getByJobSeekerId(int jobSeekerId); 13 | } 14 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/EmployerService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.Employer; 8 | 9 | public interface EmployerService { 10 | 11 | Result add(Employer employer); 12 | 13 | DataResult> getAll(); 14 | } 15 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/JobpositionDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | 9 | 10 | import kodlamaio.hrms.entities.concretes.Jobposition; 11 | 12 | public interface JobpositionDao extends JpaRepository { 13 | 14 | List findOneByPositionName(String positionName); 15 | } 16 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/CoverLetterDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | 4 | 5 | import java.util.List; 6 | 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | 9 | import kodlamaio.hrms.entities.concretes.CoverLetter; 10 | 11 | public interface CoverLetterDao extends JpaRepository { 12 | 13 | CoverLetter getById(int id); 14 | List getByJobSeekerId(int jobSeekerId); 15 | } 16 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/UserService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.entities.User; 6 | import kodlamaio.hrms.core.utilities.results.DataResult; 7 | import kodlamaio.hrms.core.utilities.results.Result; 8 | 9 | public interface UserService { 10 | 11 | Result add(User user); 12 | 13 | DataResult> getAll(); 14 | 15 | DataResult findByEmail(String email); 16 | } 17 | -------------------------------------------------------------------------------- /hrms/src/main/java/tr/gov/nvi/tckimlik/WS/KPSPublicSoap.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublicSoap.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public interface KPSPublicSoap extends java.rmi.Remote { 11 | public boolean TCKimlikNoDogrula(long TCKimlikNo, java.lang.String ad, java.lang.String soyad, int dogumYili) throws java.rmi.RemoteException; 12 | } 13 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/LinkService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.Link; 8 | 9 | public interface LinkService { 10 | 11 | Result add(Link link); 12 | DataResult> getAll(); 13 | DataResult> getByJobSeekerId(int jobSeekerId); 14 | } 15 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/SystemPersonnelService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.SystemPersonnel; 8 | 9 | public interface SystemPersonnelService{ 10 | 11 | Result add(SystemPersonnel systemPersonnel); 12 | 13 | DataResult> getAll(); 14 | } 15 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/utilities/results/ErrorDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.utilities.results; 2 | 3 | public class ErrorDataResult extends DataResult { 4 | 5 | public ErrorDataResult(T data, String message) { 6 | super(data, false, message); 7 | } 8 | 9 | public ErrorDataResult(T data) { 10 | super(data, false); 11 | } 12 | 13 | public ErrorDataResult(String message) { 14 | super(null, false, message); 15 | } 16 | 17 | public ErrorDataResult() { 18 | super(null, false); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/CoverLetterService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import kodlamaio.hrms.core.utilities.results.Result; 4 | 5 | import java.util.List; 6 | 7 | import kodlamaio.hrms.core.utilities.results.DataResult; 8 | import kodlamaio.hrms.entities.concretes.CoverLetter; 9 | 10 | public interface CoverLetterService { 11 | 12 | Result add(CoverLetter coverLetter); 13 | DataResult> getAll(); 14 | DataResult> getByJobSeekerId(int jobSeekerId); 15 | } 16 | -------------------------------------------------------------------------------- /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/kodlamaio/hrms/core/utilities/results/DataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.utilities.results; 2 | 3 | public class DataResult extends Result { 4 | 5 | private T data; 6 | 7 | public DataResult(T data, boolean success, String message) { 8 | super(success, message); // base sınıfın constructorlarını çalıştırır 9 | this.data = data; 10 | } 11 | 12 | public DataResult(T data, boolean success) { 13 | super(success); 14 | this.data = data; 15 | } 16 | 17 | public T getData() { 18 | return this.data; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/utilities/results/SuccessDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.utilities.results; 2 | 3 | public class SuccessDataResult extends DataResult { 4 | 5 | public SuccessDataResult(T data, String message) { 6 | super(data, true, message); 7 | } 8 | 9 | public SuccessDataResult(T data) { 10 | super(data, true); 11 | } 12 | 13 | public SuccessDataResult(String message) { 14 | super(null, true, message); 15 | } 16 | 17 | public SuccessDataResult() { 18 | super(null, true); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/WorkExperienceDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import kodlamaio.hrms.entities.concretes.WorkExperience; 8 | 9 | public interface WorkExperienceDao extends JpaRepository{ 10 | 11 | WorkExperience getById(int id); 12 | List getAllByJobSeekerIdOrderByDateOfEndDesc(int id); 13 | List getAllByJobSeekerId(int id); 14 | } 15 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/JobpositionService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.Jobposition; 8 | 9 | 10 | public interface JobpositionService { 11 | 12 | Result add(Jobposition jobposition); 13 | 14 | DataResult> getAll(); 15 | 16 | DataResult> findOneByPositionName(String positionName); 17 | } 18 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/SkillService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import kodlamaio.hrms.core.utilities.results.Result; 4 | 5 | import java.util.List; 6 | 7 | import kodlamaio.hrms.core.utilities.results.DataResult; 8 | import kodlamaio.hrms.entities.concretes.Skill; 9 | 10 | public interface SkillService { 11 | 12 | Result add(Skill skill); 13 | //DataResult getById(int id); 14 | DataResult> getAll(); 15 | DataResult> getByJobSeekerId(int jobSeekerId); 16 | } 17 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/LanguageService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import kodlamaio.hrms.core.utilities.results.Result; 4 | import kodlamaio.hrms.entities.concretes.Language; 5 | 6 | import java.util.List; 7 | 8 | import kodlamaio.hrms.core.utilities.results.DataResult; 9 | 10 | public interface LanguageService { 11 | 12 | Result add(Language language); 13 | DataResult> getAll(); 14 | DataResult> getByJobSeekerId(int jobSeekerId); 15 | //DataResult getById(int id); 16 | } 17 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/utilities/results/Result.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.utilities.results; 2 | 3 | public class Result { // super type 4 | 5 | private boolean success; 6 | private String message; 7 | 8 | public Result(boolean success) { 9 | this.success = success; 10 | } 11 | 12 | public Result(boolean success, String message) { 13 | this(success); 14 | this.message = message; 15 | } 16 | 17 | public boolean isSuccess() { 18 | return this.success; 19 | } 20 | 21 | public String getMessage() { 22 | return this.message; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/EducationService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.Education; 8 | 9 | public interface EducationService { 10 | 11 | Result add(Education education); 12 | DataResult> getAll(); 13 | DataResult> getAllByJobSeekerIdOrderByGraduationDateDesc(int id); 14 | DataResult> getAllByJobSeekerId(int id); 15 | } 16 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/JobSeekerService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.JobSeeker; 8 | import kodlamaio.hrms.entities.dtos.ResumeDto; 9 | 10 | public interface JobSeekerService { 11 | 12 | Result add(JobSeeker jobSeeker); 13 | 14 | DataResult> getAll(); 15 | 16 | DataResult getResumeByJobSeekerId(int jobSeekerId); 17 | 18 | DataResult getById(int id); 19 | } 20 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/WorkExperienceService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.WorkExperience; 8 | 9 | public interface WorkExperienceService { 10 | 11 | Result add(WorkExperience workExperience); 12 | DataResult> getAll(); 13 | DataResult> getAllByJobSeekerIdOrderByDateOfEndDesc(int id); 14 | DataResult> getAllByJobSeekerId(int id); 15 | } 16 | -------------------------------------------------------------------------------- /hrms/src/main/java/tr/gov/nvi/tckimlik/WS/KPSPublic.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublic.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public interface KPSPublic extends javax.xml.rpc.Service { 11 | public java.lang.String getKPSPublicSoapAddress(); 12 | 13 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap() throws javax.xml.rpc.ServiceException; 14 | 15 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; 16 | } 17 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/EducationDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | //import org.springframework.data.domain.Sort; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import kodlamaio.hrms.entities.concretes.Education; 9 | //import org.springframework.stereotype.Repository; 10 | 11 | //@Repository 12 | public interface EducationDao extends JpaRepository { 13 | 14 | Education getById(int id); 15 | List getAllByJobSeekerIdOrderByGraduationDateDesc(int id); 16 | List getAllByJobSeekerId(int id); 17 | //List getByJobSeekerId(Sort sort, int jobSeekerId); 18 | } 19 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/validations/ValidPassword.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.validations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | import javax.validation.Constraint; 10 | import javax.validation.Payload; 11 | 12 | @Documented 13 | @Constraint(validatedBy = PasswordConstraintValidator.class) 14 | @Target({ElementType.FIELD,ElementType.ANNOTATION_TYPE}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | public @interface ValidPassword { 17 | 18 | String message() default "Invalid Password"; 19 | 20 | Class[] groups() default {}; 21 | 22 | Class[] payload() default {}; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/abstracts/JobAdvertiseService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlamaio.hrms.core.utilities.results.DataResult; 6 | import kodlamaio.hrms.core.utilities.results.Result; 7 | import kodlamaio.hrms.entities.concretes.JobAdvertise; 8 | 9 | public interface JobAdvertiseService { 10 | 11 | Result add(JobAdvertise jobAdvertise); 12 | DataResult> getAll(); 13 | DataResult> getByIsActiveTrue(); 14 | //DataResult> getByEmployerId(int id); 15 | DataResult changeStatus(int employerId,int advertiseId, boolean status); 16 | 17 | DataResult> getAllActiveJobAdvertiseByEmployer(int id); 18 | 19 | DataResult> getAllByOrderByReleaseDate(); 20 | 21 | DataResult> getAllByOrderByApplicationDeadline(); 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Image.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | 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 | import lombok.AllArgsConstructor; 15 | import lombok.Data; 16 | import lombok.NoArgsConstructor; 17 | 18 | @Data 19 | @Entity 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | @Table(name="images") 23 | public class Image { 24 | 25 | @Id 26 | @GeneratedValue(strategy = GenerationType.IDENTITY) 27 | @Column(name = "id") 28 | private int id; 29 | 30 | @Column(name = "url") 31 | private String url; 32 | 33 | @ManyToOne() 34 | @JoinColumn(name = "jobSeeker_id") 35 | private JobSeeker jobSeeker; 36 | 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/adapters/MernisServiceAdapter.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.adapters; 2 | 3 | import java.rmi.RemoteException; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import kodlamaio.hrms.entities.concretes.JobSeeker; 8 | import tr.gov.nvi.tckimlik.WS.KPSPublicSoapProxy; 9 | 10 | @Service 11 | public class MernisServiceAdapter implements UserValidationService { 12 | 13 | 14 | @Override 15 | public boolean validation(JobSeeker jobSeeker) { 16 | KPSPublicSoapProxy client = new KPSPublicSoapProxy(); 17 | try { 18 | return client.TCKimlikNoDogrula(Long.parseLong(jobSeeker.getIdentityNumber()), jobSeeker.getFirstName().toUpperCase(), 19 | jobSeeker.getLastName().toUpperCase(), Integer.parseInt(jobSeeker.getBirthYear())); 20 | } catch (RemoteException e) { 21 | e.printStackTrace(); 22 | } 23 | return false; 24 | } 25 | 26 | 27 | @Override 28 | public boolean fakeValidation(JobSeeker jobSeeker) { 29 | 30 | return true; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/dtos/ResumeDto.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.dtos; 2 | 3 | import java.util.List; 4 | 5 | import com.fasterxml.jackson.annotation.JsonIgnore; 6 | 7 | import kodlamaio.hrms.entities.concretes.CoverLetter; 8 | import kodlamaio.hrms.entities.concretes.Education; 9 | import kodlamaio.hrms.entities.concretes.JobSeeker; 10 | import kodlamaio.hrms.entities.concretes.Language; 11 | import kodlamaio.hrms.entities.concretes.Link; 12 | import kodlamaio.hrms.entities.concretes.Skill; 13 | import kodlamaio.hrms.entities.concretes.WorkExperience; 14 | import lombok.AllArgsConstructor; 15 | import lombok.Data; 16 | import lombok.NoArgsConstructor; 17 | 18 | @Data 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | 22 | public class ResumeDto { 23 | 24 | @JsonIgnore() 25 | private JobSeeker jobSeeker; 26 | private List educations; 27 | private List languages; 28 | private List workExperiences; 29 | private List skills; 30 | private List links; 31 | private List coverLetters; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/City.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 | import javax.validation.constraints.NotBlank; 13 | 14 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 15 | 16 | import lombok.AllArgsConstructor; 17 | import lombok.Data; 18 | import lombok.NoArgsConstructor; 19 | 20 | @Data 21 | 22 | @NoArgsConstructor 23 | @JsonIgnoreProperties({ "hibernateLazyInitializer", "handler", "jobAdvertises" }) 24 | @Entity 25 | @Table(name = "cities") 26 | 27 | public class City { 28 | 29 | @Id 30 | @GeneratedValue(strategy = GenerationType.IDENTITY) 31 | @Column(name = "id") 32 | private int id; 33 | 34 | @Column(name = "name") 35 | @NotBlank 36 | private String name; 37 | 38 | @OneToMany(mappedBy= "city") 39 | private List jobAdvertises; 40 | 41 | 42 | 43 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 İbrahim Kaplan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/dataAccess/abstracts/JobAdvertiseDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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.fasterxml.jackson.annotation.JsonIgnoreProperties; 9 | 10 | import kodlamaio.hrms.entities.concretes.JobAdvertise; 11 | 12 | public interface JobAdvertiseDao extends JpaRepository { 13 | 14 | 15 | List getByIsActiveTrue(); 16 | List getByEmployerId(int id); 17 | 18 | 19 | @Query("From JobAdvertise where isActive = true and employer_id =:id") 20 | @JsonIgnoreProperties({ "id", "website", "phoneNumber", "email", 21 | "password" }) 22 | List getAllActiveJobAdvertiseByEmployer(int id); 23 | 24 | @Query("From JobAdvertise where isActive = true Order By releaseDate Desc") 25 | List getAllByOrderByReleaseDateDesc(); 26 | 27 | 28 | @Query("From JobAdvertise where isActive = true Order By applicationDeadline Asc") 29 | List getAllByOrderByApplicationDeadlineDesc(); 30 | } 31 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Jobposition.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.CascadeType; 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 | import lombok.AllArgsConstructor; 17 | import lombok.Data; 18 | import lombok.NoArgsConstructor; 19 | 20 | @Data 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | @Entity 24 | @Table(name = "jobpositions") 25 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobAdvertises"}) 26 | 27 | public class Jobposition { 28 | @Id 29 | @GeneratedValue(strategy = GenerationType.IDENTITY) 30 | @Column(name = "id") 31 | private int id; 32 | 33 | @Column(name = "position_name") 34 | private String positionName; 35 | 36 | @OneToMany(mappedBy="jobposition") 37 | private List jobAdvertises; 38 | 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/HrmsApplication.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 | @SpringBootApplication 13 | @EnableSwagger2 //swagger ı başlatıyor 14 | public class HrmsApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(HrmsApplication.class, args); 18 | } 19 | 20 | 21 | @Bean 22 | public Docket api() { //projedeki tüm apileri bulup dökümantasyona aktarıyor 23 | return new Docket(DocumentationType.SWAGGER_2) 24 | .select() 25 | .apis(RequestHandlerSelectors.basePackage("kodlamaio.hrms")) 26 | .build(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/SystemPersonnel.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.PrimaryKeyJoinColumn; 6 | import javax.persistence.Table; 7 | import javax.validation.constraints.NotBlank; 8 | 9 | 10 | import kodlamaio.hrms.core.entities.User; 11 | import lombok.Data; 12 | import lombok.EqualsAndHashCode; 13 | import lombok.NoArgsConstructor; 14 | 15 | @PrimaryKeyJoinColumn(name="user_id",referencedColumnName = "id") 16 | @Data 17 | @NoArgsConstructor 18 | @EqualsAndHashCode(callSuper = false) 19 | @Entity 20 | @Table(name = "system_personnels") 21 | 22 | public class SystemPersonnel extends User { 23 | 24 | @Column(name="first_name",length = 25,nullable = false) 25 | @NotBlank 26 | private String firstName; 27 | 28 | @Column(name="last_name",length = 25,nullable = false) 29 | @NotBlank 30 | 31 | private String lastName; 32 | 33 | 34 | 35 | public SystemPersonnel(String email,String password,String firstName, String lastName) { 36 | super(email,password); 37 | this.firstName = firstName; 38 | this.lastName = lastName; 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Skill.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | 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 | import javax.validation.constraints.NotNull; 14 | 15 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 16 | 17 | import lombok.AllArgsConstructor; 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | 21 | @Data 22 | @Entity 23 | @NoArgsConstructor 24 | @AllArgsConstructor 25 | @Table(name="skills") 26 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobSeeker"}) 27 | 28 | public class Skill { 29 | 30 | @Id 31 | @GeneratedValue(strategy = GenerationType.IDENTITY) 32 | @Column(name = "id") 33 | private int id; 34 | 35 | @Column(name = "name") 36 | @NotNull 37 | private String name; 38 | 39 | @ManyToOne() 40 | @NotNull 41 | @JoinColumn(name = "jobSeeker_id") 42 | private JobSeeker jobSeeker; 43 | } -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/EmployerManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.EmployerService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.EmployerDao; 14 | import kodlamaio.hrms.entities.concretes.Employer; 15 | 16 | @Service 17 | public class EmployerManager implements EmployerService { 18 | 19 | private EmployerDao employerDao; 20 | 21 | @Autowired 22 | public EmployerManager(EmployerDao employerDao) { 23 | super(); 24 | this.employerDao = employerDao; 25 | } 26 | 27 | @Override 28 | public Result add(Employer employer) { 29 | this.employerDao.save(employer); 30 | return new SuccessResult("Data eklendi"); 31 | } 32 | 33 | @Override 34 | public DataResult> getAll() { 35 | return new SuccessDataResult>(this.employerDao.findAll(),"Data listelendi"); 36 | } 37 | 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/CoverLetter.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | import javax.validation.constraints.NotBlank; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | import com.sun.istack.NotNull; 15 | 16 | import lombok.AllArgsConstructor; 17 | import lombok.Data; 18 | import lombok.NoArgsConstructor; 19 | 20 | @Data 21 | @Entity 22 | @NoArgsConstructor 23 | @AllArgsConstructor 24 | @Table(name="cover_letters") 25 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobSeeker"}) 26 | public class CoverLetter { 27 | 28 | @Id 29 | @GeneratedValue(strategy = GenerationType.IDENTITY) 30 | @Column(name = "id") 31 | private int id; 32 | 33 | @Column(name = "writing") 34 | @NotNull 35 | @NotBlank 36 | private String writing; 37 | 38 | //@JsonIgnoreProperties({ "birthYear", "identityNumber", "email","password" }) 39 | @ManyToOne() 40 | @JoinColumn(name = "jobSeeker_id") 41 | private JobSeeker jobSeeker; 42 | } 43 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/entities/User.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.entities; 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.Inheritance; 9 | import javax.persistence.InheritanceType; 10 | import javax.persistence.Table; 11 | import javax.validation.constraints.Email; 12 | import javax.validation.constraints.NotBlank; 13 | import javax.validation.constraints.NotNull; 14 | 15 | import kodlamaio.hrms.core.validations.ValidPassword; 16 | import lombok.Data; 17 | import lombok.NoArgsConstructor; 18 | 19 | @Data 20 | 21 | @NoArgsConstructor 22 | @Entity 23 | @Table(name="users") 24 | @Inheritance(strategy = InheritanceType.JOINED) 25 | public class User { 26 | 27 | @Id 28 | @GeneratedValue(strategy = GenerationType.IDENTITY ) 29 | @Column(name = "id") 30 | private int id; 31 | 32 | 33 | 34 | @Column(name = "email",nullable = true,unique = true) 35 | @Email 36 | @NotBlank 37 | @NotNull 38 | private String email; 39 | 40 | @Column(name = "password", nullable = true) 41 | @NotBlank 42 | @NotNull 43 | @ValidPassword 44 | private String password; 45 | 46 | public User( String email, String password) { 47 | 48 | this.email = email; 49 | this.password = password; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/UserManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.UserService; 9 | import kodlamaio.hrms.core.dataAccess.UserDao; 10 | import kodlamaio.hrms.core.entities.User; 11 | import kodlamaio.hrms.core.utilities.results.DataResult; 12 | import kodlamaio.hrms.core.utilities.results.Result; 13 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 14 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 15 | 16 | @Service 17 | public class UserManager implements UserService { 18 | 19 | private UserDao userDao; 20 | 21 | @Autowired 22 | public UserManager(UserDao userDao) { 23 | super(); 24 | this.userDao = userDao; 25 | } 26 | 27 | @Override 28 | public Result add(User user) { 29 | this.userDao.save(user); 30 | return new SuccessResult("Kullanıcı eklendi"); 31 | } 32 | 33 | @Override 34 | public DataResult findByEmail(String email) { 35 | 36 | return new SuccessDataResult 37 | (this.userDao.findByEmail(email),"Kullanıcı bulundu"); 38 | } 39 | 40 | @Override 41 | public DataResult> getAll() { 42 | return new SuccessDataResult> 43 | (this.userDao.findAll(),"Data listelendi"); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/LinkManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 | 9 | import kodlamaio.hrms.business.abstracts.LinkService; 10 | import kodlamaio.hrms.core.utilities.results.DataResult; 11 | import kodlamaio.hrms.core.utilities.results.Result; 12 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 13 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 14 | import kodlamaio.hrms.dataAccess.abstracts.LinkDao; 15 | import kodlamaio.hrms.entities.concretes.Link; 16 | import net.bytebuddy.asm.Advice.This; 17 | 18 | @Service 19 | public class LinkManager implements LinkService{ 20 | 21 | private LinkDao linkDao; 22 | 23 | @Autowired 24 | public LinkManager(LinkDao linkDao) { 25 | super(); 26 | this.linkDao = linkDao; 27 | } 28 | 29 | @Override 30 | public Result add(Link link) { 31 | this.linkDao.save(link); 32 | return new SuccessResult("Data eklendi"); 33 | } 34 | 35 | @Override 36 | public DataResult> getAll() { 37 | return new SuccessDataResult>(this.linkDao.findAll()); 38 | } 39 | 40 | @Override 41 | public DataResult> getByJobSeekerId(int jobSeekerId) { 42 | return new SuccessDataResult>(this.linkDao.getByJobSeekerId(jobSeekerId)); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/SystemPersonnelManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.SystemPersonnelService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.SystemPersonnelDao; 14 | import kodlamaio.hrms.entities.concretes.SystemPersonnel; 15 | 16 | @Service 17 | public class SystemPersonnelManager implements SystemPersonnelService{ 18 | 19 | private SystemPersonnelDao systemPersonnelDao; 20 | 21 | @Autowired 22 | public SystemPersonnelManager(SystemPersonnelDao systemPersonnelDao) { 23 | super(); 24 | this.systemPersonnelDao = systemPersonnelDao; 25 | } 26 | 27 | @Override 28 | public Result add(SystemPersonnel systemPersonnel) { 29 | this.systemPersonnelDao.save(systemPersonnel); 30 | return new SuccessResult("Data eklendi"); 31 | } 32 | 33 | @Override 34 | public DataResult> getAll() { 35 | return new SuccessDataResult>(this.systemPersonnelDao.findAll(),"Data listelendi"); 36 | } 37 | 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Link.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.NotNull; 13 | 14 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 15 | 16 | import lombok.AllArgsConstructor; 17 | import lombok.Data; 18 | import lombok.NoArgsConstructor; 19 | 20 | @Data 21 | @Entity 22 | @Table(name = "links") 23 | @AllArgsConstructor 24 | @NoArgsConstructor 25 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobSeeker"}) 26 | public class Link { 27 | 28 | @Id 29 | @GeneratedValue(strategy = GenerationType.IDENTITY) 30 | @Column(name = "id",nullable = false) 31 | private int id; 32 | 33 | @Column(name = "name") 34 | @NotNull 35 | @NotBlank 36 | private String name; 37 | 38 | @NotNull 39 | @NotBlank 40 | @Column(name = "url") 41 | private String url; 42 | 43 | //@JsonIgnoreProperties({ "birthYear", "identityNumber", "email","password" }) 44 | @ManyToOne() 45 | @JoinColumn(name = "jobSeeker_id",nullable = false) 46 | private JobSeeker jobSeeker; 47 | 48 | } -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/SkillManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.SkillService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.SkillDao; 14 | import kodlamaio.hrms.entities.concretes.Skill; 15 | import net.bytebuddy.asm.Advice.This; 16 | 17 | @Service 18 | public class SkillManager implements SkillService { 19 | 20 | private SkillDao skillDao; 21 | 22 | @Autowired 23 | public SkillManager(SkillDao skillDao) { 24 | super(); 25 | this.skillDao = skillDao; 26 | } 27 | 28 | @Override 29 | public Result add(Skill skill) { 30 | this.skillDao.save(skill); 31 | return new SuccessResult("Data eklendi."); 32 | } 33 | 34 | @Override 35 | public DataResult> getAll() { 36 | return new SuccessDataResult>(this.skillDao.findAll()); 37 | } 38 | 39 | @Override 40 | public DataResult> getByJobSeekerId(int jobSeekerId) { 41 | return new SuccessDataResult>(this.skillDao.getByJobSeekerId(jobSeekerId)); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Deneme.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | import javax.validation.constraints.NotBlank; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | 15 | import lombok.AllArgsConstructor; 16 | import lombok.Data; 17 | import lombok.NoArgsConstructor; 18 | 19 | @Data 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | @Entity 23 | @Table(name = "denemes") 24 | 25 | public class Deneme { 26 | 27 | @Id 28 | @GeneratedValue(strategy = GenerationType.IDENTITY) 29 | @Column(name = "id", nullable = false) 30 | private int id; 31 | 32 | @Column(name = "name", nullable = false) 33 | @NotBlank 34 | private String name; 35 | 36 | // @JsonIgnoreProperties({ "user_id", "website", "phone_number", "email", "password" }) 37 | // @ManyToOne() 38 | // @JoinColumn(name = "employer_id") 39 | // private Employer employer; 40 | 41 | // @JsonIgnoreProperties({ "id" }) 42 | @ManyToOne() 43 | @JoinColumn(name = "city_id") 44 | private City city; 45 | 46 | //@JsonIgnoreProperties({ "id" }) 47 | @ManyToOne() 48 | @JoinColumn(name = "jobposition_id") 49 | private Jobposition jobposition; 50 | } 51 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/LanguageManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.LanguageService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.LanguageDao; 14 | import kodlamaio.hrms.entities.concretes.CoverLetter; 15 | import kodlamaio.hrms.entities.concretes.Language; 16 | 17 | @Service 18 | public class LanguageManager implements LanguageService { 19 | 20 | private LanguageDao languageDao; 21 | 22 | @Autowired 23 | public LanguageManager(LanguageDao languageDao) { 24 | super(); 25 | this.languageDao = languageDao; 26 | } 27 | 28 | @Override 29 | public Result add(Language language) { 30 | this.languageDao.save(language); 31 | return new SuccessResult("Data eklendi."); 32 | } 33 | 34 | @Override 35 | public DataResult> getAll() { 36 | return new SuccessDataResult>(this.languageDao.findAll()); 37 | } 38 | 39 | @Override 40 | public DataResult> getByJobSeekerId(int jobSeekerId) { 41 | return new SuccessDataResult>(this.languageDao.getByJobSeekerId(jobSeekerId)); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Language.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | import javax.validation.constraints.Max; 12 | import javax.validation.constraints.Min; 13 | import javax.validation.constraints.NotBlank; 14 | 15 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 16 | import com.sun.istack.NotNull; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | @Data 23 | @Entity 24 | @Table(name = "languages") 25 | @AllArgsConstructor 26 | @NoArgsConstructor 27 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobSeeker"}) 28 | public class Language { 29 | 30 | @Id 31 | @GeneratedValue(strategy = GenerationType.IDENTITY) 32 | @Column(name = "id",nullable = false) 33 | private int id; 34 | 35 | @Column(name = "name") 36 | @NotNull 37 | @NotBlank 38 | private String name; 39 | 40 | @Column(name = "level") 41 | @Min(1) 42 | @Max(5) 43 | @NotNull 44 | private short level; 45 | 46 | // @JsonIgnoreProperties({ "birthYear", "identityNumber", "email","password" }) 47 | @ManyToOne() 48 | @JoinColumn(name = "jobSeeker_id") 49 | private JobSeeker jobSeeker; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/JobpositionManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.JobpositionService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.JobpositionDao; 14 | import kodlamaio.hrms.entities.concretes.Jobposition; 15 | 16 | @Service 17 | public class JobpositionManager implements JobpositionService { 18 | 19 | private JobpositionDao jobpositionDao; 20 | 21 | @Autowired 22 | public JobpositionManager(JobpositionDao jobpositionDao) { 23 | super(); 24 | this.jobpositionDao = jobpositionDao; 25 | } 26 | 27 | @Override 28 | public DataResult> getAll() { 29 | 30 | return new SuccessDataResult>(this.jobpositionDao.findAll(), "Data listelendi"); 31 | } 32 | 33 | @Override 34 | public Result add(Jobposition jobposition) { 35 | this.jobpositionDao.save(jobposition); 36 | return new SuccessResult("Data eklendi"); 37 | 38 | } 39 | 40 | @Override 41 | public DataResult> findOneByPositionName(String positionName) { 42 | return new SuccessDataResult>(this.jobpositionDao.findOneByPositionName(positionName)); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/CoverLetterManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.CoverLetterService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.CoverLetterDao; 14 | import kodlamaio.hrms.entities.concretes.CoverLetter; 15 | import net.bytebuddy.asm.Advice.This; 16 | 17 | @Service 18 | public class CoverLetterManager implements CoverLetterService { 19 | 20 | private CoverLetterDao coverLetterDao; 21 | 22 | @Autowired 23 | public CoverLetterManager(CoverLetterDao coverLetterDao) { 24 | super(); 25 | this.coverLetterDao = coverLetterDao; 26 | } 27 | 28 | @Override 29 | public Result add(CoverLetter coverLetter) { 30 | this.coverLetterDao.save(coverLetter); 31 | return new SuccessResult("Data eklendi."); 32 | } 33 | 34 | 35 | @Override 36 | public DataResult> getAll() { 37 | return new SuccessDataResult>(this.coverLetterDao.findAll()); 38 | } 39 | 40 | 41 | 42 | @Override 43 | public DataResult> getByJobSeekerId(int jobSeekerId) { 44 | return new SuccessDataResult>(this.coverLetterDao.getByJobSeekerId(jobSeekerId)); 45 | } 46 | 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Education.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | import java.time.LocalDate; 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 | import javax.validation.constraints.NotBlank; 14 | 15 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 16 | import com.sun.istack.NotNull; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | @Data 23 | @AllArgsConstructor 24 | @NoArgsConstructor 25 | @Entity 26 | @Table(name = "educations") 27 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobSeeker"}) 28 | 29 | public class Education { 30 | 31 | @Id 32 | @GeneratedValue(strategy = GenerationType.IDENTITY) 33 | @Column(name = "id", nullable = false) 34 | private int id; 35 | 36 | @Column(name = "school_name") 37 | @NotNull 38 | @NotBlank 39 | private String schoolName; 40 | 41 | @Column(name = "department") 42 | @NotNull 43 | @NotBlank 44 | private String department; 45 | 46 | @Column(name = "start_date") 47 | @NotNull 48 | private LocalDate startDate; 49 | 50 | @Column(name = "graduation_date") 51 | private LocalDate graduationDate; 52 | 53 | //@JsonIgnoreProperties({ "birthYear", "identityNumber", "email","password" }) 54 | @ManyToOne() 55 | @JoinColumn(name = "jobSeeker_id") 56 | private JobSeeker jobSeeker; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/WorkExperience.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | import java.time.LocalDate; 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 | import javax.validation.constraints.NotBlank; 14 | 15 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 16 | import com.sun.istack.NotNull; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | @Data 23 | @AllArgsConstructor 24 | @NoArgsConstructor 25 | @Entity 26 | @Table(name = "work_experiences") 27 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobSeeker"}) 28 | public class WorkExperience { 29 | 30 | 31 | @Id 32 | @GeneratedValue(strategy = GenerationType.IDENTITY) 33 | @Column(name = "id", nullable = false) 34 | private int id; 35 | 36 | @Column(name = "workplace_name", nullable = true) 37 | @NotNull 38 | @NotBlank 39 | private String workplaceName; 40 | 41 | @Column(name = "position", nullable = true) 42 | @NotNull 43 | @NotBlank 44 | private String position; 45 | 46 | @Column(name = "date_of_start", nullable = true) 47 | @NotNull 48 | private LocalDate dateOfStart; 49 | 50 | @Column(name = "date_of_end") 51 | private LocalDate dateOfEnd; 52 | 53 | // @JsonIgnoreProperties({ "birthYear", "identityNumber", "email","password" }) 54 | @ManyToOne() 55 | @JoinColumn(name = "jobSeeker_id", nullable = true) 56 | private JobSeeker jobSeeker; 57 | } 58 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/JobpositionsController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.List; 4 | import java.util.Optional; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.CrossOrigin; 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 | 15 | import kodlamaio.hrms.business.abstracts.JobpositionService; 16 | import kodlamaio.hrms.core.utilities.results.DataResult; 17 | import kodlamaio.hrms.core.utilities.results.Result; 18 | import kodlamaio.hrms.entities.concretes.Jobposition; 19 | 20 | @CrossOrigin 21 | @RestController 22 | @RequestMapping("/api/job-positions") 23 | 24 | public class JobpositionsController { 25 | 26 | private JobpositionService jobpositionService; 27 | 28 | @Autowired 29 | public JobpositionsController(JobpositionService jobpositionService) { 30 | super(); 31 | this.jobpositionService = jobpositionService; 32 | } 33 | 34 | @GetMapping("/getall") 35 | public DataResult> getAll() { 36 | return this.jobpositionService.getAll(); 37 | 38 | } 39 | 40 | @PostMapping("/add") 41 | public Result add(@RequestBody Jobposition jobPosition) { 42 | return this.jobpositionService.add(jobPosition); 43 | } 44 | 45 | @GetMapping("/findbypositionname") 46 | public DataResult> findOneByPositionName(String positionName) { 47 | return this.jobpositionService.findOneByPositionName(positionName); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/EducationManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.EducationService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.EducationDao; 14 | import kodlamaio.hrms.entities.concretes.Education; 15 | import net.bytebuddy.asm.Advice.This; 16 | 17 | @Service 18 | public class EducationManager implements EducationService{ 19 | 20 | private EducationDao educationDao; 21 | 22 | @Autowired 23 | public EducationManager(EducationDao educationDao) { 24 | super(); 25 | this.educationDao = educationDao; 26 | } 27 | 28 | 29 | @Override 30 | public Result add(Education education) { 31 | this.educationDao.save(education); 32 | return new SuccessResult("Data eklendi"); 33 | } 34 | 35 | @Override 36 | public DataResult> getAll() { 37 | return new SuccessDataResult>(this.educationDao.findAll()); 38 | } 39 | 40 | @Override 41 | public DataResult> getAllByJobSeekerIdOrderByGraduationDateDesc(int id) { 42 | return new SuccessDataResult>(this.educationDao.getAllByJobSeekerIdOrderByGraduationDateDesc(id)); 43 | } 44 | 45 | @Override 46 | public DataResult> getAllByJobSeekerId(int id) { 47 | return new SuccessDataResult>(this.educationDao.getAllByJobSeekerId(id)); 48 | } 49 | 50 | 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/WorkExperienceManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.WorkExperienceService; 9 | import kodlamaio.hrms.core.utilities.results.DataResult; 10 | import kodlamaio.hrms.core.utilities.results.Result; 11 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 12 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 13 | import kodlamaio.hrms.dataAccess.abstracts.WorkExperienceDao; 14 | import kodlamaio.hrms.entities.concretes.WorkExperience; 15 | 16 | @Service 17 | public class WorkExperienceManager implements WorkExperienceService { 18 | 19 | private WorkExperienceDao workExperienceDao; 20 | 21 | @Autowired 22 | public WorkExperienceManager(WorkExperienceDao workExperienceDao) { 23 | super(); 24 | this.workExperienceDao = workExperienceDao; 25 | } 26 | 27 | @Override 28 | public Result add(WorkExperience workExperience) { 29 | this.workExperienceDao.save(workExperience); 30 | return new SuccessResult("Data eklendi"); 31 | } 32 | 33 | @Override 34 | public DataResult> getAll() { 35 | return new SuccessDataResult>(this.workExperienceDao.findAll(), "Data listelendi"); 36 | } 37 | 38 | @Override 39 | public DataResult> getAllByJobSeekerIdOrderByDateOfEndDesc(int id) { 40 | return new SuccessDataResult>(this.workExperienceDao.getAllByJobSeekerIdOrderByDateOfEndDesc(id)); 41 | } 42 | 43 | @Override 44 | public DataResult> getAllByJobSeekerId(int id) { 45 | return new SuccessDataResult>(this.workExperienceDao.getAllByJobSeekerId(id)); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /hrms/src/main/java/tr/gov/nvi/tckimlik/WS/KPSPublicSoapProxy.java: -------------------------------------------------------------------------------- 1 | package tr.gov.nvi.tckimlik.WS; 2 | 3 | public class KPSPublicSoapProxy implements tr.gov.nvi.tckimlik.WS.KPSPublicSoap { 4 | private String _endpoint = null; 5 | private tr.gov.nvi.tckimlik.WS.KPSPublicSoap kPSPublicSoap = null; 6 | 7 | public KPSPublicSoapProxy() { 8 | _initKPSPublicSoapProxy(); 9 | } 10 | 11 | public KPSPublicSoapProxy(String endpoint) { 12 | _endpoint = endpoint; 13 | _initKPSPublicSoapProxy(); 14 | } 15 | 16 | private void _initKPSPublicSoapProxy() { 17 | try { 18 | kPSPublicSoap = (new tr.gov.nvi.tckimlik.WS.KPSPublicLocator()).getKPSPublicSoap(); 19 | if (kPSPublicSoap != null) { 20 | if (_endpoint != null) 21 | ((javax.xml.rpc.Stub)kPSPublicSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); 22 | else 23 | _endpoint = (String)((javax.xml.rpc.Stub)kPSPublicSoap)._getProperty("javax.xml.rpc.service.endpoint.address"); 24 | } 25 | 26 | } 27 | catch (javax.xml.rpc.ServiceException serviceException) {} 28 | } 29 | 30 | public String getEndpoint() { 31 | return _endpoint; 32 | } 33 | 34 | public void setEndpoint(String endpoint) { 35 | _endpoint = endpoint; 36 | if (kPSPublicSoap != null) 37 | ((javax.xml.rpc.Stub)kPSPublicSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); 38 | 39 | } 40 | 41 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap() { 42 | if (kPSPublicSoap == null) 43 | _initKPSPublicSoapProxy(); 44 | return kPSPublicSoap; 45 | } 46 | 47 | public boolean TCKimlikNoDogrula(long TCKimlikNo, java.lang.String ad, java.lang.String soyad, int dogumYili) throws java.rmi.RemoteException{ 48 | if (kPSPublicSoap == null) 49 | _initKPSPublicSoapProxy(); 50 | return kPSPublicSoap.TCKimlikNoDogrula(TCKimlikNo, ad, soyad, dogumYili); 51 | } 52 | 53 | 54 | } -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/Employer.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.OneToMany; 9 | import javax.persistence.PrimaryKeyJoinColumn; 10 | import javax.persistence.Table; 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.NotEmpty; 13 | import javax.validation.constraints.Pattern; 14 | 15 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 16 | import com.sun.istack.NotNull; 17 | 18 | import kodlamaio.hrms.core.entities.User; 19 | import lombok.AllArgsConstructor; 20 | import lombok.Data; 21 | import lombok.EqualsAndHashCode; 22 | import lombok.NoArgsConstructor; 23 | 24 | @PrimaryKeyJoinColumn(name = "user_id",referencedColumnName = "id") 25 | @Data 26 | @NoArgsConstructor 27 | @EqualsAndHashCode(callSuper = false) 28 | @Entity 29 | @Table(name = "employers") 30 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","jobAdvertises"}) 31 | 32 | public class Employer extends User { 33 | 34 | @Column(name = "company_name", length = 25, nullable = true) 35 | @NotBlank 36 | private String companyName; 37 | 38 | @Column(name = "website", length = 25, nullable = true) 39 | @NotBlank() 40 | private String website; 41 | 42 | @Column(name = "phone_number", length = 10, nullable = true) 43 | @NotBlank 44 | @NotEmpty 45 | @Pattern(regexp = "[0-9\\\\s]{10}", message = "length must be 10") 46 | private String phoneNumber; 47 | 48 | public Employer(String email, String password, String companyName, String website, String phoneNumber) { 49 | super(email, password); 50 | this.companyName = companyName; 51 | this.website = website; 52 | this.phoneNumber = phoneNumber; 53 | } 54 | 55 | 56 | @OneToMany(mappedBy = "employer") 57 | private List jobAdvertises; 58 | 59 | //@OneToMany(mappedBy = "employer") 60 | //private List denemes; 61 | 62 | 63 | 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/core/validations/PasswordConstraintValidator.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.core.validations; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | 7 | import javax.validation.ConstraintValidator; 8 | import javax.validation.ConstraintValidatorContext; 9 | 10 | import org.passay.CharacterRule; 11 | import org.passay.EnglishCharacterData; 12 | import org.passay.LengthRule; 13 | import org.passay.PasswordData; 14 | import org.passay.PasswordValidator; 15 | import org.passay.RuleResult; 16 | import org.passay.WhitespaceRule; 17 | 18 | 19 | 20 | public class PasswordConstraintValidator implements ConstraintValidator { 21 | 22 | @Override 23 | public boolean isValid(String password, ConstraintValidatorContext context) { 24 | PasswordValidator validator = new PasswordValidator(Arrays.asList( 25 | // at least 8 characters 26 | new LengthRule(8, 30), 27 | 28 | // at least one upper-case character 29 | new CharacterRule(EnglishCharacterData.UpperCase, 1), 30 | 31 | // at least one lower-case character 32 | new CharacterRule(EnglishCharacterData.LowerCase, 1), 33 | 34 | // at least one digit character 35 | new CharacterRule(EnglishCharacterData.Digit, 1), 36 | 37 | // at least one symbol (special character) 38 | new CharacterRule(EnglishCharacterData.Special, 1), 39 | 40 | // no whitespace 41 | new WhitespaceRule() 42 | 43 | )); 44 | RuleResult result = validator.validate(new PasswordData(password)); 45 | if (result.isValid()) { 46 | return true; 47 | } 48 | List messages = validator.getMessages(result); 49 | 50 | String messageTemplate = messages.stream() 51 | .collect(Collectors.joining(",")); 52 | context.buildConstraintViolationWithTemplate(messageTemplate) 53 | .addConstraintViolation() 54 | .disableDefaultConstraintViolation(); 55 | return false; 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/JobAdvertise.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | import java.time.LocalDate; 4 | import java.time.LocalDateTime; 5 | 6 | import javax.persistence.CascadeType; 7 | import javax.persistence.Column; 8 | import javax.persistence.Entity; 9 | import javax.persistence.FetchType; 10 | import javax.persistence.GeneratedValue; 11 | import javax.persistence.GenerationType; 12 | import javax.persistence.Id; 13 | import javax.persistence.JoinColumn; 14 | import javax.persistence.ManyToOne; 15 | import javax.persistence.Table; 16 | 17 | import javax.validation.constraints.NotBlank; 18 | import javax.validation.constraints.Pattern; 19 | 20 | import com.fasterxml.jackson.annotation.JsonFormat; 21 | import com.fasterxml.jackson.annotation.JsonIgnore; 22 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 23 | 24 | import lombok.AllArgsConstructor; 25 | import lombok.Data; 26 | import lombok.NoArgsConstructor; 27 | 28 | @Data 29 | @NoArgsConstructor 30 | @AllArgsConstructor 31 | @Entity 32 | @Table(name = "job_advertises") 33 | public class JobAdvertise { 34 | 35 | @Id 36 | @GeneratedValue(strategy = GenerationType.IDENTITY) 37 | @Column(name = "id") 38 | private int id; 39 | 40 | 41 | @Column(name = "min_salary") 42 | private int minSalary; 43 | 44 | 45 | @Column(name = "max_salary") 46 | private int maxSalary; 47 | 48 | @NotBlank 49 | @Column(name = "job_description") 50 | private String jobDescription; 51 | 52 | 53 | //@Pattern(regexp = "[0-9]", message = "Please write a number") 54 | @Column(name = "number_of_open_position") 55 | private int numberOfOpenPosition; 56 | 57 | 58 | @Column(name = "is_active") 59 | private boolean isActive; 60 | 61 | 62 | 63 | @Column(name = "application_deadline") 64 | private LocalDate applicationDeadline; 65 | 66 | 67 | @Column(name = "release_date") 68 | private LocalDateTime releaseDate; 69 | 70 | 71 | @JsonIgnoreProperties({ "website", "phoneNumber", "email","password" }) 72 | @ManyToOne() 73 | @JoinColumn(name = "employer_id") 74 | private Employer employer; 75 | 76 | //@JsonIgnoreProperties({ "id" }) 77 | @ManyToOne() 78 | @JoinColumn(name = "city_id") 79 | private City city; 80 | 81 | //@JsonIgnoreProperties({ "id" }) 82 | @ManyToOne() 83 | @JoinColumn(name = "jobposition_id") 84 | private Jobposition jobposition; 85 | } -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/entities/concretes/JobSeeker.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.entities.concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.OneToMany; 8 | import javax.persistence.PrimaryKeyJoinColumn; 9 | import javax.persistence.Table; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | 13 | import javax.validation.constraints.Pattern; 14 | 15 | import com.fasterxml.jackson.annotation.JsonIgnore; 16 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 17 | 18 | import kodlamaio.hrms.core.entities.User; 19 | import lombok.Data; 20 | import lombok.EqualsAndHashCode; 21 | import lombok.NoArgsConstructor; 22 | 23 | @PrimaryKeyJoinColumn(name = "user_id", referencedColumnName = "id") 24 | @Data 25 | @NoArgsConstructor 26 | @EqualsAndHashCode(callSuper = false) 27 | @Entity 28 | @Table(name = "job_seekers") 29 | 30 | 31 | 32 | public class JobSeeker extends User { 33 | 34 | @Column(name = "first_name", length = 25, nullable = false) 35 | @NotBlank 36 | 37 | private String firstName; 38 | 39 | @Column(name = "last_name", length = 25, nullable = false) 40 | @NotBlank 41 | 42 | private String lastName; 43 | 44 | @Column(name = "identity_number", length = 11, unique = true, nullable = false) 45 | @NotBlank 46 | 47 | @Pattern(regexp = "[0-9]{11}", message = "length must be 11") 48 | private String identityNumber; 49 | 50 | @Column(name = "birth_year", length = 4, nullable = false) 51 | @NotBlank 52 | @Pattern(regexp = "[0-9]{4}", message = "length must be 4") 53 | private String birthYear; 54 | 55 | public JobSeeker(String email, String password, String firstName, String lastName, String identityNumber, 56 | String birthYear) { 57 | super(email, password); 58 | this.firstName = firstName; 59 | this.lastName = lastName; 60 | this.identityNumber = identityNumber; 61 | this.birthYear = birthYear; 62 | } 63 | 64 | @OneToMany(mappedBy = "jobSeeker") 65 | //@JsonIgnore() 66 | private List workExperiences; 67 | 68 | @OneToMany(mappedBy = "jobSeeker") 69 | //@JsonIgnore() 70 | private List educations; 71 | 72 | @OneToMany(mappedBy = "jobSeeker") 73 | //@JsonIgnore() 74 | private List languages; 75 | 76 | @OneToMany(mappedBy = "jobSeeker") 77 | //@JsonIgnore() 78 | private List skills; 79 | 80 | @OneToMany(mappedBy = "jobSeeker") 81 | //@JsonIgnore() 82 | private List links; 83 | 84 | @OneToMany(mappedBy = "jobSeeker") 85 | //@JsonIgnore() 86 | private List coverLetters; 87 | 88 | @OneToMany(mappedBy = "jobSeeker") 89 | //@JsonIgnore() 90 | private List images; 91 | 92 | } -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/CoverLettersController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import javax.validation.Valid; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.http.ResponseEntity; 11 | import org.springframework.validation.FieldError; 12 | import org.springframework.web.bind.MethodArgumentNotValidException; 13 | import org.springframework.web.bind.annotation.CrossOrigin; 14 | import org.springframework.web.bind.annotation.ExceptionHandler; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.ResponseStatus; 20 | import org.springframework.web.bind.annotation.RestController; 21 | 22 | import kodlamaio.hrms.business.abstracts.CoverLetterService; 23 | import kodlamaio.hrms.core.entities.User; 24 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 25 | import kodlamaio.hrms.entities.concretes.CoverLetter; 26 | 27 | @RestController 28 | @RequestMapping("/api/cover-letters") 29 | @CrossOrigin 30 | public class CoverLettersController { 31 | 32 | private CoverLetterService coverLetterService; 33 | 34 | @Autowired 35 | public CoverLettersController(CoverLetterService coverLetterService) { 36 | super(); 37 | this.coverLetterService = coverLetterService; 38 | } 39 | 40 | @PostMapping(value = "/add") 41 | public ResponseEntity add(@Valid @RequestBody CoverLetter coverLetter) { 42 | return ResponseEntity.ok(this.coverLetterService.add(coverLetter)); 43 | } 44 | 45 | @GetMapping("/getall") 46 | public ResponseEntity getAll() { 47 | return ResponseEntity.ok(this.coverLetterService.getAll()); 48 | } 49 | 50 | @GetMapping("/getByJobSeeker") 51 | public ResponseEntity getByJobSeekerId(int jobSeekerId) { 52 | return ResponseEntity.ok(this.coverLetterService.getByJobSeekerId(jobSeekerId)); 53 | } 54 | 55 | @ExceptionHandler(MethodArgumentNotValidException.class) 56 | @ResponseStatus(HttpStatus.BAD_REQUEST) 57 | public ErrorDataResult handleValidationException(MethodArgumentNotValidException exceptions) { 58 | Map validationErrors = new HashMap(); 59 | for (FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 60 | validationErrors.put(fieldError.getField(), fieldError.getDefaultMessage()); 61 | } 62 | 63 | ErrorDataResult errors = new ErrorDataResult(validationErrors, "Doğrulama hataları"); 64 | return errors; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/LinksController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import javax.validation.Valid; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.http.ResponseEntity; 11 | import org.springframework.validation.FieldError; 12 | import org.springframework.web.bind.MethodArgumentNotValidException; 13 | import org.springframework.web.bind.annotation.CrossOrigin; 14 | import org.springframework.web.bind.annotation.ExceptionHandler; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.ResponseStatus; 20 | import org.springframework.web.bind.annotation.RestController; 21 | 22 | import kodlamaio.hrms.business.abstracts.LinkService; 23 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 24 | import kodlamaio.hrms.entities.concretes.Language; 25 | import kodlamaio.hrms.entities.concretes.Link; 26 | 27 | @RestController 28 | @RequestMapping("/api/links") 29 | @CrossOrigin 30 | public class LinksController { 31 | 32 | private LinkService linkService; 33 | 34 | @Autowired 35 | public LinksController(LinkService linkService) { 36 | super(); 37 | this.linkService = linkService; 38 | } 39 | 40 | @PostMapping(value = "/add") 41 | public ResponseEntity add(@Valid @RequestBody Link link) { 42 | return ResponseEntity.ok(this.linkService.add(link)); 43 | } 44 | 45 | @GetMapping("/getall") 46 | public ResponseEntity getAll() { 47 | return ResponseEntity.ok(this.linkService.getAll()); 48 | } 49 | 50 | @GetMapping("/getByJobSeeker") 51 | public ResponseEntity getByJobSeekerId(int jobSeekerId) { 52 | return ResponseEntity.ok(this.linkService.getByJobSeekerId(jobSeekerId)); 53 | } 54 | 55 | 56 | @ExceptionHandler(MethodArgumentNotValidException.class) 57 | @ResponseStatus(HttpStatus.BAD_REQUEST) 58 | public ErrorDataResult handleValidationException 59 | (MethodArgumentNotValidException exceptions){ 60 | Map validationErrors = new HashMap(); 61 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 62 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 63 | } 64 | 65 | ErrorDataResult errors 66 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 67 | return errors; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/SkillsController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import javax.validation.Valid; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.http.ResponseEntity; 12 | import org.springframework.validation.FieldError; 13 | import org.springframework.web.bind.MethodArgumentNotValidException; 14 | import org.springframework.web.bind.annotation.CrossOrigin; 15 | import org.springframework.web.bind.annotation.ExceptionHandler; 16 | import org.springframework.web.bind.annotation.GetMapping; 17 | import org.springframework.web.bind.annotation.PostMapping; 18 | import org.springframework.web.bind.annotation.RequestBody; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.ResponseStatus; 21 | import org.springframework.web.bind.annotation.RestController; 22 | 23 | import kodlamaio.hrms.business.abstracts.SkillService; 24 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 25 | import kodlamaio.hrms.entities.concretes.Link; 26 | import kodlamaio.hrms.entities.concretes.Skill; 27 | 28 | @RestController 29 | @RequestMapping("/api/skills") 30 | @CrossOrigin 31 | public class SkillsController { 32 | 33 | private SkillService skillService; 34 | 35 | @Autowired 36 | public SkillsController(SkillService skillService) { 37 | super(); 38 | this.skillService = skillService; 39 | } 40 | 41 | @PostMapping(value = "/add") 42 | public ResponseEntity add(@Valid @RequestBody Skill skill) { 43 | return ResponseEntity.ok(this.skillService.add(skill)); 44 | } 45 | 46 | @GetMapping("/getall") 47 | public ResponseEntity getAll() { 48 | return ResponseEntity.ok(this.skillService.getAll()); 49 | } 50 | 51 | @GetMapping("/getByJobSeeker") 52 | public ResponseEntity getByJobSeekerId(int jobSeekerId) { 53 | return ResponseEntity.ok(this.skillService.getByJobSeekerId(jobSeekerId)); 54 | } 55 | 56 | 57 | @ExceptionHandler(MethodArgumentNotValidException.class) 58 | @ResponseStatus(HttpStatus.BAD_REQUEST) 59 | public ErrorDataResult handleValidationException 60 | (MethodArgumentNotValidException exceptions){ 61 | Map validationErrors = new HashMap(); 62 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 63 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 64 | } 65 | 66 | ErrorDataResult errors 67 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 68 | return errors; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/EmployersController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import javax.validation.Valid; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.http.ResponseEntity; 11 | import org.springframework.validation.FieldError; 12 | import org.springframework.web.bind.MethodArgumentNotValidException; 13 | import org.springframework.web.bind.annotation.CrossOrigin; 14 | import org.springframework.web.bind.annotation.ExceptionHandler; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.ResponseStatus; 20 | import org.springframework.web.bind.annotation.RestController; 21 | 22 | import kodlamaio.hrms.business.abstracts.EmployerService; 23 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 24 | import kodlamaio.hrms.entities.concretes.Employer; 25 | 26 | @CrossOrigin 27 | @RestController 28 | @RequestMapping("/api/employers") 29 | 30 | public class EmployersController { 31 | 32 | private EmployerService employerService; 33 | 34 | @Autowired 35 | public EmployersController(EmployerService employerService) { 36 | super(); 37 | this.employerService = employerService; 38 | } 39 | 40 | @GetMapping("/getall") 41 | public ResponseEntity getAll() { 42 | return ResponseEntity.ok( this.employerService.getAll()); 43 | } 44 | 45 | @PostMapping("/add") 46 | public ResponseEntity add(@Valid @RequestBody Employer employer) { 47 | return ResponseEntity.ok( this.employerService.add(employer)); 48 | } 49 | 50 | 51 | @ExceptionHandler(MethodArgumentNotValidException.class) //sistemde şu türden bir hata olursa MethodArgumentNotValidException 52 | @ResponseStatus(HttpStatus.BAD_REQUEST) //bad request olarak sarmalla 53 | public ErrorDataResult handleValidationException 54 | (MethodArgumentNotValidException exceptions){ 55 | Map validationErrors = new HashMap(); // hash map yani dictionary oluştur 56 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { //bütün hataları gez o dictionary i ekle 57 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 58 | } 59 | 60 | ErrorDataResult errors //errordataresult ın içine koy 61 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 62 | return errors; //ve bu hataları döndür 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/LanguagesController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import javax.validation.Valid; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.http.ResponseEntity; 11 | import org.springframework.validation.FieldError; 12 | import org.springframework.web.bind.MethodArgumentNotValidException; 13 | import org.springframework.web.bind.annotation.CrossOrigin; 14 | import org.springframework.web.bind.annotation.ExceptionHandler; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.ResponseStatus; 20 | import org.springframework.web.bind.annotation.RestController; 21 | 22 | import kodlamaio.hrms.business.abstracts.LanguageService; 23 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 24 | import kodlamaio.hrms.entities.concretes.CoverLetter; 25 | import kodlamaio.hrms.entities.concretes.Language; 26 | 27 | 28 | @RestController 29 | @RequestMapping("/api/languages") 30 | @CrossOrigin 31 | public class LanguagesController { 32 | 33 | private LanguageService languageService; 34 | 35 | @Autowired 36 | public LanguagesController(LanguageService languageService) { 37 | super(); 38 | this.languageService = languageService; 39 | } 40 | 41 | @PostMapping(value = "/add") 42 | public ResponseEntity add(@Valid @RequestBody Language language) { 43 | return ResponseEntity.ok(this.languageService.add(language)); 44 | } 45 | 46 | @GetMapping("/getall") 47 | public ResponseEntity getAll() { 48 | return ResponseEntity.ok(this.languageService.getAll()); 49 | } 50 | 51 | @GetMapping("/getByJobSeeker") 52 | public ResponseEntity getByJobSeekerId(int jobSeekerId) { 53 | return ResponseEntity.ok(this.languageService.getByJobSeekerId(jobSeekerId)); 54 | } 55 | 56 | 57 | @ExceptionHandler(MethodArgumentNotValidException.class) 58 | @ResponseStatus(HttpStatus.BAD_REQUEST) 59 | public ErrorDataResult handleValidationException 60 | (MethodArgumentNotValidException exceptions){ 61 | Map validationErrors = new HashMap(); 62 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 63 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 64 | } 65 | 66 | ErrorDataResult errors 67 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 68 | return errors; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/UsersController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import javax.validation.Valid; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.validation.FieldError; 11 | import org.springframework.web.bind.MethodArgumentNotValidException; 12 | import org.springframework.web.bind.annotation.CrossOrigin; 13 | import org.springframework.web.bind.annotation.ExceptionHandler; 14 | import org.springframework.web.bind.annotation.GetMapping; 15 | import org.springframework.web.bind.annotation.PostMapping; 16 | import org.springframework.web.bind.annotation.RequestBody; 17 | import org.springframework.web.bind.annotation.RequestMapping; 18 | import org.springframework.web.bind.annotation.ResponseStatus; 19 | import org.springframework.web.bind.annotation.RestController; 20 | 21 | import kodlamaio.hrms.business.abstracts.UserService; 22 | import kodlamaio.hrms.core.entities.User; 23 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 24 | 25 | @CrossOrigin 26 | @RestController 27 | @RequestMapping(value = "/api/users") 28 | public class UsersController { 29 | 30 | private UserService userService; 31 | 32 | @Autowired 33 | public UsersController(UserService userService) { 34 | super(); 35 | this.userService = userService; 36 | } 37 | 38 | @PostMapping(value = "/add") 39 | public ResponseEntity add(@Valid @RequestBody User user) { 40 | return ResponseEntity.ok(this.userService.add(user)); 41 | } 42 | 43 | @GetMapping(value = "/getall") 44 | public ResponseEntity getAll(){ 45 | return ResponseEntity.ok(this.userService.getAll()); 46 | } 47 | 48 | @GetMapping(value = "/getbyemail") 49 | public ResponseEntity findByEmail(String email){ 50 | return ResponseEntity.ok(this.userService.findByEmail(email)); 51 | } 52 | 53 | @ExceptionHandler(MethodArgumentNotValidException.class) //sistemde şu türden bir hata olursa MethodArgumentNotValidException 54 | @ResponseStatus(HttpStatus.BAD_REQUEST) //bad request olarak sarmalla 55 | public ErrorDataResult handleValidationException 56 | (MethodArgumentNotValidException exceptions){ 57 | Map validationErrors = new HashMap(); // hash map yani dictionary oluştur 58 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { //bütün hataları gez o dictionary i ekle 59 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 60 | } 61 | 62 | ErrorDataResult errors //errordataresult ın içine koy 63 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 64 | return errors; //ve bu hataları döndür 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/SystemPersonnelsController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import javax.validation.Valid; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.validation.FieldError; 12 | import org.springframework.web.bind.MethodArgumentNotValidException; 13 | import org.springframework.web.bind.annotation.CrossOrigin; 14 | import org.springframework.web.bind.annotation.ExceptionHandler; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.ResponseStatus; 20 | import org.springframework.web.bind.annotation.RestController; 21 | 22 | import kodlamaio.hrms.business.abstracts.SystemPersonnelService; 23 | import kodlamaio.hrms.core.utilities.results.DataResult; 24 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 25 | import kodlamaio.hrms.core.utilities.results.Result; 26 | import kodlamaio.hrms.entities.concretes.SystemPersonnel; 27 | 28 | @CrossOrigin 29 | @RestController 30 | @RequestMapping("/api/system-personnels") 31 | public class SystemPersonnelsController { 32 | 33 | private SystemPersonnelService systemPersonnelService; 34 | @Autowired 35 | public SystemPersonnelsController(SystemPersonnelService systemPersonnelService) { 36 | super(); 37 | this.systemPersonnelService = systemPersonnelService; 38 | } 39 | 40 | @GetMapping("/getall") 41 | public DataResult> getAll() { 42 | return this.systemPersonnelService.getAll(); 43 | 44 | } 45 | 46 | @PostMapping("/add") 47 | public Result add(@Valid @RequestBody SystemPersonnel systemPersonnel) { 48 | return this.systemPersonnelService.add(systemPersonnel); 49 | } 50 | 51 | 52 | @ExceptionHandler(MethodArgumentNotValidException.class) //sistemde şu türden bir hata olursa MethodArgumentNotValidException 53 | @ResponseStatus(HttpStatus.BAD_REQUEST) //bad request olarak sarmalla 54 | public ErrorDataResult handleValidationException 55 | (MethodArgumentNotValidException exceptions){ 56 | Map validationErrors = new HashMap(); // hash map yani dictionary oluştur 57 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { //bütün hataları gez o dictionary i ekle 58 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 59 | } 60 | 61 | ErrorDataResult errors //errordataresult ın içine koy 62 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 63 | return errors; //ve bu hataları döndür 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/JobSeekersController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import javax.validation.Valid; 8 | 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.http.ResponseEntity; 11 | 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.validation.FieldError; 14 | import org.springframework.web.bind.MethodArgumentNotValidException; 15 | import org.springframework.web.bind.annotation.CrossOrigin; 16 | import org.springframework.web.bind.annotation.ExceptionHandler; 17 | import org.springframework.web.bind.annotation.GetMapping; 18 | import org.springframework.web.bind.annotation.PostMapping; 19 | import org.springframework.web.bind.annotation.RequestBody; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | import org.springframework.web.bind.annotation.ResponseStatus; 22 | import org.springframework.web.bind.annotation.RestController; 23 | 24 | import kodlamaio.hrms.business.abstracts.JobSeekerService; 25 | import kodlamaio.hrms.core.adapters.UserValidationService; 26 | import kodlamaio.hrms.core.utilities.results.DataResult; 27 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 28 | import kodlamaio.hrms.core.utilities.results.Result; 29 | import kodlamaio.hrms.entities.concretes.JobSeeker; 30 | 31 | @CrossOrigin 32 | @RestController 33 | @RequestMapping("/api/job-seekers") 34 | public class JobSeekersController { 35 | 36 | private JobSeekerService jobSeekerService; 37 | 38 | 39 | @Autowired 40 | public JobSeekersController(JobSeekerService jobSeekerService) { 41 | super(); 42 | this.jobSeekerService = jobSeekerService; 43 | 44 | } 45 | 46 | @GetMapping("/getall") 47 | public ResponseEntity getAll() { 48 | return ResponseEntity.ok( this.jobSeekerService.getAll()); 49 | } 50 | 51 | @PostMapping("/add") 52 | public ResponseEntity add(@Valid @RequestBody JobSeeker jobSeeker) { 53 | return ResponseEntity.ok( this.jobSeekerService.add(jobSeeker)); 54 | } 55 | 56 | @GetMapping("/getresume") 57 | public ResponseEntity getResume(int jobSeekerId){ 58 | return ResponseEntity.ok( this.jobSeekerService.getResumeByJobSeekerId(jobSeekerId)); 59 | } 60 | 61 | @ExceptionHandler(MethodArgumentNotValidException.class) //sistemde şu türden bir hata olursa MethodArgumentNotValidException 62 | @ResponseStatus(HttpStatus.BAD_REQUEST) //bad request olarak sarmalla 63 | public ErrorDataResult handleValidationException 64 | (MethodArgumentNotValidException exceptions){ 65 | Map validationErrors = new HashMap(); // hash map yani dictionary oluştur 66 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { //bütün hataları gez o dictionary i ekle 67 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 68 | } 69 | 70 | ErrorDataResult errors //errordataresult ın içine koy 71 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 72 | return errors; //ve bu hataları döndür 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/WorkExperiencesController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import javax.validation.Valid; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.http.ResponseEntity; 11 | import org.springframework.validation.FieldError; 12 | import org.springframework.web.bind.MethodArgumentNotValidException; 13 | import org.springframework.web.bind.annotation.CrossOrigin; 14 | import org.springframework.web.bind.annotation.ExceptionHandler; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.ResponseStatus; 20 | import org.springframework.web.bind.annotation.RestController; 21 | 22 | import kodlamaio.hrms.business.abstracts.WorkExperienceService; 23 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 24 | import kodlamaio.hrms.entities.concretes.Employer; 25 | import kodlamaio.hrms.entities.concretes.WorkExperience; 26 | 27 | @RestController 28 | @RequestMapping("/api/workExperiences") 29 | @CrossOrigin 30 | public class WorkExperiencesController { 31 | 32 | 33 | private WorkExperienceService workExperienceService; 34 | 35 | @Autowired 36 | public WorkExperiencesController(WorkExperienceService workExperienceService) { 37 | super(); 38 | this.workExperienceService = workExperienceService; 39 | } 40 | 41 | @PostMapping("/add") 42 | public ResponseEntity add(@Valid @RequestBody WorkExperience workExperience) { 43 | return ResponseEntity.ok( this.workExperienceService.add(workExperience)); 44 | } 45 | 46 | @GetMapping("/getall") 47 | public ResponseEntity getAll() { 48 | return ResponseEntity.ok( this.workExperienceService.getAll()); 49 | } 50 | 51 | 52 | @GetMapping("/getAllByJobseekerIdOrderByEndDesc") 53 | public ResponseEntity getAllByJobseekerIdOrderByDateOfEndDesc(int jobSeekerId) { 54 | return ResponseEntity.ok( this.workExperienceService.getAllByJobSeekerIdOrderByDateOfEndDesc(jobSeekerId)); 55 | } 56 | 57 | @GetMapping("/getAllByJobseekerId") 58 | public ResponseEntity getAllByJobSeekerId(int id) { 59 | return ResponseEntity.ok( this.workExperienceService.getAllByJobSeekerId(id)); 60 | } 61 | 62 | 63 | @ExceptionHandler(MethodArgumentNotValidException.class) 64 | @ResponseStatus(HttpStatus.BAD_REQUEST) 65 | public ErrorDataResult handleValidationException 66 | (MethodArgumentNotValidException exceptions){ 67 | Map validationErrors = new HashMap(); 68 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 69 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 70 | } 71 | 72 | ErrorDataResult errors 73 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 74 | return errors; 75 | } 76 | } 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/JobAdvertiseManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.business.concretes; 2 | 3 | import java.sql.Date; 4 | import java.time.LocalDate; 5 | import java.time.LocalDateTime; 6 | import java.util.List; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import kodlamaio.hrms.business.abstracts.JobAdvertiseService; 12 | import kodlamaio.hrms.core.utilities.results.DataResult; 13 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 14 | import kodlamaio.hrms.core.utilities.results.Result; 15 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 16 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 17 | import kodlamaio.hrms.dataAccess.abstracts.JobAdvertiseDao; 18 | import kodlamaio.hrms.entities.concretes.JobAdvertise; 19 | 20 | 21 | @Service 22 | public class JobAdvertiseManager implements JobAdvertiseService { 23 | 24 | private JobAdvertiseDao jobAdvertiseDao; 25 | 26 | @Autowired 27 | public JobAdvertiseManager(JobAdvertiseDao jobAdvertisetDao) { 28 | super(); 29 | this.jobAdvertiseDao = jobAdvertisetDao; 30 | } 31 | 32 | @Override 33 | public Result add(JobAdvertise jobAdvertise) { 34 | jobAdvertise.setReleaseDate(LocalDateTime.now()); 35 | this.jobAdvertiseDao.save(jobAdvertise); 36 | return new SuccessResult("Data eklendi"); 37 | } 38 | 39 | @Override 40 | public DataResult> getAll() { 41 | return new SuccessDataResult>(this.jobAdvertiseDao.findAll(),"Data listendi"); 42 | } 43 | 44 | @Override 45 | public DataResult> getAllActiveJobAdvertiseByEmployer(int id) { 46 | return new SuccessDataResult>(this.jobAdvertiseDao.getAllActiveJobAdvertiseByEmployer(id)); 47 | } 48 | 49 | 50 | @Override 51 | public DataResult> getByIsActiveTrue() { 52 | return new SuccessDataResult>(this.jobAdvertiseDao.getByIsActiveTrue(),"Data aktif"); 53 | } 54 | // 55 | // @Override 56 | // public DataResult> getByEmployerId(int id) { 57 | // return new SuccessDataResult>(this.jobAdvertiseDao.getByEmployerId(id),"Okay"); 58 | // } 59 | 60 | 61 | @Override 62 | public DataResult changeStatus(int employerId, int jobAdvertiseId, boolean status) { 63 | List jobAdvertises = this.jobAdvertiseDao.getByEmployerId(employerId); 64 | 65 | for (JobAdvertise jobAdvertise : jobAdvertises) { 66 | if (jobAdvertiseId == jobAdvertise.getId()) { 67 | jobAdvertise.setActive(status); 68 | this.jobAdvertiseDao.save(jobAdvertise); 69 | return new SuccessDataResult(this.jobAdvertiseDao.getById(jobAdvertiseId)); 70 | } 71 | } 72 | 73 | return new ErrorDataResult(); 74 | } 75 | 76 | @Override 77 | public DataResult> getAllByOrderByReleaseDate() { 78 | return new SuccessDataResult>(this.jobAdvertiseDao.getAllByOrderByReleaseDateDesc()); 79 | } 80 | 81 | @Override 82 | public DataResult> getAllByOrderByApplicationDeadline() { 83 | return new SuccessDataResult>(this.jobAdvertiseDao.getAllByOrderByApplicationDeadlineDesc()); 84 | } 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /hrms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.5.0 10 | 11 | 12 | kodlamaio 13 | hrms 14 | 0.0.1-SNAPSHOT 15 | hrms 16 | Demo project for Spring Boot 17 | 18 | 11 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-data-jpa 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-devtools 33 | runtime 34 | true 35 | 36 | 37 | org.postgresql 38 | postgresql 39 | runtime 40 | 41 | 42 | org.projectlombok 43 | lombok 44 | true 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-starter-test 49 | test 50 | 51 | 52 | io.springfox 53 | springfox-swagger2 54 | 2.9.2 55 | 56 | 57 | io.springfox 58 | springfox-swagger-ui 59 | 2.9.2 60 | 61 | 62 | org.springframework.boot 63 | spring-boot-starter-validation 64 | 65 | 66 | org.passay 67 | passay 68 | 1.6.0 69 | 70 | 71 | 72 | org.modelmapper 73 | modelmapper 74 | 2.3.5 75 | 76 | 77 | 78 | com.sun.xml.ws 79 | jaxws-rt 80 | 3.0.1 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | org.springframework.boot 89 | spring-boot-maven-plugin 90 | 91 | 92 | 93 | org.projectlombok 94 | lombok 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/EducationsController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import javax.validation.Valid; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.http.ResponseEntity; 12 | import org.springframework.validation.FieldError; 13 | import org.springframework.web.bind.MethodArgumentNotValidException; 14 | import org.springframework.web.bind.annotation.CrossOrigin; 15 | import org.springframework.web.bind.annotation.ExceptionHandler; 16 | import org.springframework.web.bind.annotation.GetMapping; 17 | import org.springframework.web.bind.annotation.PostMapping; 18 | import org.springframework.web.bind.annotation.RequestBody; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.ResponseStatus; 21 | import org.springframework.web.bind.annotation.RestController; 22 | 23 | import kodlamaio.hrms.business.abstracts.EducationService; 24 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 25 | import kodlamaio.hrms.entities.concretes.Education; 26 | import kodlamaio.hrms.entities.concretes.WorkExperience; 27 | 28 | @RestController 29 | @RequestMapping("/api/educations") 30 | @CrossOrigin 31 | public class EducationsController { 32 | 33 | 34 | private EducationService educationService; 35 | 36 | @Autowired 37 | public EducationsController(EducationService educationService) { 38 | super(); 39 | this.educationService = educationService; 40 | } 41 | 42 | @PostMapping("/add") 43 | public ResponseEntity add(@Valid @RequestBody Education education) { 44 | return ResponseEntity.ok( this.educationService.add(education)); 45 | } 46 | 47 | @GetMapping("/getall") 48 | public ResponseEntity getAll() { 49 | return ResponseEntity.ok( this.educationService.getAll()); 50 | } 51 | 52 | 53 | @GetMapping("/getAllByJobseekerIdOrderByGraduationDateDesc") 54 | public ResponseEntity getAllByJobseekerIdOrderByGraduationDateDesc(int jobSeekerId) { 55 | return ResponseEntity.ok( this.educationService.getAllByJobSeekerIdOrderByGraduationDateDesc(jobSeekerId)); 56 | } 57 | 58 | @GetMapping("/getAllByJobseekerId") 59 | public ResponseEntity getAllByJobseekerId(int id) { 60 | return ResponseEntity.ok( this.educationService.getAllByJobSeekerId(id)); 61 | } 62 | 63 | // @GetMapping("/getDESCOrderByGraduationDate") 64 | // public ResponseEntity getDESCOrderByGraduationDate(int jobSeekerId){ 65 | // return ResponseEntity.ok(this.educationService.getByJobSeekerIdOrderByGraduationDateDESC(jobSeekerId)); 66 | // } 67 | // 68 | 69 | @ExceptionHandler(MethodArgumentNotValidException.class) 70 | @ResponseStatus(HttpStatus.BAD_REQUEST) 71 | public ErrorDataResult handleValidationException 72 | (MethodArgumentNotValidException exceptions){ 73 | Map validationErrors = new HashMap(); 74 | for(FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 75 | validationErrors.put(fieldError.getField(),fieldError.getDefaultMessage()); 76 | } 77 | 78 | ErrorDataResult errors 79 | = new ErrorDataResult(validationErrors,"Doğrulama hataları"); 80 | return errors; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/api/controllers/JobAdvertisesController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.hrms.api.controllers; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import javax.validation.Valid; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.http.ResponseEntity; 12 | import org.springframework.validation.FieldError; 13 | import org.springframework.web.bind.MethodArgumentNotValidException; 14 | import org.springframework.web.bind.annotation.CrossOrigin; 15 | import org.springframework.web.bind.annotation.ExceptionHandler; 16 | import org.springframework.web.bind.annotation.GetMapping; 17 | import org.springframework.web.bind.annotation.PostMapping; 18 | import org.springframework.web.bind.annotation.RequestBody; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.RequestParam; 21 | import org.springframework.web.bind.annotation.ResponseStatus; 22 | import org.springframework.web.bind.annotation.RestController; 23 | 24 | import kodlamaio.hrms.business.abstracts.JobAdvertiseService; 25 | import kodlamaio.hrms.core.utilities.results.DataResult; 26 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult; 27 | import kodlamaio.hrms.core.utilities.results.Result; 28 | import kodlamaio.hrms.entities.concretes.JobAdvertise; 29 | import kodlamaio.hrms.entities.concretes.JobSeeker; 30 | 31 | @CrossOrigin 32 | @RestController 33 | @RequestMapping("/api/job-advertises") 34 | public class JobAdvertisesController { 35 | 36 | private JobAdvertiseService jobAdvertiseService; 37 | 38 | @Autowired 39 | public JobAdvertisesController(JobAdvertiseService jobAdvertiseService) { 40 | super(); 41 | this.jobAdvertiseService = jobAdvertiseService; 42 | } 43 | 44 | 45 | @PostMapping("/add") 46 | public ResponseEntity add(@Valid @RequestBody JobAdvertise jobAdvertise) { 47 | return ResponseEntity.ok(this.jobAdvertiseService.add(jobAdvertise)); 48 | } 49 | 50 | @GetMapping("/getall") 51 | public ResponseEntity getAll() { 52 | return ResponseEntity.ok(this.jobAdvertiseService.getAll()); 53 | } 54 | 55 | @GetMapping("/get-all-active-job-advertise-by-employer") 56 | public ResponseEntitygetAllActiveJobAdvertiseByEmployer(@RequestParam int id){ 57 | return ResponseEntity.ok(this.jobAdvertiseService.getAllActiveJobAdvertiseByEmployer(id)); 58 | } 59 | 60 | @GetMapping("/getByActive") 61 | public ResponseEntity getByIsActiveTrue() { 62 | return ResponseEntity.ok(this.jobAdvertiseService.getByIsActiveTrue()); 63 | } 64 | 65 | 66 | 67 | @GetMapping("/changeStatus") 68 | public ResponseEntity changeStatus(@RequestParam int employerId, @RequestParam int announcementId, 69 | @RequestParam boolean status) { 70 | return ResponseEntity.ok(this.jobAdvertiseService.changeStatus(employerId, announcementId, status)); 71 | } 72 | 73 | @GetMapping("/getAllByOrderByReleaseDate") 74 | public ResponseEntity getAllByOrderByReleaseDate() { 75 | return ResponseEntity.ok(this.jobAdvertiseService.getAllByOrderByReleaseDate()); 76 | } 77 | 78 | @GetMapping("/getAllByOrderByApplicationDeadline") 79 | public ResponseEntity getAllByOrderByApplicationDeadline() { 80 | return ResponseEntity.ok(this.jobAdvertiseService.getAllByOrderByApplicationDeadline()); 81 | } 82 | 83 | @ExceptionHandler(MethodArgumentNotValidException.class) 84 | 85 | public ErrorDataResult handleValidationException(MethodArgumentNotValidException exceptions) { 86 | Map validationErrors = new HashMap(); 87 | for (FieldError fieldError : exceptions.getBindingResult().getFieldErrors()) { 88 | 89 | validationErrors.put(fieldError.getField(), fieldError.getDefaultMessage()); 90 | } 91 | 92 | ErrorDataResult errors = new ErrorDataResult(validationErrors, "Doğrulama hataları"); 93 | return errors; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /hrms/src/main/java/kodlamaio/hrms/business/concretes/JobSeekerManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.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 kodlamaio.hrms.business.abstracts.CoverLetterService; 9 | import kodlamaio.hrms.business.abstracts.EducationService; 10 | import kodlamaio.hrms.business.abstracts.ImageService; 11 | import kodlamaio.hrms.business.abstracts.JobSeekerService; 12 | import kodlamaio.hrms.business.abstracts.LanguageService; 13 | import kodlamaio.hrms.business.abstracts.LinkService; 14 | import kodlamaio.hrms.business.abstracts.SkillService; 15 | import kodlamaio.hrms.business.abstracts.WorkExperienceService; 16 | import kodlamaio.hrms.core.adapters.UserValidationService; 17 | import kodlamaio.hrms.core.utilities.results.DataResult; 18 | import kodlamaio.hrms.core.utilities.results.ErrorResult; 19 | import kodlamaio.hrms.core.utilities.results.Result; 20 | import kodlamaio.hrms.core.utilities.results.SuccessDataResult; 21 | import kodlamaio.hrms.core.utilities.results.SuccessResult; 22 | import kodlamaio.hrms.dataAccess.abstracts.JobSeekerDao; 23 | import kodlamaio.hrms.entities.concretes.JobSeeker; 24 | import kodlamaio.hrms.entities.dtos.ResumeDto; 25 | import net.bytebuddy.asm.Advice.This; 26 | 27 | @Service 28 | public class JobSeekerManager implements JobSeekerService { 29 | 30 | private JobSeekerDao jobSeekerDao; 31 | private UserValidationService validationService; 32 | // private ImageService imageService; 33 | private LanguageService languageService; 34 | private LinkService linkService; 35 | private SkillService skillService; 36 | private EducationService educationService; 37 | private WorkExperienceService workExperienceService; 38 | private CoverLetterService coverLetterService; 39 | 40 | @Autowired 41 | public JobSeekerManager(JobSeekerDao jobSeekerDao, UserValidationService validationService, 42 | LanguageService languageService, LinkService linkService, SkillService skillService, 43 | EducationService educationService, WorkExperienceService workExperienceService, 44 | CoverLetterService coverLetterService 45 | 46 | ) { 47 | super(); 48 | this.validationService = validationService; 49 | this.jobSeekerDao = jobSeekerDao; 50 | this.languageService = languageService; 51 | this.linkService = linkService; 52 | this.skillService = skillService; 53 | this.educationService = educationService; 54 | this.workExperienceService = workExperienceService; 55 | this.coverLetterService = coverLetterService; 56 | } 57 | 58 | @Override 59 | public Result add(JobSeeker jobSeeker) { 60 | if (this.validationService.fakeValidation(jobSeeker)) { 61 | this.jobSeekerDao.save(jobSeeker); 62 | return new SuccessResult("Kayıt oluşturuldu"); 63 | } 64 | return new ErrorResult("Islem basarisiz"); 65 | } 66 | 67 | @Override 68 | public DataResult> getAll() { 69 | return new SuccessDataResult>(this.jobSeekerDao.findAll(), "Data listelendi"); 70 | } 71 | 72 | @Override 73 | public DataResult getResumeByJobSeekerId(int jobSeekerId) { 74 | ResumeDto resume = new ResumeDto(); 75 | resume.setJobSeeker(this.getById(jobSeekerId).getData()); 76 | resume.setLanguages(this.languageService.getByJobSeekerId(jobSeekerId).getData()); 77 | resume.setLinks(this.linkService.getByJobSeekerId(jobSeekerId).getData()); 78 | resume.setSkills(this.skillService.getByJobSeekerId(jobSeekerId).getData()); 79 | resume.setEducations(this.educationService.getAllByJobSeekerIdOrderByGraduationDateDesc(jobSeekerId).getData()); 80 | resume.setWorkExperiences(this.workExperienceService.getAllByJobSeekerIdOrderByDateOfEndDesc(jobSeekerId).getData()); 81 | resume.setCoverLetters(this.coverLetterService.getByJobSeekerId(jobSeekerId).getData()); 82 | return new SuccessDataResult<>(resume, "Data listelendi."); 83 | } 84 | 85 | @Override 86 | public DataResult getById(int id) { 87 | return new SuccessDataResult(this.jobSeekerDao.getById(id)); 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /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/src/main/java/tr/gov/nvi/tckimlik/WS/KPSPublicLocator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublicLocator.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public class KPSPublicLocator extends org.apache.axis.client.Service implements tr.gov.nvi.tckimlik.WS.KPSPublic { 11 | 12 | public KPSPublicLocator() { 13 | } 14 | 15 | 16 | public KPSPublicLocator(org.apache.axis.EngineConfiguration config) { 17 | super(config); 18 | } 19 | 20 | public KPSPublicLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { 21 | super(wsdlLoc, sName); 22 | } 23 | 24 | // Use to get a proxy class for KPSPublicSoap 25 | private java.lang.String KPSPublicSoap_address = "https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx"; 26 | 27 | public java.lang.String getKPSPublicSoapAddress() { 28 | return KPSPublicSoap_address; 29 | } 30 | 31 | // The WSDD service name defaults to the port name. 32 | private java.lang.String KPSPublicSoapWSDDServiceName = "KPSPublicSoap"; 33 | 34 | public java.lang.String getKPSPublicSoapWSDDServiceName() { 35 | return KPSPublicSoapWSDDServiceName; 36 | } 37 | 38 | public void setKPSPublicSoapWSDDServiceName(java.lang.String name) { 39 | KPSPublicSoapWSDDServiceName = name; 40 | } 41 | 42 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap() throws javax.xml.rpc.ServiceException { 43 | java.net.URL endpoint; 44 | try { 45 | endpoint = new java.net.URL(KPSPublicSoap_address); 46 | } 47 | catch (java.net.MalformedURLException e) { 48 | throw new javax.xml.rpc.ServiceException(e); 49 | } 50 | return getKPSPublicSoap(endpoint); 51 | } 52 | 53 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { 54 | try { 55 | tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub _stub = new tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub(portAddress, this); 56 | _stub.setPortName(getKPSPublicSoapWSDDServiceName()); 57 | return _stub; 58 | } 59 | catch (org.apache.axis.AxisFault e) { 60 | return null; 61 | } 62 | } 63 | 64 | public void setKPSPublicSoapEndpointAddress(java.lang.String address) { 65 | KPSPublicSoap_address = address; 66 | } 67 | 68 | /** 69 | * For the given interface, get the stub implementation. 70 | * If this service has no port for the given interface, 71 | * then ServiceException is thrown. 72 | */ 73 | public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { 74 | try { 75 | if (tr.gov.nvi.tckimlik.WS.KPSPublicSoap.class.isAssignableFrom(serviceEndpointInterface)) { 76 | tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub _stub = new tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub(new java.net.URL(KPSPublicSoap_address), this); 77 | _stub.setPortName(getKPSPublicSoapWSDDServiceName()); 78 | return _stub; 79 | } 80 | } 81 | catch (java.lang.Throwable t) { 82 | throw new javax.xml.rpc.ServiceException(t); 83 | } 84 | throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); 85 | } 86 | 87 | /** 88 | * For the given interface, get the stub implementation. 89 | * If this service has no port for the given interface, 90 | * then ServiceException is thrown. 91 | */ 92 | public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { 93 | if (portName == null) { 94 | return getPort(serviceEndpointInterface); 95 | } 96 | java.lang.String inputPortName = portName.getLocalPart(); 97 | if ("KPSPublicSoap".equals(inputPortName)) { 98 | return getKPSPublicSoap(); 99 | } 100 | else { 101 | java.rmi.Remote _stub = getPort(serviceEndpointInterface); 102 | ((org.apache.axis.client.Stub) _stub).setPortName(portName); 103 | return _stub; 104 | } 105 | } 106 | 107 | public javax.xml.namespace.QName getServiceName() { 108 | return new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "KPSPublic"); 109 | } 110 | 111 | private java.util.HashSet ports = null; 112 | 113 | public java.util.Iterator getPorts() { 114 | if (ports == null) { 115 | ports = new java.util.HashSet(); 116 | ports.add(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "KPSPublicSoap")); 117 | } 118 | return ports.iterator(); 119 | } 120 | 121 | /** 122 | * Set the endpoint address for the specified port name. 123 | */ 124 | public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { 125 | 126 | if ("KPSPublicSoap".equals(portName)) { 127 | setKPSPublicSoapEndpointAddress(address); 128 | } 129 | else 130 | { // Unknown Port Name 131 | throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); 132 | } 133 | } 134 | 135 | /** 136 | * Set the endpoint address for the specified port name. 137 | */ 138 | public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { 139 | setEndpointAddress(portName.getLocalPart(), address); 140 | } 141 | 142 | } 143 | -------------------------------------------------------------------------------- /hrms/src/main/java/tr/gov/nvi/tckimlik/WS/KPSPublicSoapStub.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublicSoapStub.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public class KPSPublicSoapStub extends org.apache.axis.client.Stub implements tr.gov.nvi.tckimlik.WS.KPSPublicSoap { 11 | private java.util.Vector cachedSerClasses = new java.util.Vector(); 12 | private java.util.Vector cachedSerQNames = new java.util.Vector(); 13 | private java.util.Vector cachedSerFactories = new java.util.Vector(); 14 | private java.util.Vector cachedDeserFactories = new java.util.Vector(); 15 | 16 | static org.apache.axis.description.OperationDesc [] _operations; 17 | 18 | static { 19 | _operations = new org.apache.axis.description.OperationDesc[1]; 20 | _initOperationDesc1(); 21 | } 22 | 23 | private static void _initOperationDesc1(){ 24 | org.apache.axis.description.OperationDesc oper; 25 | org.apache.axis.description.ParameterDesc param; 26 | oper = new org.apache.axis.description.OperationDesc(); 27 | oper.setName("TCKimlikNoDogrula"); 28 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "TCKimlikNo"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); 29 | oper.addParameter(param); 30 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "Ad"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); 31 | param.setOmittable(true); 32 | oper.addParameter(param); 33 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "Soyad"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); 34 | param.setOmittable(true); 35 | oper.addParameter(param); 36 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "DogumYili"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); 37 | oper.addParameter(param); 38 | oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); 39 | oper.setReturnClass(boolean.class); 40 | oper.setReturnQName(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "TCKimlikNoDogrulaResult")); 41 | oper.setStyle(org.apache.axis.constants.Style.WRAPPED); 42 | oper.setUse(org.apache.axis.constants.Use.LITERAL); 43 | _operations[0] = oper; 44 | 45 | } 46 | 47 | public KPSPublicSoapStub() throws org.apache.axis.AxisFault { 48 | this(null); 49 | } 50 | 51 | public KPSPublicSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { 52 | this(service); 53 | super.cachedEndpoint = endpointURL; 54 | } 55 | 56 | public KPSPublicSoapStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { 57 | if (service == null) { 58 | super.service = new org.apache.axis.client.Service(); 59 | } else { 60 | super.service = service; 61 | } 62 | ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); 63 | } 64 | 65 | protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { 66 | try { 67 | org.apache.axis.client.Call _call = super._createCall(); 68 | if (super.maintainSessionSet) { 69 | _call.setMaintainSession(super.maintainSession); 70 | } 71 | if (super.cachedUsername != null) { 72 | _call.setUsername(super.cachedUsername); 73 | } 74 | if (super.cachedPassword != null) { 75 | _call.setPassword(super.cachedPassword); 76 | } 77 | if (super.cachedEndpoint != null) { 78 | _call.setTargetEndpointAddress(super.cachedEndpoint); 79 | } 80 | if (super.cachedTimeout != null) { 81 | _call.setTimeout(super.cachedTimeout); 82 | } 83 | if (super.cachedPortName != null) { 84 | _call.setPortName(super.cachedPortName); 85 | } 86 | java.util.Enumeration keys = super.cachedProperties.keys(); 87 | while (keys.hasMoreElements()) { 88 | java.lang.String key = (java.lang.String) keys.nextElement(); 89 | _call.setProperty(key, super.cachedProperties.get(key)); 90 | } 91 | return _call; 92 | } 93 | catch (java.lang.Throwable _t) { 94 | throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); 95 | } 96 | } 97 | 98 | public boolean TCKimlikNoDogrula(long TCKimlikNo, java.lang.String ad, java.lang.String soyad, int dogumYili) throws java.rmi.RemoteException { 99 | if (super.cachedEndpoint == null) { 100 | throw new org.apache.axis.NoEndPointException(); 101 | } 102 | org.apache.axis.client.Call _call = createCall(); 103 | _call.setOperation(_operations[0]); 104 | _call.setUseSOAPAction(true); 105 | _call.setSOAPActionURI("http://tckimlik.nvi.gov.tr/WS/TCKimlikNoDogrula"); 106 | _call.setEncodingStyle(null); 107 | _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); 108 | _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); 109 | _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); 110 | _call.setOperationName(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "TCKimlikNoDogrula")); 111 | 112 | setRequestHeaders(_call); 113 | setAttachments(_call); 114 | try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(TCKimlikNo), ad, soyad, new java.lang.Integer(dogumYili)}); 115 | 116 | if (_resp instanceof java.rmi.RemoteException) { 117 | throw (java.rmi.RemoteException)_resp; 118 | } 119 | else { 120 | extractAttachments(_call); 121 | try { 122 | return ((java.lang.Boolean) _resp).booleanValue(); 123 | } catch (java.lang.Exception _exception) { 124 | return ((java.lang.Boolean) org.apache.axis.utils.JavaUtils.convert(_resp, boolean.class)).booleanValue(); 125 | } 126 | } 127 | } catch (org.apache.axis.AxisFault axisFaultException) { 128 | throw axisFaultException; 129 | } 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------