generated from MEITREX/template_microservice
-
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.
add manual mapping possibility and unfinishedGradings
- Loading branch information
Showing
10 changed files
with
278 additions
and
12 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
35 changes: 35 additions & 0 deletions
35
...tgart/iste/meitrex/assignment_service/persistence/entity/ManualMappingInstanceEntity.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,35 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.entity; | ||
|
||
import de.unistuttgart.iste.meitrex.common.persistence.IWithId; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.json.JSONObject; | ||
|
||
@Entity(name = "ManualMappingInstance") | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ManualMappingInstanceEntity implements IWithId<String> { | ||
|
||
@Id | ||
private String externalStudentId; | ||
|
||
@Column(nullable = false) | ||
private String externalStudentInfo; | ||
|
||
@Override | ||
public String getId() { | ||
return externalStudentId; | ||
} | ||
|
||
public static ManualMappingInstanceEntity fromJson(JSONObject externalStudentInfo) { | ||
return new ManualMappingInstanceEntity(externalStudentInfo.getString("id"), externalStudentInfo.toString()); | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...stuttgart/iste/meitrex/assignment_service/persistence/entity/UnfinishedGradingEntity.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,49 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.entity; | ||
|
||
import de.unistuttgart.iste.meitrex.common.persistence.IWithId; | ||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.json.JSONObject; | ||
|
||
import java.io.Serializable; | ||
import java.util.UUID; | ||
|
||
@Entity(name = "UnfinishedGrading") | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class UnfinishedGradingEntity implements IWithId<UnfinishedGradingEntity.PrimaryKey> { | ||
|
||
@EmbeddedId | ||
private PrimaryKey primaryKey; | ||
|
||
@Column(nullable = false) | ||
private String gradingJson; | ||
|
||
@Column(nullable = false) | ||
private int numberOfTries; | ||
|
||
@Data | ||
@Embeddable | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class PrimaryKey implements Serializable { | ||
private String externalStudentId; | ||
private UUID assignmentId; | ||
} | ||
|
||
@Override | ||
public PrimaryKey getId() { | ||
return primaryKey; | ||
} | ||
|
||
public static UnfinishedGradingEntity fromJson(JSONObject gradingJson, UUID assignmentId) { | ||
String studentId = gradingJson.getString("studentId"); | ||
return new UnfinishedGradingEntity(new PrimaryKey(studentId, assignmentId), gradingJson.toString(), 0); | ||
} | ||
|
||
} |
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
10 changes: 10 additions & 0 deletions
10
...te/meitrex/assignment_service/persistence/repository/ManualMappingInstanceRepository.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,10 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.repository; | ||
|
||
import de.unistuttgart.iste.meitrex.assignment_service.persistence.entity.ManualMappingInstanceEntity; | ||
import de.unistuttgart.iste.meitrex.common.persistence.MeitrexRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
|
||
@Repository | ||
public interface ManualMappingInstanceRepository extends MeitrexRepository<ManualMappingInstanceEntity, String> { | ||
} |
10 changes: 10 additions & 0 deletions
10
...t/iste/meitrex/assignment_service/persistence/repository/UnfinishedGradingRepository.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,10 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.repository; | ||
|
||
import de.unistuttgart.iste.meitrex.assignment_service.persistence.entity.UnfinishedGradingEntity; | ||
import de.unistuttgart.iste.meitrex.common.persistence.MeitrexRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
|
||
@Repository | ||
public interface UnfinishedGradingRepository extends MeitrexRepository<UnfinishedGradingEntity, UnfinishedGradingEntity.PrimaryKey> { | ||
} |
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
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