|
|
|
|
@ -0,0 +1,101 @@
|
|
|
|
|
package com.ssm.ioc;
|
|
|
|
|
|
|
|
|
|
public class Announcement {
|
|
|
|
|
// 公告ID(主键)
|
|
|
|
|
private Integer id;
|
|
|
|
|
// 公告标题
|
|
|
|
|
private String title;
|
|
|
|
|
// 公告内容
|
|
|
|
|
private String content;
|
|
|
|
|
// 发布人
|
|
|
|
|
private String publisher;
|
|
|
|
|
// 发布时间
|
|
|
|
|
private String publishTime;
|
|
|
|
|
// 公告状态(0:未发布 1:已发布)
|
|
|
|
|
private Integer status;
|
|
|
|
|
|
|
|
|
|
// 无参构造(Spring IoC 必须)
|
|
|
|
|
public Announcement() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 全参构造(可选,方便初始化)
|
|
|
|
|
public Announcement(Integer id, String title, String content, String publisher, String publishTime, Integer status) {
|
|
|
|
|
this.id = id;
|
|
|
|
|
this.title = title;
|
|
|
|
|
this.content = content;
|
|
|
|
|
this.publisher = publisher;
|
|
|
|
|
this.publishTime = publishTime;
|
|
|
|
|
this.status = status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Getter & Setter(Spring 依赖注入必须)
|
|
|
|
|
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 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("公告状态:" + (status == 1 ? "已发布" : "未发布"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String toString() {
|
|
|
|
|
return "Announcement{" +
|
|
|
|
|
"id=" + id +
|
|
|
|
|
", title='" + title + '\'' +
|
|
|
|
|
", content='" + content + '\'' +
|
|
|
|
|
", publisher='" + publisher + '\'' +
|
|
|
|
|
", publishTime='" + publishTime + '\'' +
|
|
|
|
|
", status=" + status +
|
|
|
|
|
'}';
|
|
|
|
|
}
|
|
|
|
|
}
|