Course.java 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. package com.futu.goose.course.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.math.BigDecimal;
  8. import java.util.Date;
  9. import lombok.Data;
  10. /**
  11. * 课程表
  12. * @TableName course
  13. */
  14. @TableName(value ="course")
  15. @Data
  16. public class Course implements Serializable {
  17. /**
  18. * 课程ID(雪花ID)
  19. */
  20. @TableId
  21. private Long id;
  22. /**
  23. * 课程标题
  24. */
  25. private String title;
  26. /**
  27. * 课程副标题
  28. */
  29. private String subtitle;
  30. /**
  31. * 封面图URL
  32. */
  33. private String coverImage;
  34. /**
  35. * 分类ID
  36. */
  37. private Long categoryId;
  38. /**
  39. * 主讲教师ID
  40. */
  41. private Long teacherId;
  42. /**
  43. * 课程价格
  44. */
  45. private BigDecimal price;
  46. /**
  47. * 原价
  48. */
  49. private BigDecimal originalPrice;
  50. /**
  51. * 总课时数
  52. */
  53. private Integer duration;
  54. /**
  55. * 状态:0-未发布,1-已发布,2-已下架
  56. */
  57. private Integer status;
  58. /**
  59. * 课程详情
  60. */
  61. private String description;
  62. /**
  63. * 学习目标
  64. */
  65. private String learnGoals;
  66. /**
  67. * 学习要求
  68. */
  69. private String requirements;
  70. /**
  71. * 创建时间
  72. */
  73. private Date createTime;
  74. /**
  75. * 更新时间
  76. */
  77. private Date updateTime;
  78. @TableField(exist = false)
  79. private static final long serialVersionUID = 1L;
  80. @Override
  81. public boolean equals(Object that) {
  82. if (this == that) {
  83. return true;
  84. }
  85. if (that == null) {
  86. return false;
  87. }
  88. if (getClass() != that.getClass()) {
  89. return false;
  90. }
  91. Course other = (Course) that;
  92. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  93. && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
  94. && (this.getSubtitle() == null ? other.getSubtitle() == null : this.getSubtitle().equals(other.getSubtitle()))
  95. && (this.getCoverImage() == null ? other.getCoverImage() == null : this.getCoverImage().equals(other.getCoverImage()))
  96. && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
  97. && (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()))
  98. && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
  99. && (this.getOriginalPrice() == null ? other.getOriginalPrice() == null : this.getOriginalPrice().equals(other.getOriginalPrice()))
  100. && (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()))
  101. && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
  102. && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
  103. && (this.getLearnGoals() == null ? other.getLearnGoals() == null : this.getLearnGoals().equals(other.getLearnGoals()))
  104. && (this.getRequirements() == null ? other.getRequirements() == null : this.getRequirements().equals(other.getRequirements()))
  105. && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
  106. && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
  107. }
  108. @Override
  109. public int hashCode() {
  110. final int prime = 31;
  111. int result = 1;
  112. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  113. result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
  114. result = prime * result + ((getSubtitle() == null) ? 0 : getSubtitle().hashCode());
  115. result = prime * result + ((getCoverImage() == null) ? 0 : getCoverImage().hashCode());
  116. result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
  117. result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
  118. result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
  119. result = prime * result + ((getOriginalPrice() == null) ? 0 : getOriginalPrice().hashCode());
  120. result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
  121. result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
  122. result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
  123. result = prime * result + ((getLearnGoals() == null) ? 0 : getLearnGoals().hashCode());
  124. result = prime * result + ((getRequirements() == null) ? 0 : getRequirements().hashCode());
  125. result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
  126. result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
  127. return result;
  128. }
  129. @Override
  130. public String toString() {
  131. StringBuilder sb = new StringBuilder();
  132. sb.append(getClass().getSimpleName());
  133. sb.append(" [");
  134. sb.append("Hash = ").append(hashCode());
  135. sb.append(", id=").append(id);
  136. sb.append(", title=").append(title);
  137. sb.append(", subtitle=").append(subtitle);
  138. sb.append(", coverImage=").append(coverImage);
  139. sb.append(", categoryId=").append(categoryId);
  140. sb.append(", teacherId=").append(teacherId);
  141. sb.append(", price=").append(price);
  142. sb.append(", originalPrice=").append(originalPrice);
  143. sb.append(", duration=").append(duration);
  144. sb.append(", status=").append(status);
  145. sb.append(", description=").append(description);
  146. sb.append(", learnGoals=").append(learnGoals);
  147. sb.append(", requirements=").append(requirements);
  148. sb.append(", createTime=").append(createTime);
  149. sb.append(", updateTime=").append(updateTime);
  150. sb.append(", serialVersionUID=").append(serialVersionUID);
  151. sb.append("]");
  152. return sb.toString();
  153. }
  154. }