Harmoniserade interface
This commit is contained in:
parent
1996d12ffd
commit
85219dc151
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
|
||||
|
2
daisy-integration/src/main/java/se/su/dsv/scipro/integration/daisy/workers/RejectedThesisWorker.java
2
daisy-integration/src/main/java/se/su/dsv/scipro/integration/daisy/workers/RejectedThesisWorker.java
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user