添加JWT依赖并实现token生成与验证功能 在控制器方法上添加权限注解保护API端点 更新安全配置以集成JWT过滤器 移除无用的编码测试工具类 修改JWT相关配置为更安全的设置
100 lines
2.0 KiB
Java
100 lines
2.0 KiB
Java
package com.qf.myafterprojecy.pojo.dto;
|
|
|
|
import javax.validation.constraints.NotBlank;
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
public class ArticleDto {
|
|
private Integer articleid;
|
|
|
|
@NotBlank(message = "标题不能为空")
|
|
private String title;
|
|
|
|
private String content;// 如果为空说明是长篇文章 不为空则是短篇说说
|
|
|
|
@NotNull(message = "属性ID不能为空")
|
|
private Integer attributeid;
|
|
|
|
private String img;
|
|
|
|
private Integer viewCount;
|
|
|
|
private Integer likes;
|
|
|
|
private Integer status;
|
|
|
|
private String markdownscontent; // 文章内容的Markdown格式
|
|
|
|
// Getters and Setters
|
|
public Integer getArticleid() {
|
|
return articleid;
|
|
}
|
|
|
|
public void setArticleid(Integer articleid) {
|
|
this.articleid = articleid;
|
|
}
|
|
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
public String getContent() {
|
|
return content;
|
|
}
|
|
|
|
public void setContent(String content) {
|
|
this.content = content;
|
|
}
|
|
|
|
public Integer getAttributeid() {
|
|
return attributeid;
|
|
}
|
|
|
|
public void setAttributeid(Integer attributeid) {
|
|
this.attributeid = attributeid;
|
|
}
|
|
|
|
public String getImg() {
|
|
return img;
|
|
}
|
|
|
|
public void setImg(String img) {
|
|
this.img = img;
|
|
}
|
|
|
|
public Integer getViewCount() {
|
|
return viewCount;
|
|
}
|
|
|
|
public void setViewCount(Integer viewCount) {
|
|
this.viewCount = viewCount;
|
|
}
|
|
|
|
public Integer getLikes() {
|
|
return likes;
|
|
}
|
|
|
|
public void setLikes(Integer likes) {
|
|
this.likes = likes;
|
|
}
|
|
|
|
public Integer getStatus() {
|
|
return status;
|
|
}
|
|
|
|
public void setStatus(Integer status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public String getMarkdownscontent() {
|
|
return markdownscontent;
|
|
}
|
|
|
|
public void setMarkdownscontent(String markdownscontent) {
|
|
this.markdownscontent = markdownscontent;
|
|
}
|
|
}
|