Skip to content

Commit

Permalink
SIS API v1.0.0 Deploy to Live (#45)
Browse files Browse the repository at this point in the history
* All Classes Have Been Refactored | SIS-44 (#35)

* Teacher Lesson API Has Been Created

* Teacher and Student Responses Have Been Formatted

* TeacherDegree Has Been Fixed

* LoginRepository Has Been Fixed in Teacher Mail Service Impl Class

* LessonCompulsoryOrElective Enum Class Has Been Moved to common Package

* Empty Class Has Been Deleted

* Another Response Formats Have Been Fixed

* SisUtil/isNotExistIdInIdList Method Has Been Refactored

* Unused @Setter Annotations Have Been Deleted

* Created and Modified Date and UserID Fields Have Been Fixed

* Student Requests Have Been Refactored

* Student Info Converters Have Been Refactored and Updated

* Student Services Have Been Refactored and Updated for Operation Info Request

* StudentController and StudentControllerEndpoint Have Been Refactored and Updated for Operation Info Request

* Sis Util Has Been Refactored

* TeacherSaveInfoRequest Has Been Renamed and SisOperationInfoRequest Has Been Added to TeacherSaveInfoRequest

* Hikari Configuration Codes Have Been Refactored

* Sis Exception Codes Have Been Refactored

* SisResponseUtil Class Has Been Refactored

* SisLogMessageUtil Classes Have Been Refactored

* SisSqlUtil Class Has Been Refactored

* SisUtil Class Has Been Refactored

* Password Service Classes Have Been Refactored

* Officer Login Classes Have Been Refactored

* LessonConverter Class Has Been Refactored

* SisBaseResponse Has Been Refactored

* SisOperationInfoRequest Has Been Refactored

* Mail Services Have Been Refactored

* Mail Entity Has Been Renamed

* All Classes Have Been Refactored in Teacher Package

* TeacherAcademicInfoRequest Class Has Been Refactored

* notFoundAllIdsByStatus Method Has Been Added to SisWarnLogMessageUtil Class

* All Classes Have Been Refactored in Login Package

* All Classes Have Been Refactored in Parameter Package

* Sis Response Classes Have Been Refactored

* All Classes Have Been Refactored in Student Package

* All Classes Have Been Refactored in Teacher Lesson Package

* All Classes Have Been Refactored in Validation Package

* Date Requests Has Been Fixed | SIS-74 (#36)

* Date Patterns Have Been Refactored and Merged to Constants

* SisBasePersonalInfoRequest/birthday Date Pattern Has Been Fixed

* Officer API Has Been Created | SIS-23 (#37)

* Officer Mapping Classes Have Been Created

* Officer Entity Classes Have Been Created

* Officer Status Enum Class Has Been Created

* Officer Util Class Has Been Created

* Officer Exception Class Has Been Created

* Officer Request Classes Have Been Created

* Officer Response Classes Have Been Created

* Officer Personal Repository Classes Have Been Created

* Officer Academic Repository Classes Have Been Created

* Officer DTO Converter Classes Have Been Created

* Officer Academic Service Classes Have Been Created

* Officer Personal Service Classes Have Been Created

* Officer Service Classes Have Been Created

* Officer Controller Classes Have Been Created

* FacultyID Validation Classes Have Been Created

* getFormattedDate Method Has Been Added to SisUtil Class

* errorWhenGettingAllIdsByFacultyId Method Has Been Added to SisErrorLogMessageUtil Class

* foundAllIdsByFacultyId Method Has Been Added to SisInfoLogMessageUtil Class

* notFoundAllIdsByFacultyId Method Has Been Added to SisWarnLogMessageUtil Class

* Officer API Tag Has Been Added to SisSwaggerConfiguration

* Officer Path Has Been Added to SisControllerEndpoint Class

* Officer Mail Service Classes Have Been Created

* Fixes and Code Refactor (#38)

* Officer Mapping Classes Have Been Created

* Officer Entity Classes Have Been Created

* Officer Status Enum Class Has Been Created

* Officer Util Class Has Been Created

* Officer Exception Class Has Been Created

* Officer Request Classes Have Been Created

* Officer Response Classes Have Been Created

* Officer Personal Repository Classes Have Been Created

* Officer Academic Repository Classes Have Been Created

* Officer DTO Converter Classes Have Been Created

* Officer Academic Service Classes Have Been Created

* Officer Personal Service Classes Have Been Created

* Officer Service Classes Have Been Created

* Officer Controller Classes Have Been Created

* FacultyID Validation Classes Have Been Created

* getFormattedDate Method Has Been Added to SisUtil Class

* errorWhenGettingAllIdsByFacultyId Method Has Been Added to SisErrorLogMessageUtil Class

* foundAllIdsByFacultyId Method Has Been Added to SisInfoLogMessageUtil Class

* notFoundAllIdsByFacultyId Method Has Been Added to SisWarnLogMessageUtil Class

* Officer API Tag Has Been Added to SisSwaggerConfiguration

* Officer Path Has Been Added to SisControllerEndpoint Class

* Officer Mail Service Classes Have Been Created

* Student/Teacher Mail Service Classes Have Been Refactored

* Response Classes Have Been Refactored

* PasswordService Class Has Been Refactored

* StudentLoginController Class Has Been Refactored

* StudentLoginMapping Class Has Been Refactored

* StudentLoginRepository Class Has Been Refactored

* StudentLoginRepositoryImpl Class Has Been Refactored

* TeacherLoginController Class Has Been Refactored

* Login Info Entity Classes Have Been Refactored

* TeacherLoginMapping Class Has Been Refactored

* TeacherLoginRepository Class Has Been Refactored

* OfficerLoginRepository Class Has Been Refactored

* TeacherLoginRepositoryImpl Class Has Been Refactored

* All Request Classes Have Been Refactored with Serializable

* phoneNumber Has Been Added to OfficerAcademicInfoResponse

* Dependency Versions Have Been Updated And Fixes (#39)

* Dependency Versions Have Been Updated

* Login Info Entity Classes Have Been Fixed

* phoneNumber Has Been Added to OfficerAcademicInfoResponse

* OfficerPersonalInfoConverter Class Has Been Refactored

* Officer Login API | SIS-75 (#40)

* sendFirstPasswordEmail Has Been Activated for Officer

* Officer Login API Has Been Activated and Fixes

* University API - Fixes - Refactor | SIS-50 (#41)

* SisBaseEntity Class Has Been Refactored

* SisBaseEntityWithId Class Has Been Deleted Because It's Unused

* SisBaseResponse Class Has Been Refactored

* OperationUserID Validation Classes Have Been Created

* Faculty API Tag Has Been Added to SisSwaggerConfiguration Class

* Faculty Endpoint Variable Has Been Added to SisControllerEndpoint Class

* Student/Teacher/Officer Info Converter Classes Have Been Refactored

* errorWhenGettingAllIds Method Has Been Added to SisErrorLogMessageUtil Class

* foundAllIds Method Has Been Added to SisInfoLogMessageUtil Class

* notFoundAllIds Method Has Been Added to SisWarnLogMessageUtil Class

* SisOperationInfoRequest Class Has Been Refactored

* FacultyMapping Class Has Been Created

* FacultyUtil Class Has Been Created

* FacultyStatus Class Has Been Created

* FacultyEntity Class Has Been Created

* Faculty Request Classes Have Been Created

* FacultyResponse Class Has Been Created

* FacultyException Class Has Been Created

* Faculty Repository Classes Have Been Created

* Faculty Service Classes Have Been Created

* Faculty Controller Classes Have Been Created

* OneOrZero Validation Has Been Created and NumberValidation Has Been Deleted Because It's Unused

* integerToBoolean Method Has Been Added to SisUtil Class

* Faculty/entity Package Move to Under Faculty/model Package

* FacultyInfoConverter Class Has Been Refactored

* Faculty/entity Package Move to Under Faculty/model Package

* FacultyServiceImpl Class Has Been Refactored

* Student/Teacher/Officer Info Converter Classes Have Been Refactored

* DepartmentMapping Class Has Been Created

* DepartmentStatus Enum Class Has Been Created

* DepartmentEntity Class Has Been Created

* Department Request Classes Have Been Created

* DepartmentResponse Class Has Been Created

* DepartmentInfoConverter Class Has Been Created

* DepartmentException Class Has Been Created

* DepartmentUtil Class Has Been Created

* Department Repository Classes Have Been Created

* Department Service Classes Have Been Created

* Department Controller Classes Have Been Created

* LessonMapping Class Has Been Created

* Lesson Enums Have Been Created

* LessonException Class Has Been Created

* LessonUtil Class Has Been Created

* LessonEntity Class Has Been Created

* Lesson Request Classes Have Been Created

* Lesson Response Class Has Been Refactored

* LessonInfoConverter Class Has Been Refactored and Updated

* Lesson Repository Classes Have Been Created

* Lesson Service Classes Have Been Created

* Lesson Controller Classes Have Been Created

* TeacherLessonEntity Class Has Been Refactored and Updated

* TeacherLessonConverter Class Has Been Refactored and Updated

* TeacherLessonResponse Class Has Been Refactored and Updated

* Teacher Lesson Repository Classes Have Been Refactored and Updated

* Teacher Lesson Service Classes Have Been Refactored and Updated

* Teacher Lesson Controller Classes Have Been Refactored and Updated

* SisSwaggerConfiguration Class Has Been Refactored and Updated

* SisControllerEndpoint Class Has Been Refactored and Updated

* Teacher Lesson API Refactor | SIS-76 (#42)

* Controller Endpoint Fixes | SIS-77 (#43)

* Officer Controller Endpoints Have Been Fixed

* Student Controller Endpoints Have Been Fixed

* Teacher Controller Endpoints Have Been Fixed

* API Responses Update | SIS-73 (#44)

* FacultyResponse Have Been Added to Department API Response and Refactored

* DepartmentServiceImpl Class Has Been Refactored

* DepartmentResponse Have Been Added to Student API Response and Refactored

* DepartmentResponse Have Been Added to Student API Response and Refactored

* DepartmentResponse Have Been Added to Teacher API Response and Refactored

* FacultyResponse Have Been Added to Officer API Response and Refactored

* DepartmentResponse Have Been Added to Lesson API Response and Refactored

* DepartmentResponse Have Been Added to Teacher Lesson API Response and Refactored

* API Tags Have Been Refactored in SisSwaggerConfiguration
  • Loading branch information
agitrubard authored Feb 1, 2022
1 parent 87fe324 commit 75621a2
Show file tree
Hide file tree
Showing 276 changed files with 8,393 additions and 1,429 deletions.
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<version>2.5.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.graduation-project</groupId>
<artifactId>student-information-system-be</artifactId>
<version>v1.0.0</version>
<packaging>war</packaging>
<name>Student Information System</name>
<description>Student Information System for Higher Education</description>

<developers>
<developer>
<name>Agit Rubar Demir</name>
Expand All @@ -32,9 +34,10 @@
</roles>
</developer>
</developers>

<properties>
<java.version>17</java.version>
<log4j2.version>2.15.0</log4j2.version>
<log4j2.version>2.17.1</log4j2.version>
<mysql-connector-java.version>8.0.26</mysql-connector-java.version>
<sql2o.version>1.6.0-RC3</sql2o.version>
<hikari.version>5.0.0</hikari.version>
Expand All @@ -47,6 +50,7 @@
<javax.mail.version>1.6.2</javax.mail.version>
<spring-security-crypto.version>5.6.0</spring-security-crypto.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -145,12 +149,12 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.6</version>
<version>1.2.7</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.6</version>
<version>1.2.7</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,50 @@

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;

@Slf4j
@Getter
@Setter
@Builder
public class SisHikariConfigProfileDto {
private String username;
private String password;
private String maxPoolSize;
private String tnsJdbcUrl;
private String driverClassName;
private String connectionTimeout;
private String maxLifetime;

public static void checkProfileVariables(SisHikariConfigProfileDto hikariConfigProfile) {
private final String username;
private final String password;
private final String maxPoolSize;
private final String tnsJdbcUrl;
private final String driverClassName;
private final String connectionTimeout;
private final String maxLifetime;

public static void checkProfileVariables(final SisHikariConfigProfileDto hikariConfigProfile) {
if (!StringUtils.hasText(hikariConfigProfile.getUsername())) {
String message = "Hikari username Cannot be Empty!";
final String message = "Hikari username Cannot be Empty!";
log.error(message);
throw new NullPointerException(message);
}
if (!StringUtils.hasText(hikariConfigProfile.getPassword())) {
String message = "Hikari password Cannot be Empty!";
final String message = "Hikari password Cannot be Empty!";
log.error(message);
throw new NullPointerException(message);
}
if (!StringUtils.hasText(hikariConfigProfile.getTnsJdbcUrl())) {
String message = "Hikari tnsJdbcUrl Cannot be Empty!";
final String message = "Hikari tnsJdbcUrl Cannot be Empty!";
log.error(message);
throw new NullPointerException(message);
}
if (!StringUtils.hasText(hikariConfigProfile.getMaxPoolSize())) {
String message = "Hikari maxPoolSize Cannot be Empty!";
final String message = "Hikari maxPoolSize Cannot be Empty!";
log.error(message);
throw new NullPointerException(message);
}
if (!StringUtils.hasText(hikariConfigProfile.getConnectionTimeout())) {
String message = "Hikari connectionTimeout Cannot be Empty!";
final String message = "Hikari connectionTimeout Cannot be Empty!";
log.error(message);
throw new NullPointerException(message);
}
if (!StringUtils.hasText(hikariConfigProfile.getMaxLifetime())) {
String message = "Hikari maxLifetime Cannot be Empty!";
final String message = "Hikari maxLifetime Cannot be Empty!";
log.error(message);
throw new NullPointerException(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class SisHikariConfiguration {
private SisHikariConfiguration() {
}

public static HikariConfig getHikariConfigBaseValues(SisHikariConfigProfileDto hikariConfigProfileDto) {
HikariConfig hikariConfig = new HikariConfig();
public static HikariConfig getHikariConfigBaseValues(final SisHikariConfigProfileDto hikariConfigProfileDto) {
final HikariConfig hikariConfig = new HikariConfig();

hikariConfig.setUsername(hikariConfigProfileDto.getUsername());
hikariConfig.setPassword(hikariConfigProfileDto.getPassword());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public class SisMysqlHikariConfiguration {
public DataSource hikariMysql() {
log.debug("Hikari MySQL Datasource Configuration Call Started!");

SisHikariConfigProfileDto hikariConfigMysqlProfile = getHikariConfigProfile(environment);
final SisHikariConfigProfileDto hikariConfigMysqlProfile = getHikariConfigProfile(environment);

SisHikariConfigProfileDto.checkProfileVariables(hikariConfigMysqlProfile);

HikariConfig hikariConfigMysql = getHikariConfig(hikariConfigMysqlProfile);
final HikariConfig hikariConfigMysql = getHikariConfig(hikariConfigMysqlProfile);

log.debug("Hikari MySQL Datasource Successfully Configured!");
return new HikariDataSource(hikariConfigMysql);
Expand All @@ -40,7 +40,7 @@ Sql2o sql2oMysql(DataSource hikariMysql) {
return new Sql2o(hikariMysql);
}

private static SisHikariConfigProfileDto getHikariConfigProfile(Environment environment) {
private static SisHikariConfigProfileDto getHikariConfigProfile(final Environment environment) {
return SisHikariConfigProfileDto.builder()
.username(environment.getProperty("hikariMysql.username"))
.password(environment.getProperty("hikariMysql.password"))
Expand All @@ -51,7 +51,7 @@ private static SisHikariConfigProfileDto getHikariConfigProfile(Environment envi
.maxLifetime(environment.getProperty("hikari.maxLifetime")).build();
}

private static HikariConfig getHikariConfig(SisHikariConfigProfileDto hikariConfigProfileDto) {
private static HikariConfig getHikariConfig(final SisHikariConfigProfileDto hikariConfigProfileDto) {
return SisHikariConfiguration.getHikariConfigBaseValues(hikariConfigProfileDto);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
@Configuration
public class SisSwaggerConfiguration {

public static final String LOGIN_API_TAG = "Login Controller";
public static final String FACULTY_API_TAG = "Faculty Controller";
public static final String DEPARTMENT_API_TAG = "Department Controller";
public static final String LESSON_API_TAG = "Lesson Controller";
public static final String STUDENT_API_TAG = "Student Controller";
public static final String TEACHER_API_TAG = "Teacher Controller";
public static final String TEACHER_LESSON_API_TAG = "Teacher Lesson Controller";
public static final String OFFICER_API_TAG = "Officer Controller";
public static final String LOGIN_API_TAG = "Login Controller";

@Bean
public Docket api() {
Expand All @@ -25,9 +30,14 @@ public Docket api() {
.paths(PathSelectors.regex("/.*"))
.build().apiInfo(apiEndPointsInfo())
.tags(
new Tag(LOGIN_API_TAG, "AUTH_STUDENT_LOGIN & AUTH_TEACHER_LOGIN & AUTH_OFFICER_LOGIN"),
new Tag(FACULTY_API_TAG, "UNIV_FACULTY"),
new Tag(DEPARTMENT_API_TAG, "UNIV_DEPARTMENT"),
new Tag(LESSON_API_TAG, "UNIV_LESSON"),
new Tag(STUDENT_API_TAG, "STUDENT_ACADEMIC_INFO & STUDENT_PERSONAL_INFO"),
new Tag(TEACHER_API_TAG, "TEACHER_ACADEMIC_INFO & TEACHER_PERSONAL_INFO")
new Tag(TEACHER_API_TAG, "TEACHER_ACADEMIC_INFO & TEACHER_PERSONAL_INFO"),
new Tag(TEACHER_LESSON_API_TAG, "TEACHER_LESSON"),
new Tag(OFFICER_API_TAG, "OFFICER_ACADEMIC_INFO & OFFICER_PERSONAL_INFO"),
new Tag(LOGIN_API_TAG, "AUTH_STUDENT_LOGIN & AUTH_TEACHER_LOGIN & AUTH_OFFICER_LOGIN")
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
package com.graduationproject.studentinformationsystem.common.model.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.graduationproject.studentinformationsystem.common.util.validation.*;
import lombok.Getter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

import static com.graduationproject.studentinformationsystem.common.util.constant.SisConstants.DATE_PATTERN;

@Getter
public abstract class SisBasePersonalInfoRequest {
public abstract class SisBasePersonalInfoRequest implements Serializable {

@Serial
private static final long serialVersionUID = 8140330376859399691L;

@TCNO
@NotNull
Expand Down Expand Up @@ -37,7 +44,7 @@ public abstract class SisBasePersonalInfoRequest {
// protected String profilePhotoUrl; // TODO: Added Profile Photo URL

@NotNull
@DateTimeFormat
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DATE_PATTERN)
protected Date birthday;

@Address
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.graduationproject.studentinformationsystem.common.model.dto.request;

import com.graduationproject.studentinformationsystem.common.util.validation.id.OperationUserID;
import lombok.Getter;

import javax.validation.constraints.NotNull;
import java.io.Serial;
import java.io.Serializable;

@Getter
public class SisOperationInfoRequest implements Serializable {

@Serial
private static final long serialVersionUID = 4343452158117045893L;

@NotNull
@OperationUserID
private Long userId;
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.graduationproject.studentinformationsystem.common.model.dto.response;

import lombok.Getter;

import java.util.Date;
import lombok.experimental.SuperBuilder;

@Getter
@SuperBuilder
public abstract class SisBaseResponse {

protected Date createdDate;
protected Long createdUserId;
protected Date modifiedDate;
protected String createdDate;
protected Long modifiedUserId;
protected String modifiedDate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
@SuperBuilder
public abstract class SisBaseEntity {

protected Date createdDate;
protected Long createdUserId;
protected Date modifiedDate;
protected Date createdDate;
protected Long modifiedUserId;
protected Date modifiedDate;
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.graduationproject.studentinformationsystem.common.model.entity;

import lombok.Getter;
import lombok.experimental.SuperBuilder;

import java.util.Date;

@Getter
@SuperBuilder
public abstract class SisBaseLoginInfoEntity {

protected Integer failCounter;
protected Date lastLoginDate;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package com.graduationproject.studentinformationsystem.common.model.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum SisStatus {
ACTIVE,
PASSIVE,
DELETED,
ALL
ACTIVE("Aktif"),
PASSIVE("Pasif"),
DELETED("Silinmiş"),
ALL("Hepsi");

private final String name;
}
Loading

0 comments on commit 75621a2

Please sign in to comment.