refactor(controller/service/repository): 重构分类属性、文章和消息相关功能
重构分类属性相关类名从Category_attribute改为Categoryattribute 优化文章和消息的分页查询功能,新增分页DTO类 移除旧的分页DTO类PageDto,新增ArriclePageDto和MessagePageDto 调整消息统计逻辑,区分文章评论和独立消息 更新安全配置,开放消息新增接口权限
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package com.qf.myafterprojecy.pojo.dto;
|
||||
public class ArriclePageDto {
|
||||
|
||||
private Integer status;
|
||||
private String title;
|
||||
private Integer attributeid;
|
||||
private Integer categoryid;
|
||||
private Integer pagenum;
|
||||
private Integer pagesize;
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
public Integer getPagenum() {
|
||||
return pagenum;
|
||||
}
|
||||
public void setPagenum(Integer pagenum) {
|
||||
this.pagenum = pagenum;
|
||||
}
|
||||
public Integer getPagesize() {
|
||||
return pagesize;
|
||||
}
|
||||
public void setPagesize(Integer pagesize) {
|
||||
this.pagesize = pagesize;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
public Integer getAttributeid() {
|
||||
return attributeid;
|
||||
}
|
||||
public void setAttributeid(Integer attributeid) {
|
||||
this.attributeid = attributeid;
|
||||
}
|
||||
public Integer getCategoryid() {
|
||||
return categoryid;
|
||||
}
|
||||
public void setCategoryid(Integer categoryid) {
|
||||
this.categoryid = categoryid;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ArPageDto{" +
|
||||
"status=" + status +
|
||||
", pagenum=" + pagenum +
|
||||
", pagesize=" + pagesize +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class CategoryDto {
|
||||
private Integer typeid;
|
||||
private Integer Categoryid;
|
||||
|
||||
@NotBlank(message = "分类名称不能为空")
|
||||
private String typename;
|
||||
@@ -16,12 +16,12 @@ public class CategoryDto {
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
// Getters and Setters
|
||||
public Integer getTypeid() {
|
||||
return typeid;
|
||||
public Integer getCategoryid() {
|
||||
return Categoryid;
|
||||
}
|
||||
|
||||
public void setTypeid(Integer typeid) {
|
||||
this.typeid = typeid;
|
||||
public void setCategoryid(Integer Categoryid) {
|
||||
this.Categoryid = Categoryid;
|
||||
}
|
||||
|
||||
public String getTypename() {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.qf.myafterprojecy.pojo.dto;
|
||||
|
||||
public class MessagePageDto {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private Integer articleid;
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
public Integer getArticleid() {
|
||||
return articleid;
|
||||
}
|
||||
public void setArticleid(Integer articleid) {
|
||||
this.articleid = articleid;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MessagePageDto{" +
|
||||
"pageNum=" + pageNum +
|
||||
", pageSize=" + pageSize +
|
||||
", articleid=" + articleid +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.qf.myafterprojecy.pojo.dto;
|
||||
public class PageDto {
|
||||
|
||||
private Integer status;
|
||||
private Integer page;
|
||||
private Integer size;
|
||||
// 数据验证
|
||||
public void validate() {
|
||||
if ( status > 0 && status <= 2) {
|
||||
throw new IllegalArgumentException("Status must be 0 or 2");
|
||||
}
|
||||
if (page < 0) {
|
||||
throw new IllegalArgumentException("Page number must be non-negative");
|
||||
}
|
||||
if (size <= 0 || size > 100) {
|
||||
throw new IllegalArgumentException("Page size must be between 1 and 100");
|
||||
}
|
||||
}
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
public Integer getSize() {
|
||||
return size;
|
||||
}
|
||||
public void setSize(Integer size) {
|
||||
this.size = size;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PageDto{" +
|
||||
"status=" + status +
|
||||
", page=" + page +
|
||||
", size=" + size +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user