-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into chore/development/update-pull-request-tem…
…plate
- Loading branch information
Showing
138 changed files
with
4,782 additions
and
175 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
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
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
23 changes: 23 additions & 0 deletions
23
src/main/java/de/tum/cit/aet/artemis/communication/domain/PostingType.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,23 @@ | ||
package de.tum.cit.aet.artemis.communication.domain; | ||
|
||
import java.util.Arrays; | ||
|
||
public enum PostingType { | ||
|
||
POST((short) 0), ANSWER((short) 1); | ||
|
||
private final short databaseKey; | ||
|
||
PostingType(short databaseKey) { | ||
this.databaseKey = databaseKey; | ||
} | ||
|
||
public short getDatabaseKey() { | ||
return databaseKey; | ||
} | ||
|
||
public static PostingType fromDatabaseKey(short databaseKey) { | ||
return Arrays.stream(PostingType.values()).filter(type -> type.getDatabaseKey() == databaseKey).findFirst() | ||
.orElseThrow(() -> new IllegalArgumentException("Unknown database key: " + databaseKey)); | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
src/main/java/de/tum/cit/aet/artemis/communication/domain/SavedPost.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,83 @@ | ||
package de.tum.cit.aet.artemis.communication.domain; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
|
||
import de.tum.cit.aet.artemis.core.domain.DomainObject; | ||
import de.tum.cit.aet.artemis.core.domain.User; | ||
|
||
@Entity | ||
@Table(name = "saved_post") | ||
public class SavedPost extends DomainObject { | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "user_id", nullable = false) | ||
private User user; | ||
|
||
@Column(name = "post_id", nullable = false) | ||
private Long postId; | ||
|
||
@Enumerated | ||
@Column(name = "post_type", nullable = false) | ||
private PostingType postType; | ||
|
||
@Enumerated | ||
@Column(name = "status", nullable = false) | ||
private SavedPostStatus status; | ||
|
||
@Column(name = "completed_at") | ||
private ZonedDateTime completedAt; | ||
|
||
public SavedPost() { | ||
} | ||
|
||
public SavedPost(User user, Long postId, PostingType postType, SavedPostStatus status, ZonedDateTime completedAt) { | ||
this.user = user; | ||
this.postId = postId; | ||
this.postType = postType; | ||
this.status = status; | ||
this.completedAt = completedAt; | ||
} | ||
|
||
public Long getPostId() { | ||
return postId; | ||
} | ||
|
||
public void setPostId(Long postId) { | ||
this.postId = postId; | ||
} | ||
|
||
public void setStatus(SavedPostStatus status) { | ||
this.status = status; | ||
} | ||
|
||
public User getUser() { | ||
return user; | ||
} | ||
|
||
public SavedPostStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public void setCompletedAt(ZonedDateTime completedAt) { | ||
this.completedAt = completedAt; | ||
} | ||
|
||
public void setPostType(PostingType postType) { | ||
this.postType = postType; | ||
} | ||
|
||
public PostingType getPostType() { | ||
return postType; | ||
} | ||
|
||
public ZonedDateTime getCompletedAt() { | ||
return completedAt; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/de/tum/cit/aet/artemis/communication/domain/SavedPostStatus.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,23 @@ | ||
package de.tum.cit.aet.artemis.communication.domain; | ||
|
||
import java.util.Arrays; | ||
|
||
public enum SavedPostStatus { | ||
|
||
IN_PROGRESS((short) 0), COMPLETED((short) 1), ARCHIVED((short) 2); | ||
|
||
private final short databaseKey; | ||
|
||
SavedPostStatus(short databaseKey) { | ||
this.databaseKey = databaseKey; | ||
} | ||
|
||
public short getDatabaseKey() { | ||
return databaseKey; | ||
} | ||
|
||
public static SavedPostStatus fromDatabaseKey(short databaseKey) { | ||
return Arrays.stream(SavedPostStatus.values()).filter(type -> type.getDatabaseKey() == databaseKey).findFirst() | ||
.orElseThrow(() -> new IllegalArgumentException("Unknown database key: " + databaseKey)); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/de/tum/cit/aet/artemis/communication/dto/AuthorDTO.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,13 @@ | ||
package de.tum.cit.aet.artemis.communication.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import de.tum.cit.aet.artemis.core.domain.User; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public record AuthorDTO(Long id, String name, String imageUrl) { | ||
|
||
public AuthorDTO(User user) { | ||
this(user.getId(), user.getName(), user.getImageUrl()); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/de/tum/cit/aet/artemis/communication/dto/FeedbackChannelRequestDTO.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,7 @@ | ||
package de.tum.cit.aet.artemis.communication.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public record FeedbackChannelRequestDTO(ChannelDTO channel, String feedbackDetailText) { | ||
} |
Oops, something went wrong.