37 lines
1.0 KiB
Java
37 lines
1.0 KiB
Java
package SuMoC.backend.user.dtos;
|
|
|
|
import SuMoC.backend.user.enums.FriendShipStatus;
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
|
|
import java.time.Instant;
|
|
|
|
/**
|
|
* DTO for all friendships of a user.
|
|
* User is always the one affected by the status.
|
|
* So blocked would mean the user is blocked by friendId.
|
|
* The MinimalUserDTO of the friend represents the friend depending on the relationship.
|
|
* So only if friendship is accepted the private name of the friend is used as displayname.
|
|
*/
|
|
@Setter
|
|
@Getter
|
|
public class FriendshipDTO {
|
|
private Long friendshipId;
|
|
private Long userId;
|
|
private MinimalUserDTO friend;
|
|
private FriendShipStatus status;
|
|
private Instant createdAt;
|
|
|
|
public FriendshipDTO() {
|
|
}
|
|
|
|
public FriendshipDTO(Long friendshipId, Long userId, MinimalUserDTO friend, FriendShipStatus status, Instant createdAt) {
|
|
this.friendshipId = friendshipId;
|
|
this.userId = userId;
|
|
this.friend = friend;
|
|
this.status = status;
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
}
|