初始版本
This commit is contained in:
91
src/main/java/com/vverp/entity/NoticeEntity.java
Normal file
91
src/main/java/com/vverp/entity/NoticeEntity.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package com.vverp.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.vverp.annotation.Module;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
/**
|
||||
* 消息通知实例
|
||||
*
|
||||
* @author dealsky
|
||||
* @date 2020/1/15 10:09 上午
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "t_notice_entity")
|
||||
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "seq_notice_entity")
|
||||
@Module(generate = false)
|
||||
public class NoticeEntity extends BaseEntity<Long> {
|
||||
|
||||
/**
|
||||
* 通知
|
||||
*/
|
||||
private Notice notice;
|
||||
|
||||
/**
|
||||
* 员工
|
||||
*/
|
||||
private Admin admin;
|
||||
|
||||
/**
|
||||
* 是否已读
|
||||
*/
|
||||
private Boolean read;
|
||||
|
||||
private String content;
|
||||
|
||||
private String title;
|
||||
|
||||
public String getTitle() {
|
||||
if(getNotice() != null){
|
||||
return getNotice().getTitle();
|
||||
}else {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
if(getNotice() != null){
|
||||
return getNotice().getContent();
|
||||
}else {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
public Notice getNotice() {
|
||||
return notice;
|
||||
}
|
||||
|
||||
public void setNotice(Notice notice) {
|
||||
this.notice = notice;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
public Admin getAdmin() {
|
||||
return admin;
|
||||
}
|
||||
|
||||
public void setAdmin(Admin admin) {
|
||||
this.admin = admin;
|
||||
}
|
||||
|
||||
@Column(name = "is_read", nullable = false)
|
||||
public Boolean getRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setRead(Boolean read) {
|
||||
this.read = read;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user