mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-26 04:39:26 +08:00
资源分类整改
This commit is contained in:
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -29,12 +28,6 @@ public class Resource implements Serializable {
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 分类id
|
||||
*/
|
||||
@JsonProperty("category_id")
|
||||
private Integer categoryId;
|
||||
|
||||
/**
|
||||
* 资源名
|
||||
*/
|
||||
@@ -71,22 +64,16 @@ public class Resource implements Serializable {
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("created_at")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 所属素材
|
||||
*/
|
||||
@JsonProperty("parent_id")
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
* 隐藏[0:否,1:是]
|
||||
*/
|
||||
@JsonIgnore
|
||||
@JsonProperty("is_hidden")
|
||||
private Integer isHidden;
|
||||
|
||||
@TableField(exist = false)
|
||||
@@ -106,7 +93,6 @@ public class Resource implements Serializable {
|
||||
Resource other = (Resource) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
|
||||
&& (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
|
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||
&& (this.getExtension() == null ? other.getExtension() == null : this.getExtension().equals(other.getExtension()))
|
||||
&& (this.getSize() == null ? other.getSize() == null : this.getSize().equals(other.getSize()))
|
||||
@@ -125,7 +111,6 @@ public class Resource implements Serializable {
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
|
||||
result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
result = prime * result + ((getExtension() == null) ? 0 : getExtension().hashCode());
|
||||
result = prime * result + ((getSize() == null) ? 0 : getSize().hashCode());
|
||||
@@ -147,7 +132,6 @@ public class Resource implements Serializable {
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", type=").append(type);
|
||||
sb.append(", categoryId=").append(categoryId);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", extension=").append(extension);
|
||||
sb.append(", size=").append(size);
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -24,9 +25,16 @@ public class ResourceCategory implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 资源类别
|
||||
*
|
||||
*/
|
||||
private String type;
|
||||
@JsonProperty("parent_id")
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("parent_chain")
|
||||
private String parentChain;
|
||||
|
||||
/**
|
||||
* 分类名
|
||||
@@ -66,7 +74,8 @@ public class ResourceCategory implements Serializable {
|
||||
}
|
||||
ResourceCategory other = (ResourceCategory) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
|
||||
&& (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
|
||||
&& (this.getParentChain() == null ? other.getParentChain() == null : this.getParentChain().equals(other.getParentChain()))
|
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||
&& (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
|
||||
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
|
||||
@@ -78,7 +87,8 @@ public class ResourceCategory implements Serializable {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
|
||||
result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
|
||||
result = prime * result + ((getParentChain() == null) ? 0 : getParentChain().hashCode());
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
|
||||
result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
|
||||
@@ -93,7 +103,8 @@ public class ResourceCategory implements Serializable {
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", type=").append(type);
|
||||
sb.append(", parentId=").append(parentId);
|
||||
sb.append(", parentChain=").append(parentChain);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", sort=").append(sort);
|
||||
sb.append(", createdAt=").append(createdAt);
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package xyz.playedu.api.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName resource_category
|
||||
*/
|
||||
@TableName(value ="resource_category")
|
||||
@Data
|
||||
public class ResourceCategoryRelation implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer cid;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer rid;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ResourceCategoryRelation other = (ResourceCategoryRelation) that;
|
||||
return (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid()))
|
||||
&& (this.getRid() == null ? other.getRid() == null : this.getRid().equals(other.getRid()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode());
|
||||
result = prime * result + ((getRid() == null) ? 0 : getRid().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", cid=").append(cid);
|
||||
sb.append(", rid=").append(rid);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user