GoodsDto.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package com.zt.pojo;
  2. import com.baomidou.mybatisplus.annotation.IdType;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import java.io.Serializable;
  7. import java.util.Date;
  8. import lombok.Data;
  9. /**
  10. *
  11. * @TableName goods
  12. */
  13. @TableName(value ="goods")
  14. @Data
  15. public class GoodsDto implements Serializable {
  16. /**
  17. *
  18. */
  19. @TableId(type = IdType.AUTO)
  20. private Integer id;
  21. /**
  22. *
  23. */
  24. private String goodsName;
  25. /**
  26. *
  27. */
  28. private String descriptions;
  29. /**
  30. *
  31. */
  32. private String goodsImg;
  33. /**
  34. *
  35. */
  36. private String content;
  37. /**
  38. *
  39. */
  40. private Date createdTime;
  41. @TableField(exist = false)
  42. private static final long serialVersionUID = 1L;
  43. @Override
  44. public boolean equals(Object that) {
  45. if (this == that) {
  46. return true;
  47. }
  48. if (that == null) {
  49. return false;
  50. }
  51. if (getClass() != that.getClass()) {
  52. return false;
  53. }
  54. GoodsDto other = (GoodsDto) that;
  55. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  56. && (this.getGoodsName() == null ? other.getGoodsName() == null : this.getGoodsName().equals(other.getGoodsName()))
  57. && (this.getDescriptions() == null ? other.getDescriptions() == null : this.getDescriptions().equals(other.getDescriptions()))
  58. && (this.getGoodsImg() == null ? other.getGoodsImg() == null : this.getGoodsImg().equals(other.getGoodsImg()))
  59. && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
  60. && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()));
  61. }
  62. @Override
  63. public int hashCode() {
  64. final int prime = 31;
  65. int result = 1;
  66. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  67. result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode());
  68. result = prime * result + ((getDescriptions() == null) ? 0 : getDescriptions().hashCode());
  69. result = prime * result + ((getGoodsImg() == null) ? 0 : getGoodsImg().hashCode());
  70. result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
  71. result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
  72. return result;
  73. }
  74. @Override
  75. public String toString() {
  76. StringBuilder sb = new StringBuilder();
  77. sb.append(getClass().getSimpleName());
  78. sb.append(" [");
  79. sb.append("Hash = ").append(hashCode());
  80. sb.append(", id=").append(id);
  81. sb.append(", goodsName=").append(goodsName);
  82. sb.append(", descriptions=").append(descriptions);
  83. sb.append(", goodsImg=").append(goodsImg);
  84. sb.append(", content=").append(content);
  85. sb.append(", createdTime=").append(createdTime);
  86. sb.append(", serialVersionUID=").append(serialVersionUID);
  87. sb.append("]");
  88. return sb.toString();
  89. }
  90. }