diff options
| author | realtradam <[email protected]> | 2024-07-20 00:51:37 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-07-20 00:51:37 -0400 |
| commit | 5e2eab6f32bc76918aa17791b688d1df27d6ddfc (patch) | |
| tree | 420a0bcb5091d1e220fa8c42565a507897e11ec4 /src/main/java/com/blog/web/dto/ArticleDto.java | |
| parent | a6a60a5e774eed9d84f522fc452b67ee52e033cb (diff) | |
| download | spring-blog-5e2eab6f32bc76918aa17791b688d1df27d6ddfc.tar.gz spring-blog-5e2eab6f32bc76918aa17791b688d1df27d6ddfc.zip | |
code cleanup
Diffstat (limited to 'src/main/java/com/blog/web/dto/ArticleDto.java')
| -rw-r--r-- | src/main/java/com/blog/web/dto/ArticleDto.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main/java/com/blog/web/dto/ArticleDto.java b/src/main/java/com/blog/web/dto/ArticleDto.java index 372b318..d275f3b 100644 --- a/src/main/java/com/blog/web/dto/ArticleDto.java +++ b/src/main/java/com/blog/web/dto/ArticleDto.java @@ -29,15 +29,7 @@ public class ArticleDto { @JoinColumn(name = "created_by", nullable = false) private UserEntity createdBy; - public ArticleDto( - long id, - String title, - String photoUrl, - String content, - UserEntity createdBy, - LocalDateTime createdOn, - LocalDateTime updatedOn - ) { + public ArticleDto(long id, String title, String photoUrl, String content, UserEntity createdBy, LocalDateTime createdOn, LocalDateTime updatedOn) { this.id = id; this.title = title; this.photoUrl = photoUrl; @@ -47,7 +39,10 @@ public class ArticleDto { this.updatedOn = updatedOn; } - public ArticleDto() {}; + public ArticleDto() { + } + + ; public ArticleDto(Article article) { this.id = article.getId(); @@ -114,4 +109,6 @@ public class ArticleDto { public void setCreatedBy(UserEntity createdBy) { this.createdBy = createdBy; } + + public String getUsername() { return createdBy.getUsername(); } } |
