28
28
import de .tum .cit .aet .artemis .programming .domain .ProgrammingSubmission ;
29
29
30
30
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
31
- public record RepoIdentifierProgrammingStudentParticipationDTO (long id , ZonedDateTime individualDueDate , Set <RepoIdentifierSubmissionDTO > submissions , String participantName ,
32
- String participantIdentifier , String repositoryUri , String buildPlanId , String branch , RepoIdentifierProgrammingExerciseDTO exercise ) {
31
+ public record RepoNameProgrammingStudentParticipationDTO (long id , ZonedDateTime individualDueDate , Set <RepoNameSubmissionDTO > submissions , String participantName ,
32
+ String participantIdentifier , String repositoryUri , String buildPlanId , String branch , RepoNameProgrammingExerciseDTO exercise ) {
33
33
34
34
/**
35
35
* Converts a ProgrammingExerciseStudentParticipation into a dto for the endpoint
@@ -38,19 +38,19 @@ public record RepoIdentifierProgrammingStudentParticipationDTO(long id, ZonedDat
38
38
* @param participation to convert
39
39
* @return the converted DTO
40
40
*/
41
- public static RepoIdentifierProgrammingStudentParticipationDTO of (ProgrammingExerciseStudentParticipation participation ) {
41
+ public static RepoNameProgrammingStudentParticipationDTO of (ProgrammingExerciseStudentParticipation participation ) {
42
42
return Optional .ofNullable (participation )
43
- .map (p -> new RepoIdentifierProgrammingStudentParticipationDTO (p .getId (), p .getIndividualDueDate (),
44
- Optional .ofNullable (p .getSubmissions ()).orElse (Set .of ()).stream ().filter (Objects ::nonNull )
45
- .map ( s -> RepoIdentifierSubmissionDTO . of (( ProgrammingSubmission ) s )). collect (Collectors .toSet ()),
43
+ .map (p -> new RepoNameProgrammingStudentParticipationDTO (p .getId (), p .getIndividualDueDate (),
44
+ Optional .ofNullable (p .getSubmissions ()).orElse (Set .of ()).stream ().filter (Objects ::nonNull ). map ( s -> RepoNameSubmissionDTO . of (( ProgrammingSubmission ) s ))
45
+ .collect (Collectors .toSet ()),
46
46
p .getParticipantName (), p .getParticipantIdentifier (), p .getRepositoryUri (), p .getBuildPlanId (), p .getBranch (),
47
- RepoIdentifierProgrammingExerciseDTO .of (p .getProgrammingExercise ())))
47
+ RepoNameProgrammingExerciseDTO .of (p .getProgrammingExercise ())))
48
48
.orElse (null );
49
49
}
50
50
51
51
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
52
- public record RepoIdentifierSubmissionDTO (long id , Boolean submitted , ZonedDateTime submissionDate , SubmissionType type , Boolean exampleSubmission , Long durationInMinutes ,
53
- List <RepoIdentifierResultDTO > results , String commitHash , boolean buildFailed ) {
52
+ public record RepoNameSubmissionDTO (long id , Boolean submitted , ZonedDateTime submissionDate , SubmissionType type , Boolean exampleSubmission , Long durationInMinutes ,
53
+ List <RepoNameResultDTO > results , String commitHash , boolean buildFailed ) {
54
54
55
55
/**
56
56
* Converts a ProgrammingSubmission into a dto for the endpoint
@@ -59,19 +59,19 @@ public record RepoIdentifierSubmissionDTO(long id, Boolean submitted, ZonedDateT
59
59
* @param submission to convert
60
60
* @return the converted DTO
61
61
*/
62
- public static RepoIdentifierSubmissionDTO of (ProgrammingSubmission submission ) {
62
+ public static RepoNameSubmissionDTO of (ProgrammingSubmission submission ) {
63
63
return Optional .ofNullable (submission )
64
- .map (s -> new RepoIdentifierSubmissionDTO (s .getId (), s .isSubmitted (), s .getSubmissionDate (), s .getType (), s .isExampleSubmission (), s .getDurationInMinutes (),
65
- Optional .ofNullable (s .getResults ()).orElse (List .of ()).stream ().filter (Objects ::nonNull ).map (RepoIdentifierResultDTO ::of ).toList (), s .getCommitHash (),
64
+ .map (s -> new RepoNameSubmissionDTO (s .getId (), s .isSubmitted (), s .getSubmissionDate (), s .getType (), s .isExampleSubmission (), s .getDurationInMinutes (),
65
+ Optional .ofNullable (s .getResults ()).orElse (List .of ()).stream ().filter (Objects ::nonNull ).map (RepoNameResultDTO ::of ).toList (), s .getCommitHash (),
66
66
s .isBuildFailed ()))
67
67
.orElse (null );
68
68
}
69
69
70
70
}
71
71
72
72
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
73
- public record RepoIdentifierResultDTO (long id , ZonedDateTime completionDate , Boolean successful , Double score , AssessmentType assessmentType , Boolean rated ,
74
- Boolean hasComplaint , Boolean exampleResult , Integer testCaseCount , Integer passedTestCaseCount , Integer codeIssueCount , List <RepoIdentifierFeedbackDTO > feedbacks ) {
73
+ public record RepoNameResultDTO (long id , ZonedDateTime completionDate , Boolean successful , Double score , AssessmentType assessmentType , Boolean rated , Boolean hasComplaint ,
74
+ Boolean exampleResult , Integer testCaseCount , Integer passedTestCaseCount , Integer codeIssueCount , List <RepoNameFeedbackDTO > feedbacks ) {
75
75
76
76
/**
77
77
* Converts a Result into a dto for the endpoint
@@ -80,19 +80,19 @@ public record RepoIdentifierResultDTO(long id, ZonedDateTime completionDate, Boo
80
80
* @param result to convert
81
81
* @return the converted DTO
82
82
*/
83
- public static RepoIdentifierResultDTO of (Result result ) {
83
+ public static RepoNameResultDTO of (Result result ) {
84
84
return Optional .ofNullable (result )
85
- .map (r -> new RepoIdentifierResultDTO (r .getId (), r .getCompletionDate (), r .isSuccessful (), r .getScore (), r .getAssessmentType (), r .isRated (), r .hasComplaint (),
85
+ .map (r -> new RepoNameResultDTO (r .getId (), r .getCompletionDate (), r .isSuccessful (), r .getScore (), r .getAssessmentType (), r .isRated (), r .hasComplaint (),
86
86
r .isExampleResult (), r .getTestCaseCount (), r .getPassedTestCaseCount (), r .getCodeIssueCount (),
87
- Optional .ofNullable (r .getFeedbacks ()).orElse (List .of ()).stream ().filter (Objects ::nonNull ).map (RepoIdentifierFeedbackDTO ::of ).toList ()))
87
+ Optional .ofNullable (r .getFeedbacks ()).orElse (List .of ()).stream ().filter (Objects ::nonNull ).map (RepoNameFeedbackDTO ::of ).toList ()))
88
88
.orElse (null );
89
89
}
90
90
91
91
}
92
92
93
93
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
94
- public record RepoIdentifierFeedbackDTO (long id , String text , String detailText , boolean hasLongFeedbackText , String reference , Double credits , FeedbackType type ,
95
- Boolean positive , Long testCaseId ) {
94
+ public record RepoNameFeedbackDTO (long id , String text , String detailText , boolean hasLongFeedbackText , String reference , Double credits , FeedbackType type , Boolean positive ,
95
+ Long testCaseId ) {
96
96
97
97
/**
98
98
* Converts a Feedback into a dto for the endpoint
@@ -101,18 +101,18 @@ public record RepoIdentifierFeedbackDTO(long id, String text, String detailText,
101
101
* @param feedback to convert
102
102
* @return the converted DTO
103
103
*/
104
- public static RepoIdentifierFeedbackDTO of (Feedback feedback ) {
105
- return Optional .ofNullable (feedback ).map (f -> new RepoIdentifierFeedbackDTO (f .getId (), f .getText (), f .getDetailText (), f .getHasLongFeedbackText (), f .getReference (),
104
+ public static RepoNameFeedbackDTO of (Feedback feedback ) {
105
+ return Optional .ofNullable (feedback ).map (f -> new RepoNameFeedbackDTO (f .getId (), f .getText (), f .getDetailText (), f .getHasLongFeedbackText (), f .getReference (),
106
106
f .getCredits (), f .getType (), f .isPositive (), f .getTestCaseId ())).orElse (null );
107
107
}
108
108
}
109
109
110
110
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
111
- public record RepoIdentifierProgrammingExerciseDTO (long id , String problemStatement , String title , String shortName , ZonedDateTime releaseDate , ZonedDateTime startDate ,
111
+ public record RepoNameProgrammingExerciseDTO (long id , String problemStatement , String title , String shortName , ZonedDateTime releaseDate , ZonedDateTime startDate ,
112
112
ZonedDateTime dueDate , ZonedDateTime assessmentDueDate , Double maxPoints , Double bonusPoints , AssessmentType assessmentType ,
113
113
boolean allowComplaintsForAutomaticAssessments , boolean allowFeedbackRequests , DifficultyLevel difficulty , ExerciseMode mode ,
114
- IncludedInOverallScore includedInOverallScore , ExerciseType exerciseType , ZonedDateTime exampleSolutionPublicationDate , RepoIdentifierCourseDTO course ,
115
- String projectKey , ProgrammingLanguage programmingLanguage , Boolean showTestNamesToStudents , Set <RepoIdentifierTestCaseDTO > testCases ) {
114
+ IncludedInOverallScore includedInOverallScore , ExerciseType exerciseType , ZonedDateTime exampleSolutionPublicationDate , RepoNameCourseDTO course , String projectKey ,
115
+ ProgrammingLanguage programmingLanguage , Boolean showTestNamesToStudents , Set <RepoNameTestCaseDTO > testCases ) {
116
116
117
117
/**
118
118
* Converts a ProgrammingExercise into a dto for the endpoint
@@ -121,19 +121,19 @@ public record RepoIdentifierProgrammingExerciseDTO(long id, String problemStatem
121
121
* @param exercise to convert
122
122
* @return the converted DTO
123
123
*/
124
- public static RepoIdentifierProgrammingExerciseDTO of (ProgrammingExercise exercise ) {
125
- return Optional .ofNullable (exercise ). map ( e -> new RepoIdentifierProgrammingExerciseDTO ( e . getId (), e . getProblemStatement (), e . getTitle (), e . getShortName (),
126
- e . getReleaseDate (), e . getStartDate (), e .getDueDate (), e .getAssessmentDueDate (), e .getMaxPoints (), e .getBonusPoints (), e .getAssessmentType (),
127
- e . getAllowComplaintsForAutomaticAssessments (), e .getAllowFeedbackRequests (), e .getDifficulty (), e .getMode (), e .getIncludedInOverallScore (), e .getExerciseType (),
128
- e . getExampleSolutionPublicationDate (), RepoIdentifierCourseDTO . of ( e . getCourseViaExerciseGroupOrCourseMember () ), e .getProjectKey (), e .getProgrammingLanguage (),
129
- e .getShowTestNamesToStudents (),
130
- Optional .ofNullable (e .getTestCases ()).orElse (Set .of ()).stream ().filter (Objects ::nonNull ).map (RepoIdentifierTestCaseDTO ::of ).collect (Collectors .toSet ())))
124
+ public static RepoNameProgrammingExerciseDTO of (ProgrammingExercise exercise ) {
125
+ return Optional .ofNullable (exercise )
126
+ . map ( e -> new RepoNameProgrammingExerciseDTO ( e . getId (), e .getProblemStatement (), e .getTitle (), e .getShortName (), e .getReleaseDate (), e .getStartDate (),
127
+ e . getDueDate (), e .getAssessmentDueDate (), e .getMaxPoints (), e .getBonusPoints (), e .getAssessmentType (), e .getAllowComplaintsForAutomaticAssessments (),
128
+ e . getAllowFeedbackRequests (), e . getDifficulty (), e . getMode (), e . getIncludedInOverallScore ( ), e .getExerciseType (), e .getExampleSolutionPublicationDate (),
129
+ RepoNameCourseDTO . of ( e . getCourseViaExerciseGroupOrCourseMember ()), e . getProjectKey (), e . getProgrammingLanguage (), e .getShowTestNamesToStudents (),
130
+ Optional .ofNullable (e .getTestCases ()).orElse (Set .of ()).stream ().filter (Objects ::nonNull ).map (RepoNameTestCaseDTO ::of ).collect (Collectors .toSet ())))
131
131
.orElse (null );
132
132
}
133
133
}
134
134
135
135
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
136
- public record RepoIdentifierCourseDTO (long id , String title , String shortName ) {
136
+ public record RepoNameCourseDTO (long id , String title , String shortName ) {
137
137
138
138
/**
139
139
* Converts a Course into a dto for the endpoint
@@ -142,13 +142,13 @@ public record RepoIdentifierCourseDTO(long id, String title, String shortName) {
142
142
* @param course to convert
143
143
* @return the converted DTO
144
144
*/
145
- public static RepoIdentifierCourseDTO of (Course course ) {
146
- return new RepoIdentifierCourseDTO (course .getId (), course .getTitle (), course .getShortName ());
145
+ public static RepoNameCourseDTO of (Course course ) {
146
+ return new RepoNameCourseDTO (course .getId (), course .getTitle (), course .getShortName ());
147
147
}
148
148
}
149
149
150
150
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
151
- public record RepoIdentifierTestCaseDTO (long id , String testName , Double weight , double bonusMultiplier , double bonusPoints , Boolean active , Visibility visibility ,
151
+ public record RepoNameTestCaseDTO (long id , String testName , Double weight , double bonusMultiplier , double bonusPoints , Boolean active , Visibility visibility ,
152
152
ProgrammingExerciseTestCaseType type ) {
153
153
154
154
/**
@@ -158,8 +158,8 @@ public record RepoIdentifierTestCaseDTO(long id, String testName, Double weight,
158
158
* @param testCase to convert
159
159
* @return the converted DTO
160
160
*/
161
- public static RepoIdentifierTestCaseDTO of (ProgrammingExerciseTestCase testCase ) {
162
- return Optional .ofNullable (testCase ).map (t -> new RepoIdentifierTestCaseDTO (t .getId (), t .getTestName (), t .getWeight (), t .getBonusMultiplier (), t .getBonusPoints (),
161
+ public static RepoNameTestCaseDTO of (ProgrammingExerciseTestCase testCase ) {
162
+ return Optional .ofNullable (testCase ).map (t -> new RepoNameTestCaseDTO (t .getId (), t .getTestName (), t .getWeight (), t .getBonusMultiplier (), t .getBonusPoints (),
163
163
t .isActive (), t .getVisibility (), t .getType ())).orElse (null );
164
164
}
165
165
}
0 commit comments