代码优化

This commit is contained in:
none
2023-02-23 15:20:39 +08:00
parent b1022fde0a
commit e7d335eb88
12 changed files with 219 additions and 22 deletions

View File

@@ -0,0 +1,63 @@
package xyz.playedu.api.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
* @TableName user_department
*/
@TableName(value = "user_department")
@Data
public class UserDepartment implements Serializable {
@JsonProperty("user_id")
private Integer userId;
@JsonProperty("dep_id")
private Integer depId;
@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;
}
UserDepartment other = (UserDepartment) that;
return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getDepId() == null ? other.getDepId() == null : this.getDepId().equals(other.getDepId()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getDepId() == null) ? 0 : getDepId().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", userId=").append(userId);
sb.append(", depId=").append(depId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}