Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Refactor #62

Merged
merged 4 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class DepartmentController {
private final DepartmentService departmentService;

@GetMapping
@ApiOperation(value = "Get All Department By Status")
@ApiOperation(value = "Get All Departments By Status")
public ResponseEntity<SisBaseApiResponse<List<DepartmentResponse>>> getAllDepartmentsByStatus(
final DepartmentStatus status) {
@RequestParam final DepartmentStatus status) {

final List<DepartmentResponse> departmentResponses = departmentService.getAllDepartmentsByStatus(status);
return successResponse(departmentResponses);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.graduationproject.studentinformationsystem.university.department.repository.impl.scripts;

import com.graduationproject.studentinformationsystem.common.util.sql.SisSqlUtil;
import com.graduationproject.studentinformationsystem.university.officer.model.enums.OfficerStatus;
import com.graduationproject.studentinformationsystem.university.department.model.enums.DepartmentStatus;

import static com.graduationproject.studentinformationsystem.university.department.model.mapping.DepartmentMapping.DEPARTMENT_ID;

Expand Down Expand Up @@ -99,7 +99,7 @@ private DepartmentSqlScripts() {
.isExistByColumnNameAndStatus("UNIV_DEPARTMENT",
DEPARTMENT_ID.getColumnName(),
DEPARTMENT_ID.getModelName(),
OfficerStatus.DELETED.toString());
DepartmentStatus.DELETED.toString());

/**
* SELECT CASE WHEN MAX(DEPARTMENT_ID) IS NULL THEN 'false' ELSE 'true' END IS_EXIST
Expand All @@ -109,7 +109,7 @@ private DepartmentSqlScripts() {
.isExistByColumnNameAndStatus("UNIV_DEPARTMENT",
DEPARTMENT_ID.getColumnName(),
DEPARTMENT_ID.getModelName(),
OfficerStatus.PASSIVE.toString());
DepartmentStatus.PASSIVE.toString());

/**
* SELECT CASE WHEN MAX(DEPARTMENT_ID) IS NULL THEN 'false' ELSE 'true' END IS_EXIST
Expand All @@ -119,5 +119,5 @@ private DepartmentSqlScripts() {
.isExistByColumnNameAndStatus("UNIV_DEPARTMENT",
DEPARTMENT_ID.getColumnName(),
DEPARTMENT_ID.getModelName(),
OfficerStatus.ACTIVE.toString());
DepartmentStatus.ACTIVE.toString());
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class FacultyController {
private final FacultyService facultyService;

@GetMapping
@ApiOperation(value = "Get All Faculty By Status")
@ApiOperation(value = "Get All Faculties By Status")
public ResponseEntity<SisBaseApiResponse<List<FacultyResponse>>> getAllFacultiesByStatus(
final FacultyStatus status) {
@RequestParam final FacultyStatus status) {

final List<FacultyResponse> facultyResponses = facultyService.getAllFacultiesByStatus(status);
return successResponse(facultyResponses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class LessonController {
private final LessonService lessonService;

@GetMapping
@ApiOperation(value = "Get All Lesson By Status")
@ApiOperation(value = "Get All Lessons By Status")
public ResponseEntity<SisBaseApiResponse<List<LessonResponse>>> getAllFacultiesByStatus(
final LessonStatus status) {
@RequestParam final LessonStatus status) {

final List<LessonResponse> lessonResponses = lessonService.getAllLessonsByStatus(status);
return successResponse(lessonResponses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public ResponseEntity<SisBaseApiResponse<List<TeacherLessonResponse>>> getAllTea
return successResponse(lessonResponses);
}

@GetMapping(TeacherLessonControllerEndpoint.GET)
@GetMapping(TeacherLessonControllerEndpoint.GET_BY_TEACHER_ID)
@ApiOperation(value = "Get Teacher All Lessons By Teacher ID")
public ResponseEntity<SisBaseApiResponse<List<TeacherLessonResponse>>> getTeacherLessonsById(
@RequestParam final Long teacherId) {
@PathVariable final Long teacherId) {

final List<TeacherLessonResponse> lessonResponses = lessonService.getTeacherLessonsById(teacherId);
return successResponse(lessonResponses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public class TeacherLessonControllerEndpoint {
private TeacherLessonControllerEndpoint() {
}

public static final String TEACHER_ID = "/{teacherId}";
public static final String GET = "/get";
private static final String TEACHER_ID = "/{teacherId}";
public static final String GET_BY_TEACHER_ID = "/get" + TEACHER_ID;
public static final String SAVE = "/save";
public static final String DELETE = "/delete";
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ public enum TeacherLessonMapping {

TEACHER_ID("TEACHER_ID", "teacherId"),
LESSON_ID("LESSON_ID", "lessonId"),
DEPARTMENT_ID("DEPARTMENT_ID", "departmentId"),
NAME("NAME", "name"),
SEMESTER("SEMESTER", "semester"),
CREDIT("CREDIT", "credit"),
COMPULSORY_OR_ELECTIVE("COMPULSORY_OR_ELECTIVE", "compulsoryOrElective"),
STATUS("STATUS", "status"),
CREATED_DATE("CREATED_DATE", "createdDate"),
CREATED_USER_ID("CREATED_USER_ID", "createdUserId");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class OfficerController {
private final OfficerService officerService;

@GetMapping
@ApiOperation(value = "Get All Officer By Status")
@ApiOperation(value = "Get All Officers By Status")
public ResponseEntity<SisBaseApiResponse<List<OfficerInfoResponse>>> getAllOfficersByStatus(
final OfficerStatus status) {
@RequestParam final OfficerStatus status) {

final List<OfficerInfoResponse> infoResponses = officerService.getAllOfficersByStatus(status);
return successResponse(infoResponses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class StudentController {
private final StudentService studentService;

@GetMapping
@ApiOperation(value = "Get All Student By Status")
@ApiOperation(value = "Get All Students By Status")
public ResponseEntity<SisBaseApiResponse<List<StudentInfoResponse>>> getAllStudentsByStatus(
final StudentStatus status) {
@RequestParam final StudentStatus status) {

final List<StudentInfoResponse> infoResponses = studentService.getAllStudentsByStatus(status);
return successResponse(infoResponses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class TeacherController {
private final TeacherService teacherService;

@GetMapping
@ApiOperation(value = "Get All Teacher By Status")
@ApiOperation(value = "Get All Teachers By Status")
public ResponseEntity<SisBaseApiResponse<List<TeacherInfoResponse>>> getAllTeachersByStatus(
final TeacherStatus status) {
@RequestParam final TeacherStatus status) {

final List<TeacherInfoResponse> infoResponses = teacherService.getAllTeachersByStatus(status);
return successResponse(infoResponses);
Expand Down