重构Article模块 新增Message模块 优化安全配置
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package com.qf.myafterprojecy.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "article")
|
||||
@@ -11,18 +12,35 @@ public class Article {
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "articleid")
|
||||
private Integer articleid;
|
||||
|
||||
@NotBlank(message = "标题不能为空")
|
||||
@Column(name = "title")
|
||||
private String title;
|
||||
@Column(name = "content")
|
||||
|
||||
@NotBlank(message = "内容不能为空")
|
||||
@Column(name = "content", columnDefinition = "TEXT")
|
||||
private String content;
|
||||
|
||||
@NotNull(message = "类别id不能为空")
|
||||
@Column(name = "typeid")
|
||||
private Integer typeid;
|
||||
|
||||
@Column(name = "img")
|
||||
private String img;
|
||||
@Column(name = "typeid")
|
||||
private int typeid;
|
||||
@Column(name = "published_at")
|
||||
private String publisher_at;
|
||||
|
||||
@Column(name = "created_at")
|
||||
private String created_at;
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Column(name = "updated_at")
|
||||
private LocalDateTime updatedAt;
|
||||
@Column(name = "view_count")
|
||||
private Integer viewCount;
|
||||
|
||||
@Column(name = "status")
|
||||
private Integer status; // 0-草稿,1-已发布,2-已删除
|
||||
|
||||
// Getters and Setters
|
||||
|
||||
|
||||
public Integer getArticleid() {
|
||||
return articleid;
|
||||
@@ -48,6 +66,38 @@ public class Article {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Integer getTypeid() {
|
||||
return typeid;
|
||||
}
|
||||
|
||||
public void setTypeid(Integer typeid) {
|
||||
this.typeid = typeid;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
@@ -56,40 +106,11 @@ public class Article {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public int getTypeid() {
|
||||
return typeid;
|
||||
public Integer getViewCount() {
|
||||
return viewCount;
|
||||
}
|
||||
|
||||
public void setTypeid(int typeid) {
|
||||
this.typeid = typeid;
|
||||
}
|
||||
|
||||
public String getPublisher_at() {
|
||||
return publisher_at;
|
||||
}
|
||||
|
||||
public void setPublisher_at(String publisher_at) {
|
||||
this.publisher_at = publisher_at;
|
||||
}
|
||||
|
||||
public String getCreated_at() {
|
||||
return created_at;
|
||||
}
|
||||
|
||||
public void setCreated_at(String created_at) {
|
||||
this.created_at = created_at;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Article{" +
|
||||
"articleid=" + articleid +
|
||||
", title='" + title + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", img='" + img + '\'' +
|
||||
", typeid=" + typeid +
|
||||
", publisher_at='" + publisher_at + '\'' +
|
||||
", created_at='" + created_at + '\'' +
|
||||
'}';
|
||||
public void setViewCount(Integer viewCount) {
|
||||
this.viewCount = viewCount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user