mirror of
https://github.com/usatiuk/y.git
synced 2025-10-28 18:37:47 +01:00
post author link
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
package com.usatiuk.tjv.y.server.dto;
|
||||
|
||||
import com.usatiuk.tjv.y.server.entity.Post;
|
||||
|
||||
public record PostTo(Long id, String authorUuid, String text, Long createdAt) {
|
||||
public record PostTo(Long id, String authorUuid, String authorUsername, String text, Long createdAt) {
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ import com.usatiuk.tjv.y.server.entity.Post;
|
||||
|
||||
public class PostMapper {
|
||||
public static PostTo makeDto(Post post) {
|
||||
return new PostTo(post.getId(), post.getAuthor().getUuid(), post.getText(), post.getCreatedAt().getEpochSecond());
|
||||
return new PostTo(post.getId(), post.getAuthor().getUuid(), post.getAuthor().getUsername(), post.getText(), post.getCreatedAt().getEpochSecond());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user