Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
examsAndAdmissions
Commits
0b31c496
Commit
0b31c496
authored
1 year ago
by
Radheshhathwar
Browse files
Options
Download
Patches
Plain Diff
CHanged request params for result api
parent
313cbbcb
github/fork/ruksana2808/filter_bug_examCycle
development
1 merge request
!170
CHanged request params for result api
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/StudentResultController.java
+2
-2
...xamsAndAdmissions/controller/StudentResultController.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/repository/StudentRepository.java
+4
-0
...psmf/examsAndAdmissions/repository/StudentRepository.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/StudentResultService.java
+3
-2
...psmf/examsAndAdmissions/service/StudentResultService.java
with
9 additions
and
4 deletions
+9
-4
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/StudentResultController.java
+
2
−
2
View file @
0b31c496
...
...
@@ -48,8 +48,8 @@ public class StudentResultController {
}
@GetMapping
(
"/results"
)
public
ResponseEntity
<
ResponseDto
>
viewResults
(
@RequestParam
String
enrolmentNumber
,
@RequestParam
Long
examCycleId
)
{
return
new
ResponseEntity
<>(
studentResultService
.
findBy
EnrollmentNumberAndDateOfBirth
(
enrolmentNumber
,
examCycleId
),
HttpStatus
.
OK
);
public
ResponseEntity
<
ResponseDto
>
viewResults
(
@RequestParam
Long
StudentId
,
@RequestParam
Long
examCycleId
)
{
return
new
ResponseEntity
<>(
studentResultService
.
findBy
StudentIdAndExamCycleId
(
StudentId
,
examCycleId
),
HttpStatus
.
OK
);
}
@PostMapping
(
"/requestRetotalling"
)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/repository/StudentRepository.java
+
4
−
0
View file @
0b31c496
...
...
@@ -3,6 +3,8 @@ package com.tarento.upsmf.examsAndAdmissions.repository;
import
com.tarento.upsmf.examsAndAdmissions.model.Student
;
import
com.tarento.upsmf.examsAndAdmissions.enums.VerificationStatus
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
java.time.LocalDate
;
...
...
@@ -18,4 +20,6 @@ public interface StudentRepository extends JpaRepository<Student, Long> {
Optional
<
Student
>
findByEnrollmentNumber
(
String
enrollmentNumber
);
Optional
<
Student
>
findByKeycloakId
(
String
keycloakId
);
@Query
(
"SELECT s.enrollmentNumber FROM Student s WHERE s.id = :studentId"
)
String
getEnrollmentNumberById
(
@Param
(
"studentId"
)
Long
studentId
);
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/StudentResultService.java
+
3
−
2
View file @
0b31c496
...
...
@@ -406,11 +406,12 @@ public class StudentResultService {
return
response
;
}
public
ResponseDto
findBy
EnrollmentNumberAndDateOfBirth
(
String
enrollmentNumber
,
Long
examCycleId
)
{
public
ResponseDto
findBy
StudentIdAndExamCycleId
(
Long
studentId
,
Long
examCycleId
)
{
ResponseDto
response
=
new
ResponseDto
(
Constants
.
API_FIND_BY_ENROLLMENT_NUMBER_AND_DOB
);
// List<StudentResult> studentResultList = studentResultRepository.findByStudent_EnrollmentNumberAndExamCycle_IdAndPublished(enrollmentNumber, examCycleId, true);
String
examCycleName
=
examCycleRepository
.
getExamCycleNameById
(
examCycleId
);
String
enrollmentNumber
=
studentRepository
.
getEnrollmentNumberById
(
studentId
);
List
<
StudentResult
>
studentResultList
=
studentResultRepository
.
findByStudent_EnrollmentNumberAndExamCycleNameAndPublished
(
enrollmentNumber
,
examCycleName
,
true
);
if
(!
studentResultList
.
isEmpty
())
{
...
...
@@ -420,7 +421,7 @@ public class StudentResultService {
response
.
put
(
Constants
.
RESPONSE
,
studentResultDTO
);
response
.
setResponseCode
(
HttpStatus
.
OK
);
}
else
{
ResponseDto
.
setErrorResponse
(
response
,
"RESULT_NOT_FOUND"
,
"No result found for the given enrollment number and
date of birth
."
,
HttpStatus
.
NOT_FOUND
);
ResponseDto
.
setErrorResponse
(
response
,
"RESULT_NOT_FOUND"
,
"No result found for the given enrollment number and
examCycle
."
,
HttpStatus
.
NOT_FOUND
);
}
return
response
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets