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
2e26815c
Commit
2e26815c
authored
Aug 28, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add api to perform admission form submit
parent
b17f3ac3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
36 deletions
+78
-36
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
...aMartin/admission/controller/AdmissionFormController.java
+34
-0
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
.../admission/dao/controller/AdmissionFormDAOController.java
+20
-12
lamartinBackend/src/main/java/com/example/LaMartin/admission/model/AdmissionFormData.java
...m/example/LaMartin/admission/model/AdmissionFormData.java
+24
-24
No files found.
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
View file @
2e26815c
...
@@ -72,6 +72,40 @@ public class AdmissionFormController {
...
@@ -72,6 +72,40 @@ public class AdmissionFormController {
HttpStatus
.
OK
);
HttpStatus
.
OK
);
}
}
@PostMapping
(
value
=
"/admission-form/admin-submit"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"SUCCESS"
),
@ApiResponse
(
code
=
400
,
message
=
"FAILED"
),
@ApiResponse
(
code
=
500
,
message
=
"Exception Occurred"
)
})
@ApiOperation
(
value
=
""
)
public
Object
addNewAdmissionByAdmin
(
HttpServletRequest
request
,
@ModelAttribute
AdmissionFormData
admissionFormData
,
@RequestPart
(
value
=
"candidateImage"
,
required
=
false
)
MultipartFile
candidateImage
,
@RequestPart
(
value
=
"fatherImage"
,
required
=
false
)
MultipartFile
fatherImage
,
@RequestPart
(
value
=
"motherImage"
,
required
=
false
)
MultipartFile
motherImage
)
throws
Exception
{
if
(!
admissionFormDAOController
.
addNewAdmissionData
(
admissionFormData
))
{
throw
new
Exception
(
"Form Submission Failed"
);
}
return
new
ResponseEntity
<>(
new
GeneralResponse
(
true
,
AppConstants
.
RESPONSE_SUCCESS_STATUS_CODE
,
"Form Submitted Successfully"
,
null
),
HttpStatus
.
OK
);
}
@GetMapping
(
@GetMapping
(
value
=
"/admission-form/set-interview"
,
value
=
"/admission-form/set-interview"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
produces
=
MediaType
.
APPLICATION_JSON_VALUE
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
View file @
2e26815c
...
@@ -41,19 +41,27 @@ public class AdmissionFormDAOController {
...
@@ -41,19 +41,27 @@ public class AdmissionFormDAOController {
}
}
}
}
if
(
formData
.
getCandidateImage
()
==
null
||
formData
.
getCandidateImage
().
isEmpty
())
{
formData
.
setCandidateImageName
(
"candidate.png"
);
}
else
{
formData
.
setCandidateImageName
(
formData
.
setCandidateImageName
(
fileStorageService
.
storeFile
(
fileStorageService
.
storeFile
(
formData
.
getCandidateImage
(),
formData
.
getCandidateImage
(),
settings
.
getImageStoragePath
()
settings
.
getImageStoragePath
()
)
)
);
);
}
if
(
formData
.
getFatherImage
()
==
null
||
formData
.
getFatherImage
().
isEmpty
())
{
formData
.
setFatherImageName
(
"father.png"
);
}
else
{
formData
.
setFatherImageName
(
formData
.
setFatherImageName
(
fileStorageService
.
storeFile
(
fileStorageService
.
storeFile
(
formData
.
getFatherImage
(),
formData
.
getFatherImage
(),
settings
.
getImageStoragePath
()
settings
.
getImageStoragePath
()
)
)
);
);
}
if
(
formData
.
getMotherImage
()
!=
null
&&
!
formData
.
getMotherImage
().
isEmpty
())
{
if
(
formData
.
getMotherImage
()
!=
null
&&
!
formData
.
getMotherImage
().
isEmpty
())
{
formData
.
setMotherImageName
(
formData
.
setMotherImageName
(
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/model/AdmissionFormData.java
View file @
2e26815c
...
@@ -17,62 +17,62 @@ public class AdmissionFormData {
...
@@ -17,62 +17,62 @@ public class AdmissionFormData {
private
Long
id
;
private
Long
id
;
@NotEmpty
(
message
=
"School cannot be empty"
)
@NotEmpty
(
message
=
"School cannot be empty"
)
private
String
school
;
private
String
school
=
""
;
@NotEmpty
(
message
=
"Category cannot be empty"
)
@NotEmpty
(
message
=
"Category cannot be empty"
)
private
String
category
;
private
String
category
=
""
;
private
String
staffDepartment
;
private
String
staffDepartment
;
private
String
staffCategory
;
private
String
staffCategory
;
private
String
exStudentInfo
;
private
String
exStudentInfo
;
@NotEmpty
(
message
=
"Name cannot be empty"
)
@NotEmpty
(
message
=
"Name cannot be empty"
)
private
String
fullName
;
private
String
fullName
=
""
;
@NotEmpty
(
message
=
"Admission Class cannot be empty"
)
@NotEmpty
(
message
=
"Admission Class cannot be empty"
)
private
String
admissionClass
;
private
String
admissionClass
=
""
;
@NotEmpty
(
message
=
"Date of Birth cannot be empty"
)
@NotEmpty
(
message
=
"Date of Birth cannot be empty"
)
private
String
dateOfBirth
;
private
String
dateOfBirth
=
""
;
@NotEmpty
(
message
=
"Nationality cannot be empty"
)
@NotEmpty
(
message
=
"Nationality cannot be empty"
)
private
String
nationality
;
private
String
nationality
=
""
;
@NotEmpty
(
message
=
"Religion cannot be empty"
)
@NotEmpty
(
message
=
"Religion cannot be empty"
)
private
String
religion
;
private
String
religion
=
""
;
private
String
denomination
;
private
String
denomination
;
private
String
church
;
private
String
church
;
@NotEmpty
(
message
=
"Mother Tongue cannot be empty"
)
@NotEmpty
(
message
=
"Mother Tongue cannot be empty"
)
private
String
motherTongue
;
private
String
motherTongue
=
""
;
@NotEmpty
(
message
=
"Community cannot be empty"
)
@NotEmpty
(
message
=
"Community cannot be empty"
)
private
String
community
;
private
String
community
=
""
;
@NotEmpty
(
message
=
"Home address cannot be empty"
)
@NotEmpty
(
message
=
"Home address cannot be empty"
)
private
String
homeAddress
;
private
String
homeAddress
=
""
;
@NotEmpty
(
message
=
"Correspondence address cannot be empty"
)
@NotEmpty
(
message
=
"Correspondence address cannot be empty"
)
private
String
correspondenceAddress
;
private
String
correspondenceAddress
=
""
;
private
String
otherChildren
;
private
String
otherChildren
;
@NotEmpty
(
message
=
"Marital Status cannot be empty"
)
@NotEmpty
(
message
=
"Marital Status cannot be empty"
)
private
String
maritalStatus
;
private
String
maritalStatus
=
""
;
@NotEmpty
(
message
=
"Father Name cannot be empty"
)
@NotEmpty
(
message
=
"Father Name cannot be empty"
)
private
String
fatherName
;
private
String
fatherName
=
""
;
@NotEmpty
(
message
=
"Father Mobile cannot be empty"
)
@NotEmpty
(
message
=
"Father Mobile cannot be empty"
)
private
String
fatherMobile
;
private
String
fatherMobile
=
""
;
@NotEmpty
(
message
=
"Father Email cannot be empty"
)
@NotEmpty
(
message
=
"Father Email cannot be empty"
)
private
String
fatherEmail
;
private
String
fatherEmail
=
""
;
@NotEmpty
(
message
=
"Father Nationality cannot be empty"
)
@NotEmpty
(
message
=
"Father Nationality cannot be empty"
)
private
String
fatherNationality
;
private
String
fatherNationality
=
""
;
@NotEmpty
(
message
=
"Father Religion cannot be empty"
)
@NotEmpty
(
message
=
"Father Religion cannot be empty"
)
private
String
fatherReligion
;
private
String
fatherReligion
=
""
;
private
String
fatherDenomination
;
private
String
fatherDenomination
=
""
;
private
String
fatherChurch
;
private
String
fatherChurch
=
""
;
@NotEmpty
(
message
=
"Father Mother Tongue cannot be empty"
)
@NotEmpty
(
message
=
"Father Mother Tongue cannot be empty"
)
private
String
fatherMotherTongue
;
private
String
fatherMotherTongue
=
""
;
@NotEmpty
(
message
=
"Father Community cannot be empty"
)
@NotEmpty
(
message
=
"Father Community cannot be empty"
)
private
String
fatherCommunity
;
private
String
fatherCommunity
=
""
;
@NotEmpty
(
message
=
"Father School Info cannot be empty"
)
@NotEmpty
(
message
=
"Father School Info cannot be empty"
)
private
String
fatherSchoolInfo
;
private
String
fatherSchoolInfo
=
""
;
private
String
fatherCollegeInfo
;
private
String
fatherCollegeInfo
;
private
String
fatherUniversityInfo
;
private
String
fatherUniversityInfo
;
private
String
fatherProfessionalQualification
;
private
String
fatherProfessionalQualification
;
@NotEmpty
(
message
=
"Father Occupation cannot be empty"
)
@NotEmpty
(
message
=
"Father Occupation cannot be empty"
)
private
String
fatherOccupation
;
private
String
fatherOccupation
=
""
;
@NotEmpty
(
message
=
"Father Monthly Income cannot be empty"
)
@NotEmpty
(
message
=
"Father Monthly Income cannot be empty"
)
private
String
fatherMonthlyIncome
;
private
String
fatherMonthlyIncome
=
""
;
private
String
fatherWorkplaceInfo
;
private
String
fatherWorkplaceInfo
;
private
String
motherName
;
private
String
motherName
;
...
...
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