Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.44 KB

README.md

File metadata and controls

65 lines (50 loc) · 2.44 KB

Schoolproject

Small project for teaching purposes.

  • Wildfly
  • JEE 8
  • Java 11
  • Git
  • Maven
  • MySQL

Wildfly configuration

Install any Wildfly release you want. I use 18.

Add a user, and place the school.cli script under the bin folder.
Create database school. The script will need a mysql connector under C:\Users to work.

The script is predefined for mysql.connector-java-8.0.12.jar. Change location and version for your own liking.

Start Wildfly, and once running, open a new prompt, and go to the bin folder.
Write jboss-cli -c --file=school.cli

It should say outcome success. Write jboss-cli -c --command=:reload to restart the server.

To run mvn: wildfly:undeploy clean:clean wildfly:deploy

Methods for student

HTTP Endpoints
GET All /school/student/
Lists all available students
GET By Email /school/student/emails/{email}
Returns one student with that unique email. Path parameter: email
GET By Name /school/student/names/{name}
Returns one or more students. Path parameter: name
POST /school/student/add
Json body: { "forename": "", "lastName": "", "email": "" }
PUT /school/student/
Query parameters: forename, lastname, email
PATCH /school/student/
Json body: { "forename": "", "lastName": "", "email": "" }
DELETE /school/student/{email}
Path parameter: email

Methods for subject

HTTP Endpoints
GET all /school/subject
POST /school/subject
Json body: { "subject": ""}
PUT /school/subject
PATCH /school/subject/{id}/student/{email}
You can provide the id of the subject and the email of the student you want to assign the subject to.
DELETE /school/subject/{id}

Methods for teacher

HTTP Endpoints
GET all /school/teacher
POST /school/teacher
Json body: { "forename": "", "lastName": "", "email": "" }
PUT /school/teacher
Query parameters: forename, lastname, email
DELETE /school/teacher/{email}