Harmoniserade interface

This commit is contained in:
nikos dimitrakas 2022-04-22 14:56:35 +02:00
parent 1996d12ffd
commit 85219dc151
3 changed files with 5 additions and 4 deletions
core/src/main/java/se/su/dsv/scipro/daisyExternal/http
daisy-integration/src/main/java/se/su/dsv/scipro/integration/daisy/workers

@ -64,7 +64,7 @@ public interface DaisyAPI {
List<ProgramAdmission> getProgramAdmissions(Program program, Semester admissionSemester);
Iterable<ThesisRejection> getRejectedThesisSince(Date since);
List<ThesisRejection> getRejectedThesisSince(Date since);
List<StudentProgramAdmission> getProgramAdmissionsForStudent(int studentId);

@ -362,7 +362,7 @@ public class DaisyAPIImpl implements DaisyAPI {
}
@Override
public Iterable<ThesisRejection> getRejectedThesisSince(final Date since) {
public List<ThesisRejection> getRejectedThesisSince(final Date since) {
// have to pre-format the date parameter due to weird api handling of dates
final String sinceParameter = new SimpleDateFormat("yyyy-MM-dd").format(since);
return thesis()
@ -370,7 +370,8 @@ public class DaisyAPIImpl implements DaisyAPI {
.queryParam("since", sinceParameter)
// must be XML due to api date-formatting in json
.request(MediaType.APPLICATION_XML_TYPE)
.get(new GenericType<List<ThesisRejection>>(){});
.get(new GenericType<>() {
});
}
@Override

@ -42,7 +42,7 @@ public class RejectedThesisWorker extends AbstractWorker {
@Override
protected void doWork() {
final Iterable<ThesisRejection> rejections = daisyAPI.getRejectedThesisSince(getLastSuccessfulRun());
final List<ThesisRejection> rejections = daisyAPI.getRejectedThesisSince(getLastSuccessfulRun());
for (ThesisRejection thesisRejection : rejections) {
final Date rejectedDate = thesisRejection.getRejected().getTime();
final Project project = projectService.findByExternalIdentifier(thesisRejection.getThesisId().intValue());