EmailEntity.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package cn.itlym.shoulder.platform.notify.sms.entity;
  2. import cn.itlym.shoulder.platform.notify.sms.dto.EmailDTO;
  3. import jakarta.persistence.Column;
  4. import jakarta.persistence.GeneratedValue;
  5. import jakarta.persistence.GenerationType;
  6. import jakarta.persistence.Id;
  7. import jakarta.persistence.Table;
  8. import java.io.Serializable;
  9. import java.sql.Timestamp;
  10. import java.util.Arrays;
  11. //@Entity
  12. @Table(name = "tb_email")
  13. public class EmailEntity implements Serializable {
  14. private static final long serialVersionUID = 1L;
  15. /**
  16. * 自增主键
  17. */
  18. @Id
  19. @GeneratedValue(strategy = GenerationType.AUTO)
  20. @Column(name = "id", unique = true, nullable = false)
  21. private Long id;
  22. /**
  23. * 接收人邮箱(多个逗号分开)
  24. */
  25. @Column(name = "receive_email", nullable = false, length = 500)
  26. private String receiveEmail;
  27. /**
  28. * 主题
  29. */
  30. @Column(name = "subject", nullable = false, length = 100)
  31. private String subject;
  32. /**
  33. * 发送内容
  34. */
  35. @Column(name = "content", nullable = false, length = 65535)
  36. private String content;
  37. /**
  38. * 模板
  39. */
  40. @Column(name = "template", nullable = false, length = 100)
  41. private String template;
  42. /**
  43. * 发送时间
  44. */
  45. @Column(name = "send_time", nullable = false, length = 19)
  46. private Timestamp sendTime;
  47. public EmailEntity() {
  48. super();
  49. }
  50. public EmailEntity(EmailDTO mail) {
  51. this.receiveEmail = Arrays.toString(mail.getReceiver_emails());
  52. this.subject = mail.getSubject();
  53. this.content = mail.getContent();
  54. this.template = mail.getTemplate();
  55. this.sendTime = new Timestamp(System.currentTimeMillis());
  56. }
  57. public Long getId() {
  58. return id;
  59. }
  60. public void setId(Long id) {
  61. this.id = id;
  62. }
  63. public String getReceiveEmail() {
  64. return receiveEmail;
  65. }
  66. public void setReceiveEmail(String receiveEmail) {
  67. this.receiveEmail = receiveEmail;
  68. }
  69. public String getSubject() {
  70. return subject;
  71. }
  72. public void setSubject(String subject) {
  73. this.subject = subject;
  74. }
  75. public String getContent() {
  76. return content;
  77. }
  78. public void setContent(String content) {
  79. this.content = content;
  80. }
  81. public String getTemplate() {
  82. return template;
  83. }
  84. public void setTemplate(String template) {
  85. this.template = template;
  86. }
  87. public Timestamp getSendTime() {
  88. return sendTime;
  89. }
  90. public void setSendTime(Timestamp sendTime) {
  91. this.sendTime = sendTime;
  92. }
  93. }