diff options
| author | realtradam <[email protected]> | 2024-07-23 20:47:31 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-07-23 20:47:31 -0400 |
| commit | 1e18e0ad7a47536be92384bbf815e0923a06698d (patch) | |
| tree | b07405ecdef4f05a96b6c4348930cbee976554cb /src/main/java/com/blog/web/models/Article.java | |
| parent | 56c59e3b98fe554c4e1484e208e4be5c30f09a04 (diff) | |
| download | spring-blog-1e18e0ad7a47536be92384bbf815e0923a06698d.tar.gz spring-blog-1e18e0ad7a47536be92384bbf815e0923a06698d.zip | |
split front and back end, add react to project
Diffstat (limited to 'src/main/java/com/blog/web/models/Article.java')
| -rw-r--r-- | src/main/java/com/blog/web/models/Article.java | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/src/main/java/com/blog/web/models/Article.java b/src/main/java/com/blog/web/models/Article.java deleted file mode 100644 index b54907a..0000000 --- a/src/main/java/com/blog/web/models/Article.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.blog.web.models; - -import com.blog.web.dto.ArticleDto; -import jakarta.persistence.*; -import org.hibernate.annotations.CreationTimestamp; -import org.hibernate.annotations.UpdateTimestamp; - -import java.time.LocalDateTime; - -@Entity -public class Article { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private long id; - private String title; - private String photoUrl; - private String content; - @CreationTimestamp - private LocalDateTime createdOn; - @UpdateTimestamp - private LocalDateTime updatedOn; - @ManyToOne - @JoinColumn(name = "created_by", nullable = false) - private UserEntity createdBy; - - public Article(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 Article() { - } - - public Article(ArticleDto articleDto) { - this.id = articleDto.getId(); - this.title = articleDto.getTitle(); - this.photoUrl = articleDto.getPhotoUrl(); - this.content = articleDto.getContent(); - this.createdBy = articleDto.getCreatedBy(); - this.createdOn = articleDto.getCreatedOn(); - this.updatedOn = articleDto.getUpdatedOn(); - } - - public long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getPhotoUrl() { - return photoUrl; - } - - public void setPhotoUrl(String photoUrl) { - this.photoUrl = photoUrl; - } - - 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; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } -} |
