|
|
|
|
@ -0,0 +1,171 @@
|
|
|
|
|
package com.ssm.aop.xml;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 公告栏实体类
|
|
|
|
|
* 对应模块:公告栏管理
|
|
|
|
|
*/
|
|
|
|
|
public class Announcement {
|
|
|
|
|
// 公告ID
|
|
|
|
|
private Integer id;
|
|
|
|
|
// 公告标题
|
|
|
|
|
private String title;
|
|
|
|
|
// 公告内容
|
|
|
|
|
private String content;
|
|
|
|
|
// 发布人
|
|
|
|
|
private String publisher;
|
|
|
|
|
// 发布时间(改为String类型,避免转换问题)
|
|
|
|
|
private String publishTime;
|
|
|
|
|
// 公告状态(0:草稿 1:已发布 2:已下架)
|
|
|
|
|
private Integer status;
|
|
|
|
|
// 公告类型(1:通知 2:重要 3:活动 4:系统 5:紧急)
|
|
|
|
|
private Integer type;
|
|
|
|
|
// 截止日期(改为String类型)
|
|
|
|
|
private String expireDate;
|
|
|
|
|
// 阅读次数
|
|
|
|
|
private Integer readCount;
|
|
|
|
|
|
|
|
|
|
// 无参构造
|
|
|
|
|
public Announcement() {}
|
|
|
|
|
|
|
|
|
|
// 有参构造
|
|
|
|
|
public Announcement(Integer id, String title, String content, String publisher,
|
|
|
|
|
String publishTime, Integer status, Integer type,
|
|
|
|
|
String expireDate, Integer readCount) {
|
|
|
|
|
this.id = id;
|
|
|
|
|
this.title = title;
|
|
|
|
|
this.content = content;
|
|
|
|
|
this.publisher = publisher;
|
|
|
|
|
this.publishTime = publishTime;
|
|
|
|
|
this.status = status;
|
|
|
|
|
this.type = type;
|
|
|
|
|
this.expireDate = expireDate;
|
|
|
|
|
this.readCount = readCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Getter & Setter 方法
|
|
|
|
|
public Integer getId() {
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setId(Integer id) {
|
|
|
|
|
this.id = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTitle() {
|
|
|
|
|
return title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTitle(String title) {
|
|
|
|
|
this.title = title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getContent() {
|
|
|
|
|
return content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setContent(String content) {
|
|
|
|
|
this.content = content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getPublisher() {
|
|
|
|
|
return publisher;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setPublisher(String publisher) {
|
|
|
|
|
this.publisher = publisher;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getPublishTime() {
|
|
|
|
|
return publishTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setPublishTime(String publishTime) {
|
|
|
|
|
this.publishTime = publishTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Integer getStatus() {
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setStatus(Integer status) {
|
|
|
|
|
this.status = status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Integer getType() {
|
|
|
|
|
return type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setType(Integer type) {
|
|
|
|
|
this.type = type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getExpireDate() {
|
|
|
|
|
return expireDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setExpireDate(String expireDate) {
|
|
|
|
|
this.expireDate = expireDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Integer getReadCount() {
|
|
|
|
|
return readCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setReadCount(Integer readCount) {
|
|
|
|
|
this.readCount = readCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取状态描述
|
|
|
|
|
public String getStatusDesc() {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case 0: return "草稿";
|
|
|
|
|
case 1: return "已发布";
|
|
|
|
|
case 2: return "已下架";
|
|
|
|
|
default: return "未知";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取类型描述
|
|
|
|
|
public String getTypeDesc() {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case 1: return "通知";
|
|
|
|
|
case 2: return "重要";
|
|
|
|
|
case 3: return "活动";
|
|
|
|
|
case 4: return "系统";
|
|
|
|
|
case 5: return "紧急";
|
|
|
|
|
default: return "未知";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 自定义printInfo方法:控制台打印公告信息
|
|
|
|
|
*/
|
|
|
|
|
public void printInfo() {
|
|
|
|
|
System.out.println("===== 【公告管理】信息 =====");
|
|
|
|
|
System.out.println("公告ID : " + id);
|
|
|
|
|
System.out.println("公告标题 : " + title);
|
|
|
|
|
System.out.println("公告内容 : " + content);
|
|
|
|
|
System.out.println("发布人 : " + publisher);
|
|
|
|
|
System.out.println("发布时间 : " + publishTime);
|
|
|
|
|
System.out.println("状态 : " + getStatusDesc());
|
|
|
|
|
System.out.println("类型 : " + getTypeDesc());
|
|
|
|
|
System.out.println("截止日期 : " + expireDate);
|
|
|
|
|
System.out.println("阅读次数 : " + readCount);
|
|
|
|
|
System.out.println("==========================\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String toString() {
|
|
|
|
|
return "Announcement{" +
|
|
|
|
|
"id=" + id +
|
|
|
|
|
", title='" + title + '\'' +
|
|
|
|
|
", content='" + content + '\'' +
|
|
|
|
|
", publisher='" + publisher + '\'' +
|
|
|
|
|
", publishTime='" + publishTime + '\'' +
|
|
|
|
|
", status=" + status + "(" + getStatusDesc() + ")" +
|
|
|
|
|
", type=" + type + "(" + getTypeDesc() + ")" +
|
|
|
|
|
", expireDate='" + expireDate + '\'' +
|
|
|
|
|
", readCount=" + readCount +
|
|
|
|
|
'}';
|
|
|
|
|
}
|
|
|
|
|
}
|