-
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.
Merge pull request #22 from hotungkhanh/kan-59/store-get-timetable
KAN-59: setup to allow storage of timetable solutions
- Loading branch information
Showing
13 changed files
with
336 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"conventionalCommits.scopes": [ | ||
"database" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ bin/ | |
nb-configuration.xml | ||
|
||
# Visual Studio Code | ||
.vscode | ||
.vscode/ | ||
.factorypath | ||
|
||
# OSX | ||
|
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
2 changes: 1 addition & 1 deletion
2
...ooltimetabling/domain/CampusResource.java → .../java/org/acme/domain/CampusResource.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.acme.schooltimetabling.domain; | ||
package org.acme.domain; | ||
|
||
import java.util.List; | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.acme.domain; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.transaction.Transactional; | ||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
@Path("/rooms") | ||
public class RoomResource { | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public List<Room> list() { | ||
return Room.listAll(); | ||
} | ||
|
||
@POST | ||
@Transactional | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public Response createCampus(Room room) { | ||
room.persist(); | ||
return Response.status(Response.Status.CREATED).entity(room).build(); | ||
} | ||
|
||
} |
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
29 changes: 29 additions & 0 deletions
29
backend/src/main/java/org/acme/domain/StudentResource.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,29 @@ | ||
package org.acme.domain; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.transaction.Transactional; | ||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
@Path("/students") | ||
public class StudentResource { | ||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public List<Student> list() { | ||
return Student.listAll(); | ||
} | ||
|
||
@POST | ||
@Transactional | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public Response createCampus(Student student) { | ||
student.persist(); | ||
return Response.status(Response.Status.CREATED).entity(student).build(); | ||
} | ||
} |
Oops, something went wrong.