diff options
| author | realtradam <[email protected]> | 2024-07-15 22:20:09 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-07-15 22:20:09 -0400 |
| commit | b1581ed1046f4aef077aea4fe6a1b01e599125d2 (patch) | |
| tree | 73e887083219b7b7c5eda1919628692b76f2a372 /src/main/java/com/blog/web/dto/ArticleDto.java | |
| parent | 1d8b48dfab6d1de72c841d309732c6da3bc6136c (diff) | |
| download | spring-blog-b1581ed1046f4aef077aea4fe6a1b01e599125d2.tar.gz spring-blog-b1581ed1046f4aef077aea4fe6a1b01e599125d2.zip | |
remove lombok
Diffstat (limited to 'src/main/java/com/blog/web/dto/ArticleDto.java')
| -rw-r--r-- | src/main/java/com/blog/web/dto/ArticleDto.java | 78 |
1 files changed, 76 insertions, 2 deletions
diff --git a/src/main/java/com/blog/web/dto/ArticleDto.java b/src/main/java/com/blog/web/dto/ArticleDto.java index 232fa3c..65ec6da 100644 --- a/src/main/java/com/blog/web/dto/ArticleDto.java +++ b/src/main/java/com/blog/web/dto/ArticleDto.java @@ -11,8 +11,6 @@ import org.hibernate.validator.constraints.URL; import java.time.LocalDateTime; -@Data -@Builder public class ArticleDto { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -31,4 +29,80 @@ public class ArticleDto { @ManyToOne @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 + ) { + this.id = id; + this.title = title; + this.photoUrl = photoUrl; + this.content = content; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.updatedOn = updatedOn; + } + + public ArticleDto() {}; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public @NotEmpty(message = "Article title should not be empty") String getTitle() { + return title; + } + + public void setTitle(@NotEmpty(message = "Article title should not be empty") String title) { + this.title = title; + } + + public @NotEmpty(message = "Article Photo URL should not be empty") @URL(message = "Article Photo URL should be a URL") String getPhotoUrl() { + return photoUrl; + } + + public void setPhotoUrl(@NotEmpty(message = "Article Photo URL should not be empty") @URL(message = "Article Photo URL should be a URL") String photoUrl) { + this.photoUrl = photoUrl; + } + + public @NotEmpty(message = "Article Content should not be empty") String getContent() { + return content; + } + + public void setContent(@NotEmpty(message = "Article Content should not be empty") String content) { + this.content = content; + } + + public LocalDateTime getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(LocalDateTime createdOn) { + this.createdOn = createdOn; + } + + public LocalDateTime getUpdatedOn() { + return updatedOn; + } + + public void setUpdatedOn(LocalDateTime updatedOn) { + this.updatedOn = updatedOn; + } + + public UserEntity getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(UserEntity createdBy) { + this.createdBy = createdBy; + } } |
