serv-资源修改

This commit is contained in:
2025-10-20 15:08:20 +08:00
parent 2f1835bdbf
commit 16824537d1
50 changed files with 2657 additions and 353 deletions

View File

@@ -40,16 +40,25 @@ public class PageParam implements Serializable {
*/
private long totalElements;
/**
* @description 偏移量
* @author yslg
* @since 2025-10-20
*/
private long offset;
public PageParam() {
this.pageNumber = 1;
this.pageSize = 10;
this.totalPages = 0;
this.totalElements = 0;
this.offset = 0;
}
public PageParam(int pageNumber, int pageSize) {
this.pageNumber = pageNumber;
this.pageSize = pageSize;
this.offset = (pageNumber - 1) * pageSize;
}
public PageParam(int pageNumber, int pageSize, int totalPages, long totalElements) {
@@ -57,6 +66,7 @@ public class PageParam implements Serializable {
this.pageSize = pageSize;
this.totalPages = totalPages;
this.totalElements = totalElements;
this.offset = (pageNumber - 1) * pageSize;
}
/**
* @description 设置当前页码
@@ -147,5 +157,24 @@ public class PageParam implements Serializable {
return totalElements;
}
/**
* @description 设置偏移量
* @param offset 偏移量
* @return void
* @author yslg
* @since 2025-10-20
*/
public void setOffset(long offset) {
this.offset = offset;
}
/**
* @description 获取偏移量
* @return 偏移量
* @author yslg
* @since 2025-10-20
*/
public long getOffset() {
return offset;
}
}

View File

@@ -0,0 +1,40 @@
package org.xyzh.common.core.page;
import org.xyzh.common.core.page.PageParam;
/**
* @description 分页查询请求
* @filename PageRequest.java
* @author yslg
* @copyright xyzh
* @since 2025-10-20
*/
public class PageRequest<T> {
/**
* 过滤条件
*/
private T filter;
/**
* 分页参数
*/
private PageParam pageParam;
public T getFilter() {
return filter;
}
public void setFilter(T filter) {
this.filter = filter;
}
public PageParam getPageParam() {
return pageParam;
}
public void setPageParam(PageParam pageParam) {
this.pageParam = pageParam;
}
}

View File

@@ -13,6 +13,11 @@ import java.util.Date;
public class TbResource extends BaseDTO {
private static final long serialVersionUID = 1L;
/**
* @description 资源ID
*/
private String resourceID;
/**
* @description 资源标题
@@ -99,6 +104,14 @@ public class TbResource extends BaseDTO {
*/
private String updater;
public String getResourceID() {
return resourceID;
}
public void setResourceID(String resourceID) {
this.resourceID = resourceID;
}
public String getTitle() {
return title;
}
@@ -239,6 +252,7 @@ public class TbResource extends BaseDTO {
public String toString() {
return "TbResource{" +
"id=" + getID() +
", resourceID='" + resourceID + '\'' +
", title='" + title + '\'' +
", categoryID='" + categoryID + '\'' +
", author='" + author + '\'' +

View File

@@ -0,0 +1,49 @@
package org.xyzh.common.vo;
import java.io.Serializable;
import org.xyzh.common.dto.resource.TbResource;
import org.xyzh.common.dto.resource.TbResourceCategory;
import org.xyzh.common.dto.resource.TbTag;
import java.util.List;
/**
* @description 资源VO
* @filename ResourceVO.java
* @author yslg
* @copyright xyzh
* @since 2025-10-20
*/
public class ResourceVO implements Serializable{
private static final long serialVersionUID = 1L;
private TbResource resource;
private TbResourceCategory resourceCategory;
private List<TbTag> tags;
public TbResource getResource() {
return resource;
}
public void setResource(TbResource resource) {
this.resource = resource;
}
public TbResourceCategory getResourceCategory() {
return resourceCategory;
}
public void setResourceCategory(TbResourceCategory resourceCategory) {
this.resourceCategory = resourceCategory;
}
public List<TbTag> getTags() {
return tags;
}
public void setTags(List<TbTag> tags) {
this.tags = tags;
}
}

View File

@@ -0,0 +1,89 @@
package org.xyzh.common.vo;
import org.xyzh.common.dto.BaseDTO;
import org.xyzh.common.dto.resource.TbResourceTag;
import org.xyzh.common.dto.resource.TbTag;
/**
* @description 标签VO
* @filename TagVO.java
* @author yslg
* @copyright xyzh
* @since 2025-10-15
*/
public class TagVO extends BaseDTO {
private static final long serialVersionUID = 1L;
/**
* @description 资源ID
*/
private String resourceID;
/**
* @description 标签ID
*/
private String tagID;
private String tagName;
private String tagColor;
/**
* @description 创建者
*/
private String creator;
public String getResourceID() {
return resourceID;
}
public void setResourceID(String resourceID) {
this.resourceID = resourceID;
}
public String getTagID() {
return tagID;
}
public void setTagID(String tagID) {
this.tagID = tagID;
}
public String getTagName() {
return tagName;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
public String getTagColor() {
return tagColor;
}
public void setTagColor(String tagColor) {
this.tagColor = tagColor;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public TbResourceTag getResourceTag() {
TbResourceTag resourceTag = new TbResourceTag();
resourceTag.setResourceID(resourceID);
resourceTag.setTagID(tagID);
return resourceTag;
}
public TbTag getTag() {
TbTag tag = new TbTag();
tag.setID(tagID);
tag.setName(tagName);
tag.setColor(tagColor);
return tag;
}
}