-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Student Lesson Note API | SIS-118 (#68)
* errorWhenGettingAllByStudentId and errorWhenGettingAllByStudentId Methods Have Been Added to SisErrorLogMessageUtil * foundAllByLessonId and foundAllByStudentId Methods Have Been Added to SisInfoLogMessageUtil * notFoundAllByStudentId and notFoundAllByLessonId Methods Have Been Added to SisWarnLogMessageUtil * getTeacherIdByLessonId Method Has Been Added to TeacherLessonRepository * StudentLessonNoteMapping Class Has Been Created * StudentLessonNoteException Class Has Been Created * StudentLessonNoteUtil Class Has Been Created * StudentLessonNoteStatus Enum Class Has Been Created * StudentLesson Note Entity Classes Have Been Created * StudentLesson Note Request Classes Have Been Created * StudentLessonNoteResponse Class Has Been Created * StudentLessonNoteInfoConverter Class Has Been Created * TeacherLessonOutService Class Has Been Created for getTeacherIdByLessonId Method * STUDENT_LESSON_NOTE_API_TAG Has Been Added to SisSwaggerConfiguration Class * STUDENT_LESSON_NOTE Endpoint Has Been Added to SisControllerEndpoint Class * StudentLessonNote Repository Classes Have Been Created * StudentLessonNote Service Classes Have Been Created * StudentLessonNote Out Service Classes Have Been Created * StudentLessonNoteControllerEndpoint Class Has Been Created * StudentLessonNoteController Class Has Been Created * StudentLessonNoteOutService Has Been Integrated to StudentLessonRegistrationService/approveStudentLessonRegistration Method
- Loading branch information
1 parent
9fa3256
commit 139f17f
Showing
35 changed files
with
1,227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...t/studentinformationsystem/university/lesson/teacher/service/TeacherLessonOutService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.graduationproject.studentinformationsystem.university.lesson.teacher.service; | ||
|
||
public interface TeacherLessonOutService { | ||
|
||
Long getTeacherIdByLessonId(Long lessonId); | ||
} |
18 changes: 18 additions & 0 deletions
18
...informationsystem/university/lesson/teacher/service/impl/TeacherLessonOutServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.graduationproject.studentinformationsystem.university.lesson.teacher.service.impl; | ||
|
||
import com.graduationproject.studentinformationsystem.university.lesson.teacher.repository.TeacherLessonRepository; | ||
import com.graduationproject.studentinformationsystem.university.lesson.teacher.service.TeacherLessonOutService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class TeacherLessonOutServiceImpl implements TeacherLessonOutService { | ||
|
||
private final TeacherLessonRepository teacherLessonRepository; | ||
|
||
@Override | ||
public Long getTeacherIdByLessonId(Long lessonId) { | ||
return teacherLessonRepository.getTeacherIdByLessonId(lessonId); | ||
} | ||
} |
82 changes: 82 additions & 0 deletions
82
...ject/studentinformationsystem/university/note/controller/StudentLessonNoteController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.graduationproject.studentinformationsystem.university.note.controller; | ||
|
||
import com.graduationproject.studentinformationsystem.common.util.controller.response.SisBaseApiResponse; | ||
import com.graduationproject.studentinformationsystem.common.util.exception.SisNotExistException; | ||
import com.graduationproject.studentinformationsystem.university.note.controller.endpoint.StudentLessonNoteControllerEndpoint; | ||
import com.graduationproject.studentinformationsystem.university.note.model.dto.request.StudentLessonFinalNoteUpdateRequest; | ||
import com.graduationproject.studentinformationsystem.university.note.model.dto.request.StudentLessonMidtermNoteUpdateRequest; | ||
import com.graduationproject.studentinformationsystem.university.note.model.dto.request.StudentLessonResitNoteUpdateRequest; | ||
import com.graduationproject.studentinformationsystem.university.note.model.dto.response.StudentLessonNoteResponse; | ||
import com.graduationproject.studentinformationsystem.university.note.service.StudentLessonNoteService; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import javax.validation.Valid; | ||
import java.util.List; | ||
|
||
import static com.graduationproject.studentinformationsystem.common.config.SisSwaggerConfiguration.STUDENT_LESSON_NOTE_API_TAG; | ||
import static com.graduationproject.studentinformationsystem.common.util.controller.endpoint.SisControllerEndpoint.Path.STUDENT_LESSON_NOTE; | ||
import static com.graduationproject.studentinformationsystem.common.util.controller.response.SisResponseUtil.successResponse; | ||
|
||
@RestController | ||
@RequestMapping(STUDENT_LESSON_NOTE) | ||
@Api(tags = STUDENT_LESSON_NOTE_API_TAG) | ||
@RequiredArgsConstructor | ||
public class StudentLessonNoteController { | ||
|
||
|
||
private final StudentLessonNoteService studentLessonNoteService; | ||
|
||
@GetMapping(StudentLessonNoteControllerEndpoint.GET_ALL_BY_LESSON_ID) | ||
@ApiOperation(value = "Get All Students Lessons Notes By Lesson ID") | ||
public ResponseEntity<SisBaseApiResponse<List<StudentLessonNoteResponse>>> getAllStudentsLessonsNotesByLessonId( | ||
@PathVariable final Long lessonId) | ||
throws SisNotExistException { | ||
|
||
final List<StudentLessonNoteResponse> noteResponses = studentLessonNoteService.getAllStudentsLessonsNotesByLessonId(lessonId); | ||
return successResponse(noteResponses); | ||
} | ||
|
||
@GetMapping(StudentLessonNoteControllerEndpoint.GET_ALL_BY_STUDENT_ID) | ||
@ApiOperation(value = "Get All Student Lessons Notes By Student ID") | ||
public ResponseEntity<SisBaseApiResponse<List<StudentLessonNoteResponse>>> getAllStudentLessonsNotesByStudentId( | ||
@PathVariable final Long studentId) | ||
throws SisNotExistException { | ||
|
||
final List<StudentLessonNoteResponse> noteResponses = studentLessonNoteService.getAllStudentLessonsNotesByStudentId(studentId); | ||
return successResponse(noteResponses); | ||
} | ||
|
||
@PutMapping(StudentLessonNoteControllerEndpoint.MIDTERM) | ||
@ApiOperation(value = "Update Student Lesson Midterm Note") | ||
public ResponseEntity<SisBaseApiResponse<StudentLessonNoteResponse>> updateStudentLessonMidtermNote( | ||
@RequestBody @Valid final StudentLessonMidtermNoteUpdateRequest updateRequest) | ||
throws SisNotExistException { | ||
|
||
final StudentLessonNoteResponse noteResponse = studentLessonNoteService.updateStudentLessonMidtermNote(updateRequest); | ||
return successResponse(noteResponse); | ||
} | ||
|
||
@PutMapping(StudentLessonNoteControllerEndpoint.FINAL) | ||
@ApiOperation(value = "Update Student Lesson Final Note") | ||
public ResponseEntity<SisBaseApiResponse<StudentLessonNoteResponse>> updateStudentLessonFinalNote( | ||
@RequestBody @Valid final StudentLessonFinalNoteUpdateRequest updateRequest) | ||
throws SisNotExistException { | ||
|
||
final StudentLessonNoteResponse noteResponse = studentLessonNoteService.updateStudentLessonFinalNote(updateRequest); | ||
return successResponse(noteResponse); | ||
} | ||
|
||
@PutMapping(StudentLessonNoteControllerEndpoint.RESIT) | ||
@ApiOperation(value = "Update Student Lesson Resit Note") | ||
public ResponseEntity<SisBaseApiResponse<StudentLessonNoteResponse>> updateStudentLessonResitNote( | ||
@RequestBody final StudentLessonResitNoteUpdateRequest updateRequest) | ||
throws SisNotExistException { | ||
|
||
final StudentLessonNoteResponse noteResponse = studentLessonNoteService.updateStudentLessonResitNote(updateRequest); | ||
return successResponse(noteResponse); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...mationsystem/university/note/controller/endpoint/StudentLessonNoteControllerEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.graduationproject.studentinformationsystem.university.note.controller.endpoint; | ||
|
||
public class StudentLessonNoteControllerEndpoint { | ||
|
||
private StudentLessonNoteControllerEndpoint() { | ||
} | ||
|
||
private static final String ID = "/{id}"; | ||
private static final String STUDENT_ID = "/{studentId}"; | ||
private static final String LESSON_ID = "/{lessonId}"; | ||
// public static final String GET_BY_ID = "/get" + ID; | ||
public static final String GET_ALL_BY_STUDENT_ID = "/get/student" + STUDENT_ID; | ||
public static final String GET_ALL_BY_LESSON_ID = "/get/lesson" + LESSON_ID; | ||
public static final String MIDTERM = "/midterm"; | ||
public static final String FINAL = "/final"; | ||
public static final String RESIT = "/resit"; | ||
} |
Oops, something went wrong.