新增Nonsense相关实体、DTO、Repository、Service和Controller,实现随机内容的CRUD功能 优化CORS和安全配置,增加更精细的权限控制和错误处理 移除Article和Message中不必要的验证注解,调整部分API的权限要求
123 lines
2.4 KiB
Java
123 lines
2.4 KiB
Java
package com.qf.myafterprojecy.pojo;
|
|
|
|
import javax.persistence.*;
|
|
import java.util.Date;
|
|
|
|
@Entity
|
|
@Table(name = "message")
|
|
public class Message {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
@Column(name = "messageid")
|
|
private Integer messageid;
|
|
|
|
@Column(name = "nickname")
|
|
private String nickname;
|
|
|
|
@Column(name = "email")
|
|
private String email;
|
|
|
|
@Column(name = "content", columnDefinition = "text")
|
|
private String content;
|
|
|
|
@Column(name = "messageimg")
|
|
private String messageimg;
|
|
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
@Column(name = "created_at")
|
|
private Date createdAt;
|
|
|
|
@Column(name = "parentid")
|
|
private Integer parentid;
|
|
|
|
@Column(name = "replyid")
|
|
private Integer replyid;
|
|
|
|
@Column(name = "articleid")
|
|
private Integer articleid;
|
|
|
|
@Column(name = "likes")
|
|
private Integer likes; // 点赞数
|
|
|
|
|
|
public Integer getLikes() {
|
|
return likes;
|
|
}
|
|
|
|
public void setLikes(Integer likes) {
|
|
this.likes = likes;
|
|
}
|
|
|
|
public Integer getReplyid() {
|
|
return replyid;
|
|
}
|
|
|
|
public void setReplyid(Integer replyid) {
|
|
this.replyid = replyid;
|
|
}
|
|
|
|
public Integer getMessageid() {
|
|
return messageid;
|
|
}
|
|
|
|
public void setMessageid(Integer messageid) {
|
|
this.messageid = messageid;
|
|
}
|
|
|
|
public String getNickname() {
|
|
return nickname;
|
|
}
|
|
|
|
public void setNickname(String nickname) {
|
|
this.nickname = nickname;
|
|
}
|
|
|
|
public String getEmail() {
|
|
return email;
|
|
}
|
|
|
|
public void setEmail(String email) {
|
|
this.email = email;
|
|
}
|
|
|
|
public String getContent() {
|
|
return content;
|
|
}
|
|
|
|
public void setContent(String content) {
|
|
this.content = content;
|
|
}
|
|
|
|
public Date getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
public void setCreatedAt(Date createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public Integer getParentid() {
|
|
return parentid;
|
|
}
|
|
|
|
public void setParentid(Integer parentid) {
|
|
this.parentid = parentid;
|
|
}
|
|
|
|
public Integer getArticleid() {
|
|
return articleid;
|
|
}
|
|
|
|
public void setArticleid(Integer articleid) {
|
|
this.articleid = articleid;
|
|
}
|
|
|
|
public String getMessageimg() {
|
|
return messageimg;
|
|
}
|
|
|
|
public void setMessageimg(String messageimg) {
|
|
this.messageimg = messageimg;
|
|
}
|
|
}
|