diff --git a/HomeWork-java/src/com/wetoband/template/dao/NoticeDao.java b/HomeWork-java/src/com/wetoband/template/dao/NoticeDao.java new file mode 100644 index 0000000000000000000000000000000000000000..1ac39bffd6143b26f7c0303d563a100bbaf58656 --- /dev/null +++ b/HomeWork-java/src/com/wetoband/template/dao/NoticeDao.java @@ -0,0 +1,11 @@ +package com.wetoband.template.dao; + +import com.wetoband.template.entity.Notice; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +public interface NoticeDao{ + List getNotice(Connection connection, int usr_id) throws SQLException; +} diff --git a/HomeWork-java/src/com/wetoband/template/dao/impl/NoticeDaoImpl.java b/HomeWork-java/src/com/wetoband/template/dao/impl/NoticeDaoImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..ded182eb8a2bc758c155503db145e57df7b113a6 --- /dev/null +++ b/HomeWork-java/src/com/wetoband/template/dao/impl/NoticeDaoImpl.java @@ -0,0 +1,17 @@ +package com.wetoband.template.dao.impl; + +import com.wetoband.template.dao.NoticeDao; +import com.wetoband.template.entity.Notice; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +public class NoticeDaoImpl implements NoticeDao { + + @Override + public List getNotice(Connection connection, int usr_id) throws SQLException { + return null; + } + +} diff --git a/HomeWork-java/src/com/wetoband/template/entity/Notice.java b/HomeWork-java/src/com/wetoband/template/entity/Notice.java new file mode 100644 index 0000000000000000000000000000000000000000..a3926127c834454e75797dc1bec17e2c9abf9f47 --- /dev/null +++ b/HomeWork-java/src/com/wetoband/template/entity/Notice.java @@ -0,0 +1,19 @@ +package com.wetoband.template.entity; + +import javax.persistence.Column; +import javax.persistence.Table; + +@Table(name = "notice") +public class Notice { + @Column(name = "student_id") + private Integer student_id; + @Column(name ="content") + private String content; + @Column(name ="type") + private int type; + @Column(name ="is_read") + private int is_read; + @Column(name ="submit_time") + private String submit_time; + +} diff --git a/HomeWork-java/src/com/wetoband/template/service/NoticeService.java b/HomeWork-java/src/com/wetoband/template/service/NoticeService.java new file mode 100644 index 0000000000000000000000000000000000000000..8a2b15f311b7b50d7524b8828d0d11f3baf945b2 --- /dev/null +++ b/HomeWork-java/src/com/wetoband/template/service/NoticeService.java @@ -0,0 +1,12 @@ +package com.wetoband.template.service; + + +import com.wetoband.template.entity.Notice; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +public interface NoticeService { + List getNotice(int usr_id) throws Exception; +} diff --git a/HomeWork-java/src/com/wetoband/template/service/impl/NoticeServiceImpl.java b/HomeWork-java/src/com/wetoband/template/service/impl/NoticeServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..6bcf83e72fd4b55ea66f3f26e7ea0e84282916c8 --- /dev/null +++ b/HomeWork-java/src/com/wetoband/template/service/impl/NoticeServiceImpl.java @@ -0,0 +1,24 @@ +package com.wetoband.template.service.impl; + +import com.fy.basejar.tool.ActionToolBase; +import com.wetoband.template.dao.NoticeDao; +import com.wetoband.template.entity.Notice; +import com.wetoband.template.service.NoticeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; + +import java.util.List; + +@Service +public class NoticeServiceImpl implements NoticeService { + + @Autowired + private NoticeDao noticeDao; + @Override + public List getNotice(int usr_id) throws Exception { + final Connection connection = ActionToolBase.getDBConnection(); + return noticeDao.getNotice(connection,usr_id); + } +}