-
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.
- Added massive load of grades for students of a given course - Added massive load of final grades for students in a final inscription of a given coursea
- Loading branch information
Showing
6 changed files
with
207 additions
and
4 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
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
33 changes: 33 additions & 0 deletions
33
webapp/src/main/java/ar/edu/itba/paw/webapp/models/HTTPResponseDTO.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,33 @@ | ||
package ar.edu.itba.paw.webapp.models; | ||
|
||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
@XmlRootElement(name = "response") | ||
public class HTTPResponseDTO { | ||
private int status; | ||
private String property; | ||
|
||
public HTTPResponseDTO() { | ||
} | ||
|
||
HTTPResponseDTO(String property, int status) { | ||
setProperty(property); | ||
setStatus(status); | ||
} | ||
|
||
public int getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(int status) { | ||
this.status = status; | ||
} | ||
|
||
public String getProperty() { | ||
return property; | ||
} | ||
|
||
private void setProperty(final String property) { | ||
this.property = property; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
webapp/src/main/java/ar/edu/itba/paw/webapp/models/HTTPResponseList.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,33 @@ | ||
package ar.edu.itba.paw.webapp.models; | ||
|
||
|
||
import javax.ws.rs.core.Response; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class HTTPResponseList { | ||
private List<HTTPResponseDTO> responses; | ||
|
||
public HTTPResponseList() { | ||
|
||
} | ||
|
||
public HTTPResponseList(final int size) { | ||
responses = new ArrayList<>(size); | ||
} | ||
|
||
|
||
public void add(final String property, final Response.Status status) { | ||
final HTTPResponseDTO responseDTO = new HTTPResponseDTO(property, status.getStatusCode()); | ||
|
||
responses.add(responseDTO); | ||
} | ||
|
||
public List<HTTPResponseDTO> getResponses() { | ||
return responses; | ||
} | ||
|
||
public void setResponses(List<HTTPResponseDTO> responses) { | ||
this.responses = responses; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
webapp/src/main/java/ar/edu/itba/paw/webapp/models/QualifiedStudentsList.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,21 @@ | ||
package ar.edu.itba.paw.webapp.models; | ||
|
||
import java.util.List; | ||
|
||
public class QualifiedStudentsList { | ||
private List<QualifyStudent> studentsWithGrade; | ||
|
||
public QualifiedStudentsList() { | ||
} | ||
|
||
public List<QualifyStudent> getStudentsWithGrade() { | ||
return studentsWithGrade; | ||
} | ||
|
||
public int size() { | ||
if (studentsWithGrade == null) { | ||
return 0; | ||
} | ||
return studentsWithGrade.size(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
webapp/src/main/java/ar/edu/itba/paw/webapp/models/QualifyStudent.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,36 @@ | ||
package ar.edu.itba.paw.webapp.models; | ||
|
||
import javax.validation.constraints.Max; | ||
import javax.validation.constraints.Min; | ||
import javax.validation.constraints.NotNull; | ||
import java.math.BigDecimal; | ||
|
||
public class QualifyStudent { | ||
@NotNull | ||
@Min(0) | ||
private Integer docket; | ||
|
||
@NotNull | ||
@Min(0) | ||
@Max(10) | ||
private BigDecimal grade; | ||
|
||
public QualifyStudent() { | ||
} | ||
|
||
public int getDocket() { | ||
return docket; | ||
} | ||
|
||
public void setDocket(int docket) { | ||
this.docket = docket; | ||
} | ||
|
||
public BigDecimal getGrade() { | ||
return grade; | ||
} | ||
|
||
public void setGrade(BigDecimal grade) { | ||
this.grade = grade; | ||
} | ||
} |