Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Deep Dey
LaMartin-Webomagic
Commits
90614abe
Commit
90614abe
authored
Jul 02, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add option to schedu interview for multiple candidates
parent
b20eadaa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
...aMartin/admission/controller/AdmissionFormController.java
+23
-4
No files found.
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
View file @
90614abe
...
...
@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import
javax.validation.Valid
;
import
java.io.ByteArrayInputStream
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -81,14 +82,32 @@ public class AdmissionFormController {
public
Object
setAdmissionInterview
(
HttpServletRequest
request
,
@RequestHeader
(
"apikey"
)
String
apiKey
,
@RequestParam
(
defaultValue
=
"
0"
)
Long
formId
,
@RequestParam
(
defaultValue
=
"
"
)
String
formIds
,
@RequestParam
(
"interactionDate"
)
String
interactionDate
,
@RequestParam
(
"interactionTime"
)
String
interactionTime
)
throws
Exception
{
List
<
Long
>
formIdList
=
Stream
.
of
(
formIds
.
split
(
","
))
.
map
(
Long:
:
valueOf
)
.
toList
();
if
(
formIdList
.
isEmpty
())
{
throw
new
Exception
(
"Provide formIds to schedule interview"
);
}
AtomicBoolean
partiallyFailed
=
new
AtomicBoolean
(
false
);
formIdList
.
forEach
(
formId
->
{
try
{
if
(!
admissionFormDAOController
.
updateInteractionDateTime
(
formId
,
interactionDate
,
interactionTime
))
{
throw
new
Exception
(
"Failed to set interview date and time"
);
partiallyFailed
.
set
(
true
);
}
}
catch
(
Exception
e
)
{
partiallyFailed
.
set
(
true
);
}
});
if
(
partiallyFailed
.
get
())
{
throw
new
Exception
(
"For Some of the forms failed to schedule interview"
);
}
return
new
ResponseEntity
<>(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment