├── .gitignore
├── .mvn
└── wrapper
│ ├── MavenWrapperDownloader.java
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── README.md
├── mvnw
├── mvnw.cmd
├── pom.xml
├── resources
├── ERD.pgerd
├── hrms_ERDiagram.png
├── hrms_script-(Constraintleri_gosteren_sekli).sql
└── hrms_script.sql
└── src
├── main
├── java
│ └── kodlamaio
│ │ └── hrms
│ │ ├── HrmsApplication.java
│ │ ├── api
│ │ └── controllers
│ │ │ ├── AuthController.java
│ │ │ ├── CandidatesController.java
│ │ │ ├── CitiesController.java
│ │ │ ├── CvLanguagesController.java
│ │ │ ├── CvsController.java
│ │ │ ├── EducationsController.java
│ │ │ ├── EmployeesController.java
│ │ │ ├── EmployersController.java
│ │ │ ├── ExperiencesController.java
│ │ │ ├── JobAdvertisementsController.java
│ │ │ ├── JobPositionsController.java
│ │ │ ├── PhotosController.java
│ │ │ └── SkillsController.java
│ │ ├── business
│ │ ├── abstracts
│ │ │ ├── ActivationService.java
│ │ │ ├── AuthService.java
│ │ │ ├── CandidateService.java
│ │ │ ├── CheckRealPersonService.java
│ │ │ ├── CityService.java
│ │ │ ├── CvLanguageService.java
│ │ │ ├── CvService.java
│ │ │ ├── EducationService.java
│ │ │ ├── EmployeeService.java
│ │ │ ├── EmployerService.java
│ │ │ ├── ExperienceService.java
│ │ │ ├── JobAdvertisementService.java
│ │ │ ├── JobPositionService.java
│ │ │ ├── PhotoService.java
│ │ │ ├── SkillService.java
│ │ │ ├── UserService.java
│ │ │ └── UserValidationService.java
│ │ ├── adapters
│ │ │ ├── MernisServiceAdapter.java
│ │ │ └── cloudinary
│ │ │ │ └── CloudinaryAdapterService.java
│ │ ├── concretes
│ │ │ ├── AuthManager.java
│ │ │ ├── CandidateManager.java
│ │ │ ├── CandidateValidationManager.java
│ │ │ ├── CityManager.java
│ │ │ ├── CvLanguageManager.java
│ │ │ ├── CvManager.java
│ │ │ ├── EducationManager.java
│ │ │ ├── EmailActivationManager.java
│ │ │ ├── EmployeeManager.java
│ │ │ ├── EmployerManager.java
│ │ │ ├── EmployerValidationManager.java
│ │ │ ├── ExperienceManager.java
│ │ │ ├── JobAdvertisementManager.java
│ │ │ ├── JobPostionManager.java
│ │ │ ├── PhotoManager.java
│ │ │ ├── SkillManager.java
│ │ │ └── UserManager.java
│ │ └── constants
│ │ │ └── Messages.java
│ │ ├── core
│ │ └── utilities
│ │ │ ├── BeanDeserializerModifierForIgnorables.java
│ │ │ ├── helpers
│ │ │ └── PhotoUploadHelper.java
│ │ │ └── results
│ │ │ ├── DataResult.java
│ │ │ ├── ErrorDataResult.java
│ │ │ ├── ErrorResult.java
│ │ │ ├── Result.java
│ │ │ ├── SuccessDataResult.java
│ │ │ └── SuccessResult.java
│ │ ├── dataAccess
│ │ └── abstracts
│ │ │ ├── CandidateDao.java
│ │ │ ├── CityDao.java
│ │ │ ├── CvDao.java
│ │ │ ├── CvLanguageDao.java
│ │ │ ├── EducationDao.java
│ │ │ ├── EmployeeDao.java
│ │ │ ├── EmployerDao.java
│ │ │ ├── ExperienceDao.java
│ │ │ ├── JobAdvertisementDao.java
│ │ │ ├── JobPositionDao.java
│ │ │ ├── PhotoDao.java
│ │ │ ├── SkillDao.java
│ │ │ └── UserDao.java
│ │ └── entities
│ │ ├── abstracts
│ │ └── ValidatableUser.java
│ │ ├── concretes
│ │ ├── Candidate.java
│ │ ├── City.java
│ │ ├── Cv.java
│ │ ├── CvLanguage.java
│ │ ├── Education.java
│ │ ├── Employee.java
│ │ ├── Employer.java
│ │ ├── Experience.java
│ │ ├── JobAdvertisement.java
│ │ ├── JobPosition.java
│ │ ├── Photo.java
│ │ ├── Skill.java
│ │ └── User.java
│ │ └── dtos
│ │ ├── CandidateForRegisterDto.java
│ │ ├── CvDto.java
│ │ ├── EmployerForRegisterDto.java
│ │ ├── JobAdvertisementDto.java
│ │ └── UserForLoginDto.java
└── resources
│ └── application.properties
└── test
└── java
└── kodlamaio
└── hrms
└── HrmsApplicationTests.java
/.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 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/barisertugrul/HRMS_JavaProject/7bf7bb0d6fd4c11a53071d074b2037d98261fcb3/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HRMS_JavaProject
2 | Yazılım Geliştirici Yetiştirme Kampı (JAVA & REACT) Uygulama Projesi (Backend)
3 |
4 | 9.Gün Ödevleri:
5 |
6 | * Farklı alanlara başvuru için, aday başına birden fazla cv modeli temel alındı.
7 | * Birden çok okul, iş tecrübesi, yetenek/kullanılan teknoloji, yabancı dil ve fotoğraf eklenebilirliği gözetildi (ki fotoğraf dışındakiler için bu durum ödevde istenmiş), bu nedenle bu alanlar için ayrı tablolar oluşturuldu (cvs, skills, educations, experiences, languages ve photos). (Bu özellikler için birden fazla kayıt olabileceğinden dolayı, tek tabloda tutulması doğru olmazdı)
8 | * Ana özgeçmiş tablosu olan cvs tablosu user_id aracılığı ile Candidate tablosuna, skills, educations, experiences, languages ve photos tabloları da cv_id ile cvs tablosuna bağlandı.
9 | * Bütün cv alanlarını içerecek ve tek adımda kayıt yapılacak şekilde (Education list, Experience list, Skill List, Language list) Cv formu hazırlandı. Alt alanlar istenirse ayrı ayrı da eklenebilir.
10 | * Silme ve güncelleştirme metotları daha sonra eklenecektir.
11 | * Cv id'sine göre cloudinary platformuna fotoğraf yükleme metodu yazıldı (Cv formuyla birlikte yüklenebilmesi için code refactoring yapılacak)
12 | * Alınacak Okul ve iş deneyimi listelerinin cv ve kullanıcıya göre sorgulanacak, sorgu sonuçları tersten sıralanacak, mezuniyet veya işten ayrılma tarihlerinde null değerlere sahip kayıtlar en üstte olacak şekilde çıktı vermesi için gerekli metotlar yazıldı. (Listelerdeki Null değerlere "Devam ediyor" çıktısı yazdırılması, alanın Date tipinden çıkmasına yol açtığı için frontend tarafına bırakıldı)
13 | * Cloudinary servisi, core katmanına yerleştirilen bir upload helper interface'i implement edilerek, business katmanında adapters paketine yerleştirildi. Ve constructor injection ile PhotoManager içerisinde kullanıldı.
14 | * CvManager içerisindeki constructor injection parametrelerinin fazlalığı rahatsız ettiği için üzerinde çalışılacak.
15 |
16 | NOT: Cloudinary Service adaptasyonunu kullanmak isteyen arkadaşların, adapters paketindeki CloudinaryAdapterService içerisindeki api bilgilerini kendi üyelik bilgilerine göre doldurmaları yeterli olacaktır.
17 |
18 | Geçmiş:
19 | * İş arayanlar ve iş verenler için gerekli register işlemleri AuthManager içerisinde ayrı metotlarla gerçekleştiriliyor
20 | * Gerekli alanların doluluk ve uygunluk kontrolleri, Business katmanına yerleştirdiğim kendi Validation sınıfları ile yapılıyor. Tüm alan hataları toplu olarak kullanıcıya geri iletiliyor.
21 | * Email ve TC kimlik no uygunluk kontrolünü basit regex kalıpları ile yaptım, ama eksik olduğu için istisnalara yol açabiliyor.
22 | * İşveren domain-email uygunluğunu da aynı doğrulama sınıfında regex ile gerçekleştirdim. Regex kalıbı ile email adresindeki domain bölümünü ayırıp, website stringi ile eşitliğini kontrol ettim.
23 | * Yine mernis doğrulaması ve email ile aktivasyon kodu gönderimini constructor injection yoluyla eklediğim servisler aracılığı ile yaptım.
24 | * Kayıt verilerinin doğruluk kontrollerinin yapılacağı yere tam olarak karar veremedim ama ana işlemleri yapacak metotları manager sınıflarının içerisinden çağırma yöntemiyle AuthManager içerisinde yapmayı tercih ettim.
25 | * Aktivasyon kısıtlamalarını kontrol edebilmek için login metotları ekledim. Ancak her bir kullanıcı grubunun kontrol şartları farklı olduğu için ayrı login metotları tanımladım kullanıcı grupları için. Bu durum beni rahatsız ediyor ama şimdilik başka bir çözüm bulamadım. Üzerinde çalışıyorum hala.
26 | * Özellikle daha önceden kayıtlı kullanıcıları, belli şartlara bağlı olarak hızlıca ve az kodla tespit edebilmek için Engin hocanın paylaştığı https://www.baeldung.com/spring-data-derived-queries adresindeki yazıdan yararlanarak sorgular hazırladım. Login kontrolü için de aynı anda mail ve password eşleşmesini kontrol eden genişletilmiş sorgu kullandım.
27 | * Activasyon için AuthController içerisinde email ve activation code bilgilerini alan comfirmActivation metodu tanımlayıp, AuthManager içerisindeki ilgili metoda yönlendirme yaptım.
28 |
29 |
30 | ## ERDiagram
31 | 
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.4.5
9 |
10 |
11 | kodlamaio
12 | hrms
13 | 0.0.1-SNAPSHOT
14 | hrms
15 | HRMS project for Spring Boot
16 |
17 | 11
18 |
19 |
20 |
21 | org.springframework.boot
22 | spring-boot-starter-data-jpa
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-starter-web
27 |
28 |
29 |
30 | org.springframework.boot
31 | spring-boot-devtools
32 | runtime
33 | true
34 |
35 |
36 | org.postgresql
37 | postgresql
38 | runtime
39 |
40 |
41 | org.projectlombok
42 | lombok
43 | true
44 |
45 |
46 | org.springframework.boot
47 | spring-boot-starter-test
48 | test
49 |
50 |
51 | io.springfox
52 | springfox-swagger2
53 | 2.9.2
54 |
55 |
56 | io.springfox
57 | springfox-swagger-ui
58 | 2.9.2
59 |
60 |
61 | org.springframework.boot
62 | spring-boot-starter-validation
63 |
64 |
65 | com.cloudinary
66 | cloudinary-http44
67 | 1.29.0
68 |
69 |
70 |
71 |
72 |
73 |
74 | org.springframework.boot
75 | spring-boot-maven-plugin
76 |
77 |
78 |
79 | org.projectlombok
80 | lombok
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/resources/ERD.pgerd:
--------------------------------------------------------------------------------
1 | {"version":"50000","data":{"id":"f5c4e011-7922-4434-b7de-8660a70ea823","offsetX":-28.250000000000227,"offsetY":-249.20833317438775,"zoom":79.16666666666671,"gridSize":15,"layers":[{"id":"f572d985-0fd0-41b1-8653-76e292b9828b","type":"diagram-links","isSvg":true,"transformed":true,"models":{"0f8b407b-d5d6-4a35-ad6f-2a2a3efb62c0":{"id":"0f8b407b-d5d6-4a35-ad6f-2a2a3efb62c0","locked":true,"type":"onetomany","source":"c402744d-78c0-4239-8c62-9e5c795b4e0f","sourcePort":"409cc619-b4b0-4a39-8e53-ed86e0e43e5e","target":"4a9c20cc-54e1-4f8c-ad47-ddafeecd8e55","targetPort":"93e98d39-f030-4cfd-a9f3-42a6034adcfc","points":[{"id":"49e8e774-97e4-456a-9e27-c8399a65a3c0","type":"point","x":679,"y":106.39999771118164},{"id":"35ca1d17-6dfd-477e-b610-c309c5442cf7","type":"point","x":679,"y":519.5874977111816},{"id":"914d17f4-6c5c-4026-9ada-884779a96702","type":"point","x":209,"y":519.5874977111816}],"labels":[],"width":1,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)","data":{"local_table_uid":"4a9c20cc-54e1-4f8c-ad47-ddafeecd8e55","local_column_attnum":1,"referenced_table_uid":"c402744d-78c0-4239-8c62-9e5c795b4e0f","referenced_column_attnum":1}},"7a325d86-b795-4bd8-b6fd-58fd07f258be":{"id":"7a325d86-b795-4bd8-b6fd-58fd07f258be","locked":true,"type":"onetomany","source":"b3096edf-5904-4131-b87a-37cf6e5aadf3","sourcePort":"986313a6-a99b-4bc2-b1d9-6dab028595a4","target":"b3096edf-5904-4131-b87a-37cf6e5aadf3","targetPort":"986313a6-a99b-4bc2-b1d9-6dab028595a4","points":[{"id":"480c27bb-d194-41ee-8ebd-6b65cf5bd27c","type":"point","x":434,"y":583.4859352111816},{"id":"e1b5330f-f758-4fd5-85d4-57c3b06e2f90","type":"point","x":434,"y":482.0859375},{"id":"ac44489b-ff61-4e39-b4c1-bd5d077e7572","type":"point","x":434.1666666666667,"y":482.0859375},{"id":"2dc4d230-7641-4130-bf35-e9cb4612acb4","type":"point","x":440,"y":556.28125},{"id":"551a98ef-9533-41c4-aafd-b650257ead1b","type":"point","x":434,"y":630.4765625},{"id":"69a1d761-9b5c-41e8-85eb-c6d2d341a903","type":"point","x":434,"y":583.4859352111816}],"labels":[],"width":1,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)","data":{"local_table_uid":"b3096edf-5904-4131-b87a-37cf6e5aadf3","local_column_attnum":1,"referenced_table_uid":"b3096edf-5904-4131-b87a-37cf6e5aadf3","referenced_column_attnum":1}},"fc5a65a9-e60f-47bf-b716-a55334a4acb3":{"id":"fc5a65a9-e60f-47bf-b716-a55334a4acb3","locked":true,"type":"onetomany","source":"c402744d-78c0-4239-8c62-9e5c795b4e0f","sourcePort":"409cc619-b4b0-4a39-8e53-ed86e0e43e5e","target":"89518e49-7f2d-4890-b90c-abb121057b16","targetPort":"a8d1ec43-a5aa-49c2-9dc3-ac77e0b0a045","points":[{"id":"97d3df06-e204-4cd9-af9a-d77c68379f12","type":"point","x":679,"y":106.39999771118164},{"id":"e8abe4ab-2afa-4f99-8920-2931158d3322","type":"point","x":679,"y":555.3843727111816},{"id":"7e6863b4-2129-4506-8ed1-7e77871cd5b9","type":"point","x":679,"y":555.3843727111816}],"labels":[],"width":1,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)","data":{"local_table_uid":"89518e49-7f2d-4890-b90c-abb121057b16","local_column_attnum":1,"referenced_table_uid":"c402744d-78c0-4239-8c62-9e5c795b4e0f","referenced_column_attnum":1}},"a456f9e3-7f33-486f-a011-54c27f1aab1c":{"id":"a456f9e3-7f33-486f-a011-54c27f1aab1c","locked":true,"type":"onetomany","source":"c402744d-78c0-4239-8c62-9e5c795b4e0f","sourcePort":"409cc619-b4b0-4a39-8e53-ed86e0e43e5e","target":"19668508-6e7c-44a5-8456-7ca32cbbce59","targetPort":"40e6f76a-5022-4946-a30e-10a8609d51d1","points":[{"id":"f5553a83-eda4-406c-a551-00bbc00add79","type":"point","x":679,"y":106.39999771118164},{"id":"9b2df6d9-4261-4ec0-9863-fa0efcdc209d","type":"point","x":679,"y":519.5874977111816},{"id":"f306b203-9b39-485d-aa42-c1360aad2d3b","type":"point","x":904,"y":519.5874977111816}],"labels":[],"width":1,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)","data":{"local_table_uid":"19668508-6e7c-44a5-8456-7ca32cbbce59","local_column_attnum":1,"referenced_table_uid":"c402744d-78c0-4239-8c62-9e5c795b4e0f","referenced_column_attnum":1}},"9aa45154-bd33-43c5-91b3-c594f0b12c69":{"id":"9aa45154-bd33-43c5-91b3-c594f0b12c69","locked":true,"type":"onetomany","source":"b3096edf-5904-4131-b87a-37cf6e5aadf3","sourcePort":"986313a6-a99b-4bc2-b1d9-6dab028595a4","target":"fa782b46-58bf-4052-b9dd-daaf2c18a313","targetPort":"d28ac15b-b1af-4ce8-aa14-e6d1bd2694d8","points":[{"id":"aa5e6f6b-6c63-42bf-84b1-c307d7beba84","type":"point","x":434,"y":583.4859352111816},{"id":"ef435b95-d39e-4520-a99d-13bcdd9c8298","type":"point","x":434,"y":903.7750129699707},{"id":"cd4794b4-d2b0-4b77-86c8-0f344674e292","type":"point","x":904,"y":903.7750129699707}],"labels":[],"width":1,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)","data":{"local_table_uid":"fa782b46-58bf-4052-b9dd-daaf2c18a313","local_column_attnum":3,"referenced_table_uid":"b3096edf-5904-4131-b87a-37cf6e5aadf3","referenced_column_attnum":1}},"ade43f63-9db8-44ca-bf5e-77138b175690":{"id":"ade43f63-9db8-44ca-bf5e-77138b175690","locked":true,"type":"onetomany","source":"19668508-6e7c-44a5-8456-7ca32cbbce59","sourcePort":"40e6f76a-5022-4946-a30e-10a8609d51d1","target":"fa782b46-58bf-4052-b9dd-daaf2c18a313","targetPort":"004f48dc-1a98-434f-8491-11e7b3412997","points":[{"id":"b046df7e-5736-4471-8254-fde2575aa32b","type":"point","x":904,"y":519.5874977111816},{"id":"6cdabb0f-a69e-4e8d-9f8e-f9d11e9c8309","type":"point","x":904,"y":1120.3750190734863},{"id":"95a30223-bd4d-47f6-ad6a-a29cf43db44f","type":"point","x":904,"y":1120.3750190734863}],"labels":[],"width":1,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)","data":{"local_table_uid":"fa782b46-58bf-4052-b9dd-daaf2c18a313","local_column_attnum":10,"referenced_table_uid":"19668508-6e7c-44a5-8456-7ca32cbbce59","referenced_column_attnum":1}},"9c84e5ba-347f-4dec-bf70-88ec74503f0f":{"id":"9c84e5ba-347f-4dec-bf70-88ec74503f0f","locked":true,"type":"onetomany","source":"ccd07543-3e48-47e1-86ad-f561d0a8e9fe","sourcePort":"4e380d36-9af2-4536-8508-939c93fa2d98","target":"fa782b46-58bf-4052-b9dd-daaf2c18a313","targetPort":"ece5622e-a0f7-48b1-83e6-fef96527374c","points":[{"id":"4d3d04f9-3f37-4b0a-83d2-fe14376752a0","type":"point","x":1129,"y":562.1812477111816},{"id":"adb0a1ea-7627-4a7d-b054-35b738970436","type":"point","x":1129,"y":874.7749977111816},{"id":"818772a1-5f54-4cc6-9782-c747cec5c054","type":"point","x":904,"y":874.7749977111816}],"labels":[],"width":1,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)","data":{"local_table_uid":"fa782b46-58bf-4052-b9dd-daaf2c18a313","local_column_attnum":2,"referenced_table_uid":"ccd07543-3e48-47e1-86ad-f561d0a8e9fe","referenced_column_attnum":1}}}},{"id":"0cadf1d8-f47a-4a0b-b84e-57ae5c9c86f9","type":"diagram-nodes","isSvg":false,"transformed":true,"models":{"4a9c20cc-54e1-4f8c-ad47-ddafeecd8e55":{"id":"4a9c20cc-54e1-4f8c-ad47-ddafeecd8e55","type":"table","x":5,"y":418.1875,"ports":[{"id":"93e98d39-f030-4cfd-a9f3-42a6034adcfc","type":"onetomany","x":179,"y":519.5874977111816,"name":"coll-port-1","alignment":"right","parentNode":"4a9c20cc-54e1-4f8c-ad47-ddafeecd8e55","links":["0f8b407b-d5d6-4a35-ad6f-2a2a3efb62c0"],"subtype":"many"}],"name":"Untitled","color":"rgb(0,192,255)","portsInOrder":[],"portsOutOrder":["93e98d39-f030-4cfd-a9f3-42a6034adcfc"],"otherInfo":{"data":{"columns":[{"name":"user_id","description":null,"attnum":1,"cltype":"smallint","is_primary_key":true,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"first_name","description":null,"attnum":3,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"30","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"last_name","description":null,"attnum":4,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"30","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"nationality_id","description":null,"attnum":5,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"15","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"year_of_birth","description":null,"attnum":7,"cltype":"smallint","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null}],"name":"candidates","schema":"public","description":null,"primary_key":[{"columns":[{"column":"user_id"}]}]},"note":""}},"b3096edf-5904-4131-b87a-37cf6e5aadf3":{"id":"b3096edf-5904-4131-b87a-37cf6e5aadf3","type":"table","x":230,"y":482.0859375,"ports":[{"id":"986313a6-a99b-4bc2-b1d9-6dab028595a4","type":"onetomany","x":404,"y":583.4859352111816,"name":"coll-port-1","alignment":"right","parentNode":"b3096edf-5904-4131-b87a-37cf6e5aadf3","links":["7a325d86-b795-4bd8-b6fd-58fd07f258be","9aa45154-bd33-43c5-91b3-c594f0b12c69"],"subtype":"one"}],"name":"Untitled","color":"rgb(0,192,255)","portsInOrder":[],"portsOutOrder":["986313a6-a99b-4bc2-b1d9-6dab028595a4"],"otherInfo":{"data":{"columns":[{"name":"city_id","description":null,"attnum":1,"cltype":"smallint","is_primary_key":true,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"city_name","description":null,"attnum":2,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null}],"name":"cities","schema":"public","description":null,"primary_key":[{"columns":[{"column":"city_id"}]}]},"note":""}},"89518e49-7f2d-4890-b90c-abb121057b16":{"id":"89518e49-7f2d-4890-b90c-abb121057b16","type":"table","x":475,"y":453.984375,"ports":[{"id":"a8d1ec43-a5aa-49c2-9dc3-ac77e0b0a045","type":"onetomany","x":649,"y":555.3843727111816,"name":"coll-port-1","alignment":"right","parentNode":"89518e49-7f2d-4890-b90c-abb121057b16","links":["fc5a65a9-e60f-47bf-b716-a55334a4acb3"],"subtype":"many"}],"name":"Untitled","color":"rgb(0,192,255)","portsInOrder":[],"portsOutOrder":["a8d1ec43-a5aa-49c2-9dc3-ac77e0b0a045"],"otherInfo":{"data":{"columns":[{"name":"user_id","description":null,"attnum":1,"cltype":"smallint","is_primary_key":true,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"first_name","description":null,"attnum":3,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"35","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"last_name","description":null,"attnum":4,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"35","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null}],"name":"employees","schema":"public","description":null,"primary_key":[{"columns":[{"column":"user_id"}]}]},"note":""}},"19668508-6e7c-44a5-8456-7ca32cbbce59":{"id":"19668508-6e7c-44a5-8456-7ca32cbbce59","type":"table","x":700,"y":418.1875,"ports":[{"id":"40e6f76a-5022-4946-a30e-10a8609d51d1","type":"onetomany","x":874,"y":519.5874977111816,"name":"coll-port-1","alignment":"right","parentNode":"19668508-6e7c-44a5-8456-7ca32cbbce59","links":["a456f9e3-7f33-486f-a011-54c27f1aab1c","ade43f63-9db8-44ca-bf5e-77138b175690"],"subtype":"many"}],"name":"Untitled","color":"rgb(0,192,255)","portsInOrder":[],"portsOutOrder":["40e6f76a-5022-4946-a30e-10a8609d51d1"],"otherInfo":{"data":{"columns":[{"name":"user_id","description":null,"attnum":1,"cltype":"smallint","is_primary_key":true,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"company_name","description":null,"attnum":3,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"100","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"phone_number","description":null,"attnum":4,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"15","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"admin_confirm","description":null,"attnum":5,"cltype":"boolean","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"website","description":null,"attnum":6,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"50","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null}],"name":"employers","schema":"public","description":null,"primary_key":[{"columns":[{"column":"user_id"}]}]},"note":""}},"fa782b46-58bf-4052-b9dd-daaf2c18a313":{"id":"fa782b46-58bf-4052-b9dd-daaf2c18a313","type":"table","x":700,"y":744.375,"ports":[{"id":"d28ac15b-b1af-4ce8-aa14-e6d1bd2694d8","type":"onetomany","x":874,"y":903.7750129699707,"name":"coll-port-3","alignment":"right","parentNode":"fa782b46-58bf-4052-b9dd-daaf2c18a313","links":["9aa45154-bd33-43c5-91b3-c594f0b12c69"],"subtype":"many"},{"id":"004f48dc-1a98-434f-8491-11e7b3412997","type":"onetomany","x":874,"y":1120.3750190734863,"name":"coll-port-10","alignment":"right","parentNode":"fa782b46-58bf-4052-b9dd-daaf2c18a313","links":["ade43f63-9db8-44ca-bf5e-77138b175690"],"subtype":"many"},{"id":"ece5622e-a0f7-48b1-83e6-fef96527374c","type":"onetomany","x":874,"y":874.7749977111816,"name":"coll-port-2","alignment":"right","parentNode":"fa782b46-58bf-4052-b9dd-daaf2c18a313","links":["9c84e5ba-347f-4dec-bf70-88ec74503f0f"],"subtype":"many"}],"name":"Untitled","color":"rgb(0,192,255)","portsInOrder":[],"portsOutOrder":["d28ac15b-b1af-4ce8-aa14-e6d1bd2694d8","004f48dc-1a98-434f-8491-11e7b3412997","ece5622e-a0f7-48b1-83e6-fef96527374c"],"otherInfo":{"data":{"columns":[{"name":"advertise_id","description":null,"attnum":1,"cltype":"smallint","is_primary_key":true,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"a","colconstype":"i","seqincrement":"1","seqstart":"1","seqmin":"1","seqmax":"32767","seqcache":"1","seqcycle":false},{"name":"position_id","description":null,"attnum":2,"cltype":"smallint","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"city_id","description":null,"attnum":3,"cltype":"smallint","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"job_definition","description":null,"attnum":4,"cltype":"text","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"min_salary","description":null,"attnum":5,"cltype":"money","is_primary_key":false,"attnotnull":false,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"max_salary","description":null,"attnum":6,"cltype":"money","is_primary_key":false,"attnotnull":false,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"number_of_open_positions","description":null,"attnum":7,"cltype":"smallint","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"created_date","description":null,"attnum":8,"cltype":"date","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"expiration_date","description":null,"attnum":9,"cltype":"date","is_primary_key":false,"attnotnull":false,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"employer_id","description":null,"attnum":10,"cltype":"smallint","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"is_active","description":null,"attnum":11,"cltype":"boolean","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null}],"name":"job_advertises","schema":"public","description":null,"primary_key":[{"columns":[{"column":"advertise_id"}]}]},"note":""}},"ccd07543-3e48-47e1-86ad-f561d0a8e9fe":{"id":"ccd07543-3e48-47e1-86ad-f561d0a8e9fe","type":"table","x":925,"y":460.78125,"ports":[{"id":"4e380d36-9af2-4536-8508-939c93fa2d98","type":"onetomany","x":1099,"y":562.1812477111816,"name":"coll-port-1","alignment":"right","parentNode":"ccd07543-3e48-47e1-86ad-f561d0a8e9fe","links":["9c84e5ba-347f-4dec-bf70-88ec74503f0f"],"subtype":"one"}],"name":"Untitled","color":"rgb(0,192,255)","portsInOrder":[],"portsOutOrder":["4e380d36-9af2-4536-8508-939c93fa2d98"],"otherInfo":{"data":{"columns":[{"name":"position_id","description":null,"attnum":1,"cltype":"smallint","is_primary_key":true,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"a","colconstype":"i","seqincrement":"1","seqstart":"1","seqmin":"1","seqmax":"32767","seqcache":"1","seqcycle":false},{"name":"position_name","description":null,"attnum":4,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"30","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"position_description","description":null,"attnum":5,"cltype":"text","is_primary_key":false,"attnotnull":false,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null}],"name":"job_positions","schema":"public","description":null,"primary_key":[{"columns":[{"column":"position_id"}]}]},"note":""}},"c402744d-78c0-4239-8c62-9e5c795b4e0f":{"id":"c402744d-78c0-4239-8c62-9e5c795b4e0f","type":"table","x":475,"y":5,"ports":[{"id":"409cc619-b4b0-4a39-8e53-ed86e0e43e5e","type":"onetomany","x":649,"y":106.39999771118164,"name":"coll-port-1","alignment":"right","parentNode":"c402744d-78c0-4239-8c62-9e5c795b4e0f","links":["0f8b407b-d5d6-4a35-ad6f-2a2a3efb62c0","fc5a65a9-e60f-47bf-b716-a55334a4acb3","a456f9e3-7f33-486f-a011-54c27f1aab1c"],"subtype":"one"}],"name":"Untitled","color":"rgb(0,192,255)","portsInOrder":[],"portsOutOrder":["409cc619-b4b0-4a39-8e53-ed86e0e43e5e"],"otherInfo":{"data":{"columns":[{"name":"id","description":null,"attnum":1,"cltype":"smallint","is_primary_key":true,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"a","colconstype":"i","seqincrement":"1","seqstart":"1","seqmin":"1","seqmax":"32767","seqcache":"1","seqcycle":false},{"name":"email","description":null,"attnum":4,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"50","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"password","description":null,"attnum":5,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"500","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"register_date","description":null,"attnum":6,"cltype":"timestamp with time zone","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"activation_code","description":null,"attnum":7,"cltype":"character varying","is_primary_key":false,"attnotnull":true,"attlen":"500","attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"email_comfirm","description":null,"attnum":8,"cltype":"boolean","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"is_active","description":null,"attnum":9,"cltype":"boolean","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null},{"name":"is_deleted","description":null,"attnum":10,"cltype":"boolean","is_primary_key":false,"attnotnull":true,"attlen":null,"attprecision":null,"attidentity":"","colconstype":"n","seqincrement":null,"seqstart":null,"seqmin":null,"seqmax":null,"seqcache":null,"seqcycle":null}],"name":"users","schema":"public","description":null,"primary_key":[{"columns":[{"column":"id"}]}]},"note":""}}}}]}}
--------------------------------------------------------------------------------
/resources/hrms_ERDiagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/barisertugrul/HRMS_JavaProject/7bf7bb0d6fd4c11a53071d074b2037d98261fcb3/resources/hrms_ERDiagram.png
--------------------------------------------------------------------------------
/resources/hrms_script-(Constraintleri_gosteren_sekli).sql:
--------------------------------------------------------------------------------
1 | -- Database: Hrms
2 |
3 | -- DROP DATABASE "Hrms";
4 |
5 | CREATE DATABASE "Hrms"
6 | WITH
7 | OWNER = postgres
8 | ENCODING = 'UTF8'
9 | LC_COLLATE = 'Turkish_Turkey.1254'
10 | LC_CTYPE = 'Turkish_Turkey.1254'
11 | TABLESPACE = pg_default
12 | CONNECTION LIMIT = -1;
13 |
14 |
15 |
16 | -- Table: public.employees
17 |
18 | -- DROP TABLE public.employees;
19 |
20 | CREATE TABLE public.employees
21 | (
22 | user_id smallint NOT NULL,
23 | first_name character varying(35) COLLATE pg_catalog."default" NOT NULL,
24 | last_name character varying(35) COLLATE pg_catalog."default" NOT NULL,
25 | CONSTRAINT employees_pkey PRIMARY KEY (user_id),
26 | CONSTRAINT employees_user_id_fkey FOREIGN KEY (user_id)
27 | REFERENCES public.users (id) MATCH SIMPLE
28 | ON UPDATE NO ACTION
29 | ON DELETE NO ACTION
30 | NOT VALID
31 | )
32 |
33 | TABLESPACE pg_default;
34 |
35 | ALTER TABLE public.employees
36 | OWNER to postgres;
37 |
38 |
39 | -- Table: public.employers
40 |
41 | -- DROP TABLE public.employers;
42 |
43 | CREATE TABLE public.employers
44 | (
45 | user_id smallint NOT NULL,
46 | company_name character varying(100) COLLATE pg_catalog."default" NOT NULL,
47 | phone_number character varying(15) COLLATE pg_catalog."default" NOT NULL,
48 | admin_confirm boolean NOT NULL DEFAULT false,
49 | website character varying(50) COLLATE pg_catalog."default" NOT NULL,
50 | CONSTRAINT employers_pkey PRIMARY KEY (user_id),
51 | CONSTRAINT employers_user_id_fkey FOREIGN KEY (user_id)
52 | REFERENCES public.users (id) MATCH SIMPLE
53 | ON UPDATE NO ACTION
54 | ON DELETE NO ACTION
55 | NOT VALID
56 | )
57 |
58 | TABLESPACE pg_default;
59 |
60 | ALTER TABLE public.employers
61 | OWNER to postgres;
62 |
63 |
64 | -- Table: public.job_positions
65 |
66 | -- DROP TABLE public.job_positions;
67 |
68 | CREATE TABLE public.job_positions
69 | (
70 | position_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
71 | position_name character varying(30) COLLATE pg_catalog."default" NOT NULL,
72 | position_description text COLLATE pg_catalog."default",
73 | CONSTRAINT job_positions_pkey PRIMARY KEY (position_id)
74 | )
75 |
76 | TABLESPACE pg_default;
77 |
78 | ALTER TABLE public.job_positions
79 | OWNER to postgres;
80 |
81 |
82 | -- Table: public.candidates
83 |
84 | -- DROP TABLE public.candidates;
85 |
86 | CREATE TABLE public.candidates
87 | (
88 | user_id smallint NOT NULL,
89 | first_name character varying(30) COLLATE pg_catalog."default" NOT NULL,
90 | last_name character varying(30) COLLATE pg_catalog."default" NOT NULL,
91 | nationality_id character varying(15) COLLATE pg_catalog."default" NOT NULL,
92 | year_of_birth smallint NOT NULL,
93 | CONSTRAINT job_seeker_pkey PRIMARY KEY (user_id),
94 | CONSTRAINT job_seeker_nationality_id_key UNIQUE (nationality_id),
95 | CONSTRAINT job_seeker_user_id_fkey FOREIGN KEY (user_id)
96 | REFERENCES public.users (id) MATCH SIMPLE
97 | ON UPDATE NO ACTION
98 | ON DELETE NO ACTION
99 | NOT VALID
100 | )
101 |
102 | TABLESPACE pg_default;
103 |
104 | ALTER TABLE public.candidates
105 | OWNER to postgres;
106 |
107 |
108 | -- Table: public.users
109 |
110 | -- DROP TABLE public.users;
111 |
112 | CREATE TABLE public.users
113 | (
114 | id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
115 | email character varying(50) COLLATE pg_catalog."default" NOT NULL,
116 | password character varying(500) COLLATE pg_catalog."default" NOT NULL,
117 | register_date timestamp with time zone NOT NULL,
118 | activation_code character varying(500) COLLATE pg_catalog."default" NOT NULL DEFAULT true,
119 | email_comfirm boolean NOT NULL DEFAULT false,
120 | is_active boolean NOT NULL DEFAULT false,
121 | is_deleted boolean NOT NULL DEFAULT false,
122 | CONSTRAINT users_pkey PRIMARY KEY (id)
123 | )
124 |
125 | TABLESPACE pg_default;
126 |
127 | ALTER TABLE public.users
128 | OWNER to postgres;
129 |
130 |
131 | -- Table: public.job_advertisements
132 |
133 | -- DROP TABLE public.job_advertisements;
134 |
135 | CREATE TABLE public.job_advertisements
136 | (
137 | advertisement_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
138 | position_id smallint NOT NULL,
139 | city_id smallint NOT NULL,
140 | job_definition text COLLATE pg_catalog."default" NOT NULL,
141 | min_salary numeric(10,2),
142 | max_salary numeric(10,2),
143 | number_of_open_positions smallint NOT NULL,
144 | created_date date NOT NULL DEFAULT CURRENT_TIMESTAMP,
145 | expiration_date date,
146 | employer_id smallint NOT NULL,
147 | is_active boolean NOT NULL DEFAULT true,
148 | expiration_dated date,
149 | CONSTRAINT job_advertises_pkey PRIMARY KEY (advertisement_id),
150 | CONSTRAINT job_advertises_city_id_fkey FOREIGN KEY (city_id)
151 | REFERENCES public.cities (city_id) MATCH SIMPLE
152 | ON UPDATE NO ACTION
153 | ON DELETE NO ACTION,
154 | CONSTRAINT job_advertises_employer_id_fkey FOREIGN KEY (employer_id)
155 | REFERENCES public.employers (user_id) MATCH SIMPLE
156 | ON UPDATE NO ACTION
157 | ON DELETE NO ACTION,
158 | CONSTRAINT job_advertises_position_id_fkey FOREIGN KEY (position_id)
159 | REFERENCES public.job_positions (position_id) MATCH SIMPLE
160 | ON UPDATE NO ACTION
161 | ON DELETE NO ACTION
162 | )
163 |
164 | TABLESPACE pg_default;
165 |
166 | ALTER TABLE public.job_advertisements
167 | OWNER to postgres;
168 |
169 |
170 | -- Table: public.cities
171 |
172 | -- DROP TABLE public.cities;
173 |
174 | CREATE TABLE public.cities
175 | (
176 | city_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
177 | city_name character varying COLLATE pg_catalog."default" NOT NULL,
178 | CONSTRAINT cities_pkey PRIMARY KEY (city_id),
179 | CONSTRAINT fkob77udyax7da1dcmsoymcrs8i FOREIGN KEY (city_id)
180 | REFERENCES public.cities (city_id) MATCH SIMPLE
181 | ON UPDATE NO ACTION
182 | ON DELETE NO ACTION
183 | )
184 |
185 | TABLESPACE pg_default;
186 |
187 | ALTER TABLE public.cities
188 | OWNER to postgres;
189 |
190 |
191 |
192 | -- Table: public.cvs
193 |
194 | -- DROP TABLE public.cvs;
195 |
196 | CREATE TABLE public.cvs
197 | (
198 | cv_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
199 | user_id smallint NOT NULL,
200 | github_link character varying(255) COLLATE pg_catalog."default",
201 | linkedin_link character varying(255) COLLATE pg_catalog."default",
202 | summary text COLLATE pg_catalog."default",
203 | CONSTRAINT cvs_pkey PRIMARY KEY (cv_id),
204 | CONSTRAINT cvs_user_id_fkey FOREIGN KEY (user_id)
205 | REFERENCES public.candidates (user_id) MATCH SIMPLE
206 | ON UPDATE NO ACTION
207 | ON DELETE NO ACTION
208 | NOT VALID
209 | )
210 |
211 | TABLESPACE pg_default;
212 |
213 | ALTER TABLE public.cvs
214 | OWNER to postgres;
215 |
216 |
217 | -- Table: public.cv_languages
218 |
219 | -- DROP TABLE public.cv_languages;
220 |
221 | CREATE TABLE public.cv_languages
222 | (
223 | language_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
224 | cv_id smallint NOT NULL,
225 | language_name character varying(30) COLLATE pg_catalog."default" NOT NULL,
226 | language_level smallint NOT NULL,
227 | CONSTRAINT cv_languages_pkey PRIMARY KEY (language_id),
228 | CONSTRAINT cv_languages_cv_id_fkey FOREIGN KEY (cv_id)
229 | REFERENCES public.cvs (cv_id) MATCH SIMPLE
230 | ON UPDATE NO ACTION
231 | ON DELETE NO ACTION
232 | )
233 |
234 | TABLESPACE pg_default;
235 |
236 | ALTER TABLE public.cv_languages
237 | OWNER to postgres;
238 |
239 |
240 |
241 | -- Table: public.educations
242 |
243 | -- DROP TABLE public.educations;
244 |
245 | CREATE TABLE public.educations
246 | (
247 | education_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
248 | cv_id smallint NOT NULL,
249 | school_name character varying(100) COLLATE pg_catalog."default" NOT NULL,
250 | program_name character varying(100) COLLATE pg_catalog."default" NOT NULL,
251 | start_date date NOT NULL,
252 | graduation_date date,
253 | CONSTRAINT schools_pkey PRIMARY KEY (education_id),
254 | CONSTRAINT schools_cv_id_fkey FOREIGN KEY (cv_id)
255 | REFERENCES public.cvs (cv_id) MATCH SIMPLE
256 | ON UPDATE NO ACTION
257 | ON DELETE NO ACTION
258 | )
259 |
260 | TABLESPACE pg_default;
261 |
262 | ALTER TABLE public.educations
263 | OWNER to postgres;
264 |
265 |
266 |
267 | -- Table: public.experiences
268 |
269 | -- DROP TABLE public.experiences;
270 |
271 | CREATE TABLE public.experiences
272 | (
273 | experience_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
274 | cv_id smallint NOT NULL,
275 | workplace_name character varying(100) COLLATE pg_catalog."default" NOT NULL,
276 | job_title character varying(50) COLLATE pg_catalog."default" NOT NULL,
277 | start_date date NOT NULL,
278 | departure_date date,
279 | CONSTRAINT experiences_pkey PRIMARY KEY (experience_id),
280 | CONSTRAINT experiences_cv_id_fkey FOREIGN KEY (cv_id)
281 | REFERENCES public.cvs (cv_id) MATCH SIMPLE
282 | ON UPDATE NO ACTION
283 | ON DELETE NO ACTION
284 | )
285 |
286 | TABLESPACE pg_default;
287 |
288 | ALTER TABLE public.experiences
289 | OWNER to postgres;
290 |
291 |
292 |
293 | -- Table: public.photos
294 |
295 | -- DROP TABLE public.photos;
296 |
297 | CREATE TABLE public.photos
298 | (
299 | photo_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
300 | cv_id smallint NOT NULL,
301 | title character varying(50) COLLATE pg_catalog."default" NOT NULL,
302 | image character varying(255) COLLATE pg_catalog."default" NOT NULL,
303 | created_date date NOT NULL DEFAULT CURRENT_TIMESTAMP,
304 | CONSTRAINT photos_pkey PRIMARY KEY (photo_id),
305 | CONSTRAINT photos_cv_id_fkey FOREIGN KEY (cv_id)
306 | REFERENCES public.cvs (cv_id) MATCH SIMPLE
307 | ON UPDATE NO ACTION
308 | ON DELETE NO ACTION
309 | )
310 |
311 | TABLESPACE pg_default;
312 |
313 | ALTER TABLE public.photos
314 | OWNER to postgres;
315 |
316 |
317 |
318 | -- Table: public.skills
319 |
320 | -- DROP TABLE public.skills;
321 |
322 | CREATE TABLE public.skills
323 | (
324 | skill_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
325 | cv_id smallint NOT NULL,
326 | skill character varying(50) COLLATE pg_catalog."default" NOT NULL,
327 | skill_level smallint,
328 | CONSTRAINT skills_pkey PRIMARY KEY (skill_id),
329 | CONSTRAINT skills_cv_id_fkey FOREIGN KEY (cv_id)
330 | REFERENCES public.cvs (cv_id) MATCH SIMPLE
331 | ON UPDATE NO ACTION
332 | ON DELETE NO ACTION
333 | )
334 |
335 | TABLESPACE pg_default;
336 |
337 | ALTER TABLE public.skills
338 | OWNER to postgres;
--------------------------------------------------------------------------------
/resources/hrms_script.sql:
--------------------------------------------------------------------------------
1 | -- This script was generated by a beta version of the ERD tool in pgAdmin 4.
2 | -- Please log an issue at https://redmine.postgresql.org/projects/pgadmin4/issues/new if you find any bugs, including reproduction steps.
3 | BEGIN;
4 |
5 |
6 | CREATE TABLE public.candidates
7 | (
8 | user_id smallint NOT NULL,
9 | first_name character varying(30) NOT NULL,
10 | last_name character varying(30) NOT NULL,
11 | nationality_id character varying(15) NOT NULL,
12 | year_of_birth smallint NOT NULL,
13 | PRIMARY KEY (user_id)
14 | );
15 |
16 | CREATE TABLE public.cities
17 | (
18 | city_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
19 | city_name character varying NOT NULL,
20 | PRIMARY KEY (city_id)
21 | );
22 |
23 | CREATE TABLE public.cv_languages
24 | (
25 | language_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
26 | cv_id smallint NOT NULL,
27 | language_name character varying(30) NOT NULL,
28 | language_level smallint NOT NULL,
29 | PRIMARY KEY (language_id)
30 | );
31 |
32 | CREATE TABLE public.cvs
33 | (
34 | cv_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
35 | user_id smallint NOT NULL,
36 | github_link character varying(255),
37 | linkedin_link character varying(255),
38 | summary text,
39 | PRIMARY KEY (cv_id)
40 | );
41 |
42 | CREATE TABLE public.educations
43 | (
44 | education_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
45 | cv_id smallint NOT NULL,
46 | school_name character varying(100) NOT NULL,
47 | program_name character varying(100) NOT NULL,
48 | start_date date NOT NULL,
49 | graduation_date date,
50 | PRIMARY KEY (education_id)
51 | );
52 |
53 | CREATE TABLE public.employees
54 | (
55 | user_id smallint NOT NULL,
56 | first_name character varying(35) NOT NULL,
57 | last_name character varying(35) NOT NULL,
58 | PRIMARY KEY (user_id)
59 | );
60 |
61 | CREATE TABLE public.employers
62 | (
63 | user_id smallint NOT NULL,
64 | company_name character varying(100) NOT NULL,
65 | phone_number character varying(15) NOT NULL,
66 | admin_confirm boolean NOT NULL,
67 | website character varying(50) NOT NULL,
68 | PRIMARY KEY (user_id)
69 | );
70 |
71 | CREATE TABLE public.experiences
72 | (
73 | experience_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
74 | cv_id smallint NOT NULL,
75 | workplace_name character varying(100) NOT NULL,
76 | job_title character varying(50) NOT NULL,
77 | start_date date NOT NULL,
78 | departure_date date,
79 | PRIMARY KEY (experience_id)
80 | );
81 |
82 | CREATE TABLE public.job_advertisements
83 | (
84 | advertisement_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
85 | position_id smallint NOT NULL,
86 | city_id smallint NOT NULL,
87 | job_definition text NOT NULL,
88 | min_salary numeric(10, 2),
89 | max_salary numeric(10, 2),
90 | number_of_open_positions smallint NOT NULL,
91 | created_date date NOT NULL,
92 | expiration_date date,
93 | employer_id smallint NOT NULL,
94 | is_active boolean NOT NULL,
95 | expiration_dated date,
96 | PRIMARY KEY (advertisement_id)
97 | );
98 |
99 | CREATE TABLE public.job_positions
100 | (
101 | position_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
102 | position_name character varying(30) NOT NULL,
103 | position_description text,
104 | PRIMARY KEY (position_id)
105 | );
106 |
107 | CREATE TABLE public.photos
108 | (
109 | photo_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
110 | cv_id smallint NOT NULL,
111 | title character varying(50) NOT NULL,
112 | image character varying(255) NOT NULL,
113 | created_date date NOT NULL,
114 | PRIMARY KEY (photo_id)
115 | );
116 |
117 | CREATE TABLE public.skills
118 | (
119 | skill_id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
120 | cv_id smallint NOT NULL,
121 | skill character varying(50) NOT NULL,
122 | skill_level smallint,
123 | PRIMARY KEY (skill_id)
124 | );
125 |
126 | CREATE TABLE public.users
127 | (
128 | id smallint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 32767 CACHE 1 ),
129 | email character varying(50) NOT NULL,
130 | password character varying(500) NOT NULL,
131 | register_date timestamp with time zone NOT NULL,
132 | activation_code character varying(500) NOT NULL,
133 | email_comfirm boolean NOT NULL,
134 | is_active boolean NOT NULL,
135 | is_deleted boolean NOT NULL,
136 | PRIMARY KEY (id)
137 | );
138 |
139 | ALTER TABLE public.candidates
140 | ADD FOREIGN KEY (user_id)
141 | REFERENCES public.users (id)
142 | NOT VALID;
143 |
144 |
145 | ALTER TABLE public.cities
146 | ADD FOREIGN KEY (city_id)
147 | REFERENCES public.cities (city_id)
148 | NOT VALID;
149 |
150 |
151 | ALTER TABLE public.cv_languages
152 | ADD FOREIGN KEY (cv_id)
153 | REFERENCES public.cvs (cv_id)
154 | NOT VALID;
155 |
156 |
157 | ALTER TABLE public.cvs
158 | ADD FOREIGN KEY (user_id)
159 | REFERENCES public.candidates (user_id)
160 | NOT VALID;
161 |
162 |
163 | ALTER TABLE public.educations
164 | ADD FOREIGN KEY (cv_id)
165 | REFERENCES public.cvs (cv_id)
166 | NOT VALID;
167 |
168 |
169 | ALTER TABLE public.employees
170 | ADD FOREIGN KEY (user_id)
171 | REFERENCES public.users (id)
172 | NOT VALID;
173 |
174 |
175 | ALTER TABLE public.employers
176 | ADD FOREIGN KEY (user_id)
177 | REFERENCES public.users (id)
178 | NOT VALID;
179 |
180 |
181 | ALTER TABLE public.experiences
182 | ADD FOREIGN KEY (cv_id)
183 | REFERENCES public.cvs (cv_id)
184 | NOT VALID;
185 |
186 |
187 | ALTER TABLE public.job_advertisements
188 | ADD FOREIGN KEY (city_id)
189 | REFERENCES public.cities (city_id)
190 | NOT VALID;
191 |
192 |
193 | ALTER TABLE public.job_advertisements
194 | ADD FOREIGN KEY (employer_id)
195 | REFERENCES public.employers (user_id)
196 | NOT VALID;
197 |
198 |
199 | ALTER TABLE public.job_advertisements
200 | ADD FOREIGN KEY (position_id)
201 | REFERENCES public.job_positions (position_id)
202 | NOT VALID;
203 |
204 |
205 | ALTER TABLE public.photos
206 | ADD FOREIGN KEY (cv_id)
207 | REFERENCES public.cvs (cv_id)
208 | NOT VALID;
209 |
210 |
211 | ALTER TABLE public.skills
212 | ADD FOREIGN KEY (cv_id)
213 | REFERENCES public.cvs (cv_id)
214 | NOT VALID;
215 |
216 | END;
--------------------------------------------------------------------------------
/src/main/java/kodlamaio/hrms/HrmsApplication.java:
--------------------------------------------------------------------------------
1 | package kodlamaio.hrms;
2 |
3 |
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.context.annotation.Bean;
7 |
8 | import springfox.documentation.builders.RequestHandlerSelectors;
9 | import springfox.documentation.spi.DocumentationType;
10 | import springfox.documentation.spring.web.plugins.Docket;
11 | import springfox.documentation.swagger2.annotations.EnableSwagger2;
12 |
13 | @SpringBootApplication
14 | @EnableSwagger2
15 | public class HrmsApplication {
16 |
17 | public static void main(String[] args) {
18 | SpringApplication.run(HrmsApplication.class, args);
19 | }
20 |
21 | @Bean
22 | public Docket api() {
23 | return new Docket(DocumentationType.SWAGGER_2)
24 | .select()
25 | .apis(RequestHandlerSelectors.basePackage("kodlamaio.hrms"))
26 | .build();
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/kodlamaio/hrms/api/controllers/AuthController.java:
--------------------------------------------------------------------------------
1 | package kodlamaio.hrms.api.controllers;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.web.bind.annotation.PostMapping;
5 | import org.springframework.web.bind.annotation.RequestBody;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | import kodlamaio.hrms.business.abstracts.AuthService;
10 | import kodlamaio.hrms.core.utilities.results.Result;
11 | import kodlamaio.hrms.entities.dtos.EmployerForRegisterDto;
12 | import kodlamaio.hrms.entities.dtos.CandidateForRegisterDto;
13 | import kodlamaio.hrms.entities.dtos.UserForLoginDto;
14 |
15 | @RestController
16 | @RequestMapping("/api/auth")
17 | public class AuthController {
18 |
19 | private AuthService authService;
20 |
21 | @Autowired
22 | public AuthController(AuthService authService) {
23 | this.authService = authService;
24 | }
25 |
26 | @PostMapping("/login")
27 | public Result login(@RequestBody UserForLoginDto userForLoginDto) {
28 | return authService.login(userForLoginDto);
29 | }
30 |
31 | @PostMapping("/loginCandidate")
32 | public Result loginCandidate(@RequestBody UserForLoginDto userForLoginDto) {
33 | return authService.loginCandidate(userForLoginDto);
34 | }
35 |
36 | @PostMapping("/loginemployer")
37 | public Result loginEmployer(@RequestBody UserForLoginDto userForLoginDto) {
38 | return authService.loginEmployer(userForLoginDto);
39 | }
40 |
41 | @PostMapping("/loginemployee")
42 | public Result loginEmployee(@RequestBody UserForLoginDto userForLoginDto) {
43 | return authService.loginEmployee(userForLoginDto);
44 | }
45 |
46 | @PostMapping("/employerregister")
47 | public Result registerForEmployer(@RequestBody EmployerForRegisterDto employerForRegisterDto) {
48 | return authService.employerRegister(employerForRegisterDto);
49 | }
50 |
51 | @PostMapping("/candidateRegister")
52 | public Result registerForCandidate(@RequestBody CandidateForRegisterDto candidateForRegisterDto) {
53 | return authService.candidateRegister(candidateForRegisterDto);
54 | }
55 |
56 | @PostMapping("/confirmActivation")
57 | public Result confirmActivation(@RequestBody String email, String activationCode) {
58 | return authService.confirmActivation(email, activationCode);
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/kodlamaio/hrms/api/controllers/CandidatesController.java:
--------------------------------------------------------------------------------
1 | package kodlamaio.hrms.api.controllers;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.web.bind.annotation.GetMapping;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RestController;
9 |
10 | import kodlamaio.hrms.business.abstracts.CandidateService;
11 | import kodlamaio.hrms.core.utilities.results.DataResult;
12 | import kodlamaio.hrms.entities.concretes.Candidate;
13 |
14 | @RestController
15 | @RequestMapping("/api/candidates")
16 | public class CandidatesController {
17 |
18 | private CandidateService candidateService;
19 |
20 | @Autowired
21 | public CandidatesController(CandidateService candidateService) {
22 | super();
23 | this.candidateService = candidateService;
24 | }
25 |
26 | @GetMapping("/getall")
27 | public DataResult> getAll(){
28 | return this.candidateService.getAll();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/kodlamaio/hrms/api/controllers/CitiesController.java:
--------------------------------------------------------------------------------
1 | package kodlamaio.hrms.api.controllers;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.web.bind.annotation.GetMapping;
7 | import org.springframework.web.bind.annotation.PostMapping;
8 | import org.springframework.web.bind.annotation.RequestBody;
9 | import org.springframework.web.bind.annotation.RequestMapping;
10 | import org.springframework.web.bind.annotation.RestController;
11 |
12 | import kodlamaio.hrms.business.abstracts.CityService;
13 | import kodlamaio.hrms.core.utilities.results.DataResult;
14 | import kodlamaio.hrms.core.utilities.results.Result;
15 | import kodlamaio.hrms.entities.concretes.City;
16 |
17 | @RestController
18 | @RequestMapping("/api/cities")
19 | public class CitiesController {
20 |
21 | private CityService cityService;
22 |
23 | @Autowired
24 | public CitiesController(CityService cityService) {
25 | super();
26 | this.cityService = cityService;
27 | }
28 |
29 | @GetMapping("/getall")
30 | public DataResult> getAll(){
31 | return this.cityService.getAll();
32 | }
33 |
34 | @PostMapping("/add")
35 | public Result add(@RequestBody City city) {
36 | return this.cityService.add(city);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/kodlamaio/hrms/api/controllers/CvLanguagesController.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.ExceptionHandler;
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.CvLanguageService;
22 | import kodlamaio.hrms.core.utilities.results.DataResult;
23 | import kodlamaio.hrms.core.utilities.results.ErrorDataResult;
24 | import kodlamaio.hrms.entities.concretes.CvLanguage;
25 |
26 | @RestController
27 | @RequestMapping("/api/cvlanguages")
28 | public class CvLanguagesController {
29 |
30 | private CvLanguageService languageService;
31 |
32 | @Autowired
33 | public CvLanguagesController(CvLanguageService languageService) {
34 | super();
35 | this.languageService = languageService;
36 | }
37 |
38 |
39 | @PostMapping("/add")
40 | public ResponseEntity> add(@Valid @RequestBody CvLanguage language) {
41 | return ResponseEntity.ok(this.languageService.add(language));
42 | }
43 |
44 | @PostMapping("/getById")
45 | public DataResult getById(int languageId){
46 | return languageService.getById(languageId);
47 | }
48 |
49 | @PostMapping("/getByCvId")
50 | public DataResult> getByCvId(int cvId){
51 | return languageService.getByCvId(cvId);
52 | }
53 |
54 | @PostMapping("/getByCandidateId")
55 | public DataResult> getByCandidateId(int candidateId){
56 | return languageService.getByCandidateId(candidateId);
57 | }
58 |
59 | @ExceptionHandler(MethodArgumentNotValidException.class)
60 | @ResponseStatus(HttpStatus.BAD_REQUEST)
61 | public ErrorDataResult