├── .gitignore ├── WebContent ├── img │ ├── r.png │ ├── body.png │ ├── home.png │ ├── logo.png │ ├── save.png │ ├── sendPost.png │ ├── login_btn.png │ ├── login_logo.png │ ├── regist_btn.png │ ├── sendReply.png │ ├── updatePwd.png │ ├── club_icon │ │ ├── acm.png │ │ ├── club.png │ │ ├── qingxie.png │ │ ├── shelian.png │ │ ├── tongxun.png │ │ ├── xinlixiehui.png │ │ ├── xueshenghui.png │ │ ├── yishutuan.png │ │ ├── 1480760399968.jpg │ │ ├── 1480760463562.png │ │ ├── 1480762040750.jpg │ │ ├── 1480769422828.jpg │ │ ├── 1480769791390.jpg │ │ ├── 1480770161734.png │ │ ├── 1480770405312.jpg │ │ ├── 1480770690171.jpg │ │ ├── 1480770942687.jpg │ │ ├── 1480771573781.png │ │ ├── 1480772529593.jpg │ │ ├── 1480772932718.png │ │ ├── 1480774288093.jpg │ │ ├── 1480774749781.jpg │ │ ├── 1480774947703.jpg │ │ ├── 1480775134375.jpg │ │ ├── 1480775273906.jpg │ │ ├── 1480775370718.jpg │ │ ├── 1480775711890.png │ │ ├── 1480775840000.jpg │ │ ├── 1480775943750.jpg │ │ ├── 1480776113265.jpg │ │ ├── 1480776317437.jpg │ │ ├── 1480776523484.jpg │ │ └── 1480776721734.jpg │ ├── register_logo.png │ └── user_head │ │ ├── acm.jpg │ │ ├── acm.png │ │ ├── lzw.jpg │ │ ├── lzw.png │ │ ├── ug.png │ │ ├── Esau.jpg │ │ ├── Esau.png │ │ ├── EsauLu.jpg │ │ ├── EsauLu.png │ │ ├── club.png │ │ ├── ershou.jpg │ │ ├── ershou.png │ │ ├── hanyu.jpg │ │ ├── hanyu.png │ │ ├── head.png │ │ ├── lunhua.jpg │ │ ├── lunhua.png │ │ ├── malie.jpg │ │ ├── malie.png │ │ ├── meishu.jpg │ │ ├── meishu.png │ │ ├── moshu.jpg │ │ ├── moshu.png │ │ ├── qiche.jpg │ │ ├── qiche.png │ │ ├── taolun.jpg │ │ ├── taolun.png │ │ ├── xinli.jpg │ │ ├── xinli.png │ │ ├── yingyu.jpg │ │ ├── yingyu.png │ │ ├── luyishao.jpg │ │ ├── luyishao.png │ │ ├── shichang.jpg │ │ ├── shichang.png │ │ ├── chuangzao.jpg │ │ ├── chuangzao.png │ │ ├── dianzisheji.jpg │ │ ├── dianzisheji.png │ │ ├── kuaijixue.png │ │ ├── login_btn .png │ │ ├── tongxunshe.png │ │ ├── xueshenghui.png │ │ ├── yishutuan.png │ │ ├── zaozhisheji.jpg │ │ ├── zaozhisheji.png │ │ ├── zhiyefazhan.jpg │ │ ├── zhiyefazhan.png │ │ ├── zhiyuanzhe.jpg │ │ ├── zhiyuanzhe.png │ │ ├── shetuanlianhe.jpg │ │ ├── shetuanlianhe.png │ │ ├── jinrongzhengquan.jpg │ │ └── jinrongzhengquan.png ├── pic │ ├── 01.jpg │ ├── 01.png │ ├── 02.jpg │ ├── 02.png │ ├── 03.jpg │ ├── 03.png │ ├── 04.jpg │ ├── 04.png │ ├── 05.jpg │ └── 05.png ├── WEB-INF │ ├── lib │ │ ├── jstl.jar │ │ ├── standard.jar │ │ ├── c3p0-0.9.1.2.jar │ │ └── mysql-connector-java-5.1.12-bin.jar │ └── web.xml ├── sys │ ├── style │ │ ├── images │ │ │ ├── help2.gif │ │ │ ├── info.gif │ │ │ ├── user.gif │ │ │ ├── logout.gif │ │ │ ├── version.gif │ │ │ ├── baizhuoxia.jpg │ │ │ ├── func20001.gif │ │ │ ├── item_point.gif │ │ │ ├── Header_back.gif │ │ │ ├── title_arrow.gif │ │ │ ├── Header_forward.gif │ │ │ ├── Header_refresh.gif │ │ │ └── img │ │ │ │ ├── menu_btn_bg.gif │ │ │ │ ├── top_head1_bg.gif │ │ │ │ ├── top_head2_bg.gif │ │ │ │ └── menu_arrow_single.gif │ │ ├── css │ │ │ ├── img │ │ │ │ ├── button_bg.png │ │ │ │ ├── title_bg.gif │ │ │ │ ├── QueryArea_bg.png │ │ │ │ ├── TableTail_bg.png │ │ │ │ ├── pageNum_bg.png │ │ │ │ ├── title_bg_end.gif │ │ │ │ ├── TableTitle_bg.png │ │ │ │ ├── title_bg_head.gif │ │ │ │ └── inputPageHeadBg.gif │ │ │ └── index_1.css │ │ └── js │ │ │ └── page_common.js │ ├── sysAdmin.jsp │ ├── public │ │ ├── right.jsp │ │ ├── bottom.jsp │ │ ├── dataTableTop.jsp │ │ ├── left.jsp │ │ └── top.jsp │ ├── clubTypeEdit.jsp │ ├── postTypeEdit.jsp │ ├── adminLogin.jsp │ └── adClub.jsp ├── css │ └── top.css ├── content │ ├── clubList.jsp │ ├── userSetting.jsp │ ├── loginOut.jsp │ ├── loginSuccess.jsp │ ├── registerSuccess.jsp │ ├── public.jsp │ └── clubListBody.jsp ├── index.jsp └── public │ ├── foot.jsp │ └── top.jsp ├── src ├── campusbbs │ ├── model │ │ ├── dao │ │ │ ├── MailDAO.java │ │ │ ├── impl │ │ │ │ ├── MailDAOImpl.java │ │ │ │ ├── AdminDAOImpl.java │ │ │ │ ├── ReplyDAOImpl.java │ │ │ │ ├── UserDAOImpl.java │ │ │ │ ├── ClubDAOImpl.java │ │ │ │ └── PostDAOImpl.java │ │ │ ├── AdminDAO.java │ │ │ ├── ReplyDAO.java │ │ │ ├── UserDAO.java │ │ │ ├── ClubDAO.java │ │ │ └── PostDAO.java │ │ ├── service │ │ │ ├── CheckService.java │ │ │ ├── UploadService.java │ │ │ ├── UserService.java │ │ │ ├── PageService.java │ │ │ ├── AdminPageService.java │ │ │ ├── impl │ │ │ │ ├── ServiceUtils.java │ │ │ │ ├── CheckServiceImpl.java │ │ │ │ ├── UploadServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── SysAdminService.java │ │ ├── factory │ │ │ ├── BeanFactory.java │ │ │ └── DAOFactory.java │ │ ├── bean │ │ │ ├── RegistBean.java │ │ │ ├── ClubEditBean.java │ │ │ ├── HomeBean.java │ │ │ ├── AdReplyBean.java │ │ │ ├── AdUserBean.java │ │ │ ├── LastPostBean.java │ │ │ ├── AdClubEditBean.java │ │ │ ├── ClubListBean.java │ │ │ ├── PostBean.java │ │ │ ├── ListBean.java │ │ │ ├── UserInfoBean.java │ │ │ └── ClubBean.java │ │ ├── vo │ │ │ ├── MailServer.java │ │ │ ├── ClubType.java │ │ │ ├── SystemAdmin.java │ │ │ ├── PostType.java │ │ │ ├── ClubAdmin.java │ │ │ ├── User.java │ │ │ ├── UserInfo.java │ │ │ ├── Club.java │ │ │ ├── Reply.java │ │ │ └── Post.java │ │ └── utils │ │ │ ├── FactoryUtils.java │ │ │ ├── DBUtils.java │ │ │ ├── FileUtils.java │ │ │ ├── BeanHandler.java │ │ │ └── SQLUtils.java │ └── controller │ │ └── servlet │ │ └── CheckServlet.java ├── dao.properties ├── c3p0-config.xml └── bean.properties ├── README.md └── campusbbs.iml /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | -------------------------------------------------------------------------------- /WebContent/img/r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/r.png -------------------------------------------------------------------------------- /WebContent/pic/01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/01.jpg -------------------------------------------------------------------------------- /WebContent/pic/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/01.png -------------------------------------------------------------------------------- /WebContent/pic/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/02.jpg -------------------------------------------------------------------------------- /WebContent/pic/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/02.png -------------------------------------------------------------------------------- /WebContent/pic/03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/03.jpg -------------------------------------------------------------------------------- /WebContent/pic/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/03.png -------------------------------------------------------------------------------- /WebContent/pic/04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/04.jpg -------------------------------------------------------------------------------- /WebContent/pic/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/04.png -------------------------------------------------------------------------------- /WebContent/pic/05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/05.jpg -------------------------------------------------------------------------------- /WebContent/pic/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/pic/05.png -------------------------------------------------------------------------------- /WebContent/img/body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/body.png -------------------------------------------------------------------------------- /WebContent/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/home.png -------------------------------------------------------------------------------- /WebContent/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/logo.png -------------------------------------------------------------------------------- /WebContent/img/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/save.png -------------------------------------------------------------------------------- /WebContent/img/sendPost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/sendPost.png -------------------------------------------------------------------------------- /WebContent/img/login_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/login_btn.png -------------------------------------------------------------------------------- /WebContent/img/login_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/login_logo.png -------------------------------------------------------------------------------- /WebContent/img/regist_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/regist_btn.png -------------------------------------------------------------------------------- /WebContent/img/sendReply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/sendReply.png -------------------------------------------------------------------------------- /WebContent/img/updatePwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/updatePwd.png -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/jstl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/WEB-INF/lib/jstl.jar -------------------------------------------------------------------------------- /WebContent/img/club_icon/acm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/acm.png -------------------------------------------------------------------------------- /WebContent/img/register_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/register_logo.png -------------------------------------------------------------------------------- /WebContent/img/user_head/acm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/acm.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/acm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/acm.png -------------------------------------------------------------------------------- /WebContent/img/user_head/lzw.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/lzw.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/lzw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/lzw.png -------------------------------------------------------------------------------- /WebContent/img/user_head/ug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/ug.png -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/standard.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/WEB-INF/lib/standard.jar -------------------------------------------------------------------------------- /WebContent/img/club_icon/club.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/club.png -------------------------------------------------------------------------------- /WebContent/img/user_head/Esau.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/Esau.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/Esau.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/Esau.png -------------------------------------------------------------------------------- /WebContent/img/user_head/EsauLu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/EsauLu.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/EsauLu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/EsauLu.png -------------------------------------------------------------------------------- /WebContent/img/user_head/club.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/club.png -------------------------------------------------------------------------------- /WebContent/img/user_head/ershou.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/ershou.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/ershou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/ershou.png -------------------------------------------------------------------------------- /WebContent/img/user_head/hanyu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/hanyu.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/hanyu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/hanyu.png -------------------------------------------------------------------------------- /WebContent/img/user_head/head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/head.png -------------------------------------------------------------------------------- /WebContent/img/user_head/lunhua.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/lunhua.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/lunhua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/lunhua.png -------------------------------------------------------------------------------- /WebContent/img/user_head/malie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/malie.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/malie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/malie.png -------------------------------------------------------------------------------- /WebContent/img/user_head/meishu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/meishu.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/meishu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/meishu.png -------------------------------------------------------------------------------- /WebContent/img/user_head/moshu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/moshu.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/moshu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/moshu.png -------------------------------------------------------------------------------- /WebContent/img/user_head/qiche.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/qiche.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/qiche.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/qiche.png -------------------------------------------------------------------------------- /WebContent/img/user_head/taolun.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/taolun.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/taolun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/taolun.png -------------------------------------------------------------------------------- /WebContent/img/user_head/xinli.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/xinli.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/xinli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/xinli.png -------------------------------------------------------------------------------- /WebContent/img/user_head/yingyu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/yingyu.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/yingyu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/yingyu.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/qingxie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/qingxie.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/shelian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/shelian.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/tongxun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/tongxun.png -------------------------------------------------------------------------------- /WebContent/img/user_head/luyishao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/luyishao.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/luyishao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/luyishao.png -------------------------------------------------------------------------------- /WebContent/img/user_head/shichang.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/shichang.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/shichang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/shichang.png -------------------------------------------------------------------------------- /WebContent/sys/style/images/help2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/help2.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/info.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/info.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/user.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/user.gif -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/c3p0-0.9.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/WEB-INF/lib/c3p0-0.9.1.2.jar -------------------------------------------------------------------------------- /WebContent/img/club_icon/xinlixiehui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/xinlixiehui.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/xueshenghui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/xueshenghui.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/yishutuan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/yishutuan.png -------------------------------------------------------------------------------- /WebContent/img/user_head/chuangzao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/chuangzao.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/chuangzao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/chuangzao.png -------------------------------------------------------------------------------- /WebContent/img/user_head/dianzisheji.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/dianzisheji.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/dianzisheji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/dianzisheji.png -------------------------------------------------------------------------------- /WebContent/img/user_head/kuaijixue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/kuaijixue.png -------------------------------------------------------------------------------- /WebContent/img/user_head/login_btn .png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/login_btn .png -------------------------------------------------------------------------------- /WebContent/img/user_head/tongxunshe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/tongxunshe.png -------------------------------------------------------------------------------- /WebContent/img/user_head/xueshenghui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/xueshenghui.png -------------------------------------------------------------------------------- /WebContent/img/user_head/yishutuan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/yishutuan.png -------------------------------------------------------------------------------- /WebContent/img/user_head/zaozhisheji.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/zaozhisheji.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/zaozhisheji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/zaozhisheji.png -------------------------------------------------------------------------------- /WebContent/img/user_head/zhiyefazhan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/zhiyefazhan.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/zhiyefazhan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/zhiyefazhan.png -------------------------------------------------------------------------------- /WebContent/img/user_head/zhiyuanzhe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/zhiyuanzhe.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/zhiyuanzhe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/zhiyuanzhe.png -------------------------------------------------------------------------------- /WebContent/sys/style/images/logout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/logout.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/version.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/version.gif -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480760399968.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480760399968.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480760463562.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480760463562.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480762040750.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480762040750.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480769422828.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480769422828.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480769791390.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480769791390.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480770161734.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480770161734.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480770405312.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480770405312.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480770690171.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480770690171.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480770942687.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480770942687.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480771573781.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480771573781.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480772529593.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480772529593.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480772932718.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480772932718.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480774288093.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480774288093.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480774749781.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480774749781.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480774947703.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480774947703.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480775134375.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480775134375.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480775273906.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480775273906.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480775370718.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480775370718.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480775711890.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480775711890.png -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480775840000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480775840000.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480775943750.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480775943750.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480776113265.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480776113265.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480776317437.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480776317437.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480776523484.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480776523484.jpg -------------------------------------------------------------------------------- /WebContent/img/club_icon/1480776721734.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/club_icon/1480776721734.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/shetuanlianhe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/shetuanlianhe.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/shetuanlianhe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/shetuanlianhe.png -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/button_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/button_bg.png -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/title_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/title_bg.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/baizhuoxia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/baizhuoxia.jpg -------------------------------------------------------------------------------- /WebContent/sys/style/images/func20001.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/func20001.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/item_point.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/item_point.gif -------------------------------------------------------------------------------- /WebContent/img/user_head/jinrongzhengquan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/jinrongzhengquan.jpg -------------------------------------------------------------------------------- /WebContent/img/user_head/jinrongzhengquan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/img/user_head/jinrongzhengquan.png -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/QueryArea_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/QueryArea_bg.png -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/TableTail_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/TableTail_bg.png -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/pageNum_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/pageNum_bg.png -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/title_bg_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/title_bg_end.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/Header_back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/Header_back.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/title_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/title_arrow.gif -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/TableTitle_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/TableTitle_bg.png -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/title_bg_head.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/title_bg_head.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/Header_forward.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/Header_forward.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/Header_refresh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/Header_refresh.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/img/menu_btn_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/img/menu_btn_bg.gif -------------------------------------------------------------------------------- /WebContent/sys/style/css/img/inputPageHeadBg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/css/img/inputPageHeadBg.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/img/top_head1_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/img/top_head1_bg.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/img/top_head2_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/img/top_head2_bg.gif -------------------------------------------------------------------------------- /WebContent/sys/style/images/img/menu_arrow_single.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/sys/style/images/img/menu_arrow_single.gif -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimpleGraduationProjects/SchoolForumSystem/HEAD/WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar -------------------------------------------------------------------------------- /src/campusbbs/model/dao/MailDAO.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.MailServer; 6 | 7 | public interface MailDAO { 8 | public List findMailServerList(); 9 | public long getMailServerCount(); 10 | } 11 | -------------------------------------------------------------------------------- /WebContent/css/top.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | 3 | #top_bg { 4 | background-color: gray; 5 | margin: auto; 6 | } 7 | 8 | #top_div { 9 | background-color: blue; 10 | margin: auto; 11 | width: 960px; 12 | } 13 | 14 | #nav_div { 15 | 16 | } 17 | 18 | li { 19 | display: inline; 20 | } -------------------------------------------------------------------------------- /src/campusbbs/model/service/CheckService.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service; 2 | 3 | import java.awt.image.BufferedImage; 4 | 5 | public interface CheckService { 6 | 7 | public BufferedImage getCheckImage(String check,int width,int height); 8 | 9 | public String getCheckString(int checkLenght); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/dao.properties: -------------------------------------------------------------------------------- 1 | 2 | userDAO=campusbbs.model.dao.impl.UserDAOImpl 3 | 4 | clubDAO=campusbbs.model.dao.impl.ClubDAOImpl 5 | 6 | postDAO=campusbbs.model.dao.impl.PostDAOImpl 7 | 8 | adminDAO=campusbbs.model.dao.impl.AdminDAOImpl 9 | 10 | replyDAO=campusbbs.model.dao.impl.ReplyDAOImpl 11 | 12 | mailDAO=campusbbs.model.dao.impl.MailDAOImpl 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WebContent/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | index.jsp 5 | 6 | -------------------------------------------------------------------------------- /src/campusbbs/model/factory/BeanFactory.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.factory; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | import campusbbs.model.utils.FactoryUtils; 6 | 7 | public class BeanFactory{ 8 | 9 | private static ResourceBundle bundle=ResourceBundle.getBundle("bean"); 10 | 11 | @SuppressWarnings("unchecked") 12 | public static T getServiceInstance(String key,Class classObj){ 13 | return (T)FactoryUtils.getInstance(bundle, key, classObj); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/c3p0-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.mysql.jdbc.Driver 6 | jdbc:mysql://localhost:3306/graduation_5_campusbbs?characterEncoding=utf8 7 | root 8 | 123456 9 | 50 10 | 60 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/bean.properties: -------------------------------------------------------------------------------- 1 | 2 | # User 3 | userService=campusbbs.model.service.impl.UserServiceImpl 4 | 5 | # Check 6 | checkService=campusbbs.model.service.impl.CheckServiceImpl 7 | 8 | #pageService 9 | pageService=campusbbs.model.service.impl.PageServiceImpl 10 | 11 | #UploadService 12 | uploadService=campusbbs.model.service.impl.UploadServiceImpl 13 | 14 | #AdminPageService 15 | adminPageService=campusbbs.model.service.impl.AdminPageServiceImpl 16 | 17 | #SysAdminService 18 | sysAdminService=campusbbs.model.service.impl.SysAdminServiceImpl 19 | -------------------------------------------------------------------------------- /WebContent/content/clubList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /WebContent/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.io.File"%> 2 | <%@ page contentType="text/html; charset=utf-8" language="java" 3 | import="java.sql.*" errorPage=""%> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 校园社团论坛 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/RegistBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.MailServer; 6 | 7 | public class RegistBean { 8 | 9 | private List mailServerList; 10 | 11 | public RegistBean() { 12 | super(); 13 | // TODO Auto-generated constructor stub 14 | } 15 | 16 | public List getMailServerList() { 17 | return mailServerList; 18 | } 19 | 20 | public void setMailServerList(List mailServerList) { 21 | this.mailServerList = mailServerList; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/ClubEditBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import campusbbs.model.vo.Club; 4 | 5 | public class ClubEditBean { 6 | 7 | private Club club; 8 | private String url; 9 | 10 | public ClubEditBean() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public Club getClub() { 16 | return club; 17 | } 18 | 19 | public void setClub(Club club) { 20 | this.club = club; 21 | } 22 | 23 | public String getUrl() { 24 | return url; 25 | } 26 | 27 | public void setUrl(String url) { 28 | this.url = url; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/MailServer.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | public class MailServer { 4 | 5 | private int emailServerId; 6 | private String domain;//邮件服务器域名 7 | 8 | public MailServer() { 9 | super(); 10 | // TODO Auto-generated constructor stub 11 | } 12 | public int getEmailServerId() { 13 | return emailServerId; 14 | } 15 | public void setEmailServerId(int emailServerId) { 16 | this.emailServerId = emailServerId; 17 | } 18 | public String getDomain() { 19 | return domain; 20 | } 21 | public void setDomain(String domain) { 22 | this.domain = domain; 23 | } 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/HomeBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.Club; 6 | import campusbbs.model.vo.Post; 7 | 8 | public class HomeBean{ 9 | 10 | private List hostPosts; 11 | private List hostClubs; 12 | public List getHostPosts() { 13 | return hostPosts; 14 | } 15 | public void setHostPosts(List hostPosts) { 16 | this.hostPosts = hostPosts; 17 | } 18 | public List getHostClubs() { 19 | return hostClubs; 20 | } 21 | public void setHostClubs(List hostClubs) { 22 | this.hostClubs = hostClubs; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/campusbbs/model/factory/DAOFactory.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.factory; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | import campusbbs.model.utils.FactoryUtils; 6 | 7 | public class DAOFactory { 8 | 9 | private static ResourceBundle bundle=ResourceBundle.getBundle("dao"); 10 | 11 | @SuppressWarnings("unchecked") 12 | public static T getDAOInstance(String key,Class classObj){ 13 | return (T)FactoryUtils.getInstance(bundle, key, classObj); 14 | } 15 | 16 | } 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /WebContent/content/userSetting.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="campusbbs.model.vo.User"%> 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 5 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/ClubType.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | public class ClubType { 4 | private int clubTypeId; 5 | private String clubType; 6 | public ClubType() { 7 | super(); 8 | // TODO Auto-generated constructor stub 9 | } 10 | public int getClubTypeId() { 11 | return clubTypeId; 12 | } 13 | public void setClubTypeId(int clubTypeId) { 14 | this.clubTypeId = clubTypeId; 15 | } 16 | public String getClubType() { 17 | return clubType; 18 | } 19 | public void setClubType(String clubType) { 20 | this.clubType = clubType; 21 | } 22 | @Override 23 | public String toString() { 24 | return "ClubType [clubTypeId=" + clubTypeId + ", clubType=" + clubType + "]"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/SystemAdmin.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | /** 4 | * 系统管理员 5 | * @author Administrator 6 | * 7 | */ 8 | public class SystemAdmin { 9 | 10 | private String adminName; 11 | private String passwd; 12 | public SystemAdmin() { 13 | super(); 14 | // TODO Auto-generated constructor stub 15 | } 16 | public String getAdminName() { 17 | return adminName; 18 | } 19 | public void setAdminName(String adminName) { 20 | this.adminName = adminName; 21 | } 22 | public String getPasswd() { 23 | return passwd; 24 | } 25 | public void setPasswd(String passwd) { 26 | this.passwd = passwd; 27 | } 28 | @Override 29 | public String toString() { 30 | return "SystemAdmin [adminName=" + adminName + ", passwd=" + passwd 31 | + "]"; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/AdReplyBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import campusbbs.model.vo.Post; 4 | import campusbbs.model.vo.PostType; 5 | import campusbbs.model.vo.Reply; 6 | 7 | public class AdReplyBean extends ListBean{ 8 | 9 | private Post post; 10 | private PostType postType; 11 | 12 | public AdReplyBean() { 13 | super(); 14 | // TODO Auto-generated constructor stub 15 | } 16 | 17 | public Post getPost() { 18 | return post; 19 | } 20 | public void setPost(Post post) { 21 | this.post = post; 22 | } 23 | 24 | public PostType getPostType() { 25 | return postType; 26 | } 27 | 28 | public void setPostType(PostType postType) { 29 | this.postType = postType; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "AdReplyBean [post=" + post + ", postType=" + postType + "]\n"+super.toString(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/campusbbs/model/utils/FactoryUtils.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.utils; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | public class FactoryUtils { 6 | 7 | public static Object getInstance(ResourceBundle bundle,String key,Class classObj){ 8 | 9 | System.out.println(key); 10 | String className=bundle.getString(key); 11 | 12 | System.out.println(className); 13 | 14 | try { 15 | 16 | Object obj=Class.forName(className).newInstance(); 17 | return obj; 18 | 19 | } catch (InstantiationException e) { 20 | // TODO Auto-generated catch block 21 | e.printStackTrace(); 22 | } catch (IllegalAccessException e) { 23 | // TODO Auto-generated catch block 24 | e.printStackTrace(); 25 | } catch (ClassNotFoundException e) { 26 | // TODO Auto-generated catch block 27 | e.printStackTrace(); 28 | } 29 | 30 | return null; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/PostType.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | public class PostType { 4 | private int postTypeId; 5 | private String postType; 6 | private String color; 7 | public PostType() { 8 | super(); 9 | // TODO Auto-generated constructor stub 10 | } 11 | public int getPostTypeId() { 12 | return postTypeId; 13 | } 14 | public void setPostTypeId(int postTypeId) { 15 | this.postTypeId = postTypeId; 16 | } 17 | public String getPostType() { 18 | return postType; 19 | } 20 | public void setPostType(String postType) { 21 | this.postType = postType; 22 | } 23 | public String getColor() { 24 | return color; 25 | } 26 | public void setColor(String color) { 27 | this.color = color; 28 | } 29 | @Override 30 | public String toString() { 31 | return "PostType [postTypeId=" + postTypeId + ", postType=" + postType + ", color=" + color + "]"; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /WebContent/content/loginOut.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 20 |
21 |

22 | 退出登陆!
23 | 3秒后自动跳转到登陆页...
24 | 立即跳转 25 |

26 |
27 | 28 | -------------------------------------------------------------------------------- /WebContent/content/loginSuccess.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 20 |
21 |

22 | 登陆成功!
23 | 3秒后自动跳转到首页...
24 | 立即跳转 25 |

26 |
27 | 28 | -------------------------------------------------------------------------------- /WebContent/content/registerSuccess.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 20 |
21 |

22 | 注册成功!
23 | 3秒后自动跳转到登陆页...
24 | 立即跳转 25 |

26 |
27 | 28 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/AdUserBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import campusbbs.model.vo.MailServer; 7 | import campusbbs.model.vo.User; 8 | 9 | public class AdUserBean extends ListBean { 10 | 11 | private List mailServerIdList; 12 | private Map mailServerMap; 13 | 14 | public AdUserBean() { 15 | super(); 16 | // TODO Auto-generated constructor stub 17 | } 18 | public List getMailServerIdList() { 19 | return mailServerIdList; 20 | } 21 | public void setMailServerIdList(List mailServerIdList) { 22 | this.mailServerIdList = mailServerIdList; 23 | } 24 | public Map getMailServerMap() { 25 | return mailServerMap; 26 | } 27 | public void setMailServerMap(Map mailServerMap) { 28 | this.mailServerMap = mailServerMap; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/LastPostBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import campusbbs.model.vo.PostType; 7 | 8 | public class LastPostBean extends ListBean { 9 | 10 | private List postTypeIdList; 11 | private Map postTypeMap; 12 | public LastPostBean() { 13 | super(); 14 | // TODO Auto-generated constructor stub 15 | } 16 | public List getPostTypeIdList() { 17 | return postTypeIdList; 18 | } 19 | public void setPostTypeIdList(List postTypeIdList) { 20 | this.postTypeIdList = postTypeIdList; 21 | } 22 | public Map getPostTypeMap() { 23 | return postTypeMap; 24 | } 25 | public void setPostTypeMap(Map postTypeMap) { 26 | this.postTypeMap = postTypeMap; 27 | } 28 | @Override 29 | public String toString() { 30 | return super.toString(); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/campusbbs/model/utils/DBUtils.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.utils; 2 | 3 | import java.sql.Connection; 4 | import java.sql.SQLException; 5 | 6 | import javax.sql.DataSource; 7 | 8 | import com.mchange.v2.c3p0.ComboPooledDataSource; 9 | 10 | public class DBUtils { 11 | 12 | private static DataSource dataSource; 13 | static { 14 | dataSource=new ComboPooledDataSource(); 15 | } 16 | 17 | /** 18 | * 从连接池获取数据库连接 19 | * @return 20 | */ 21 | public static Connection getDBConnection(){ 22 | Connection con=null; 23 | try { 24 | con=dataSource.getConnection(); 25 | } catch (SQLException e) { 26 | // TODO Auto-generated catch block 27 | e.printStackTrace(); 28 | } 29 | // System.out.println("获取connection"); 30 | return con; 31 | } 32 | 33 | /** 34 | * 获取SQL处理工具类 35 | * @return SQLUtils对象 36 | */ 37 | public static SQLUtils getSQLUtils(){ 38 | return new SQLUtils(getDBConnection()); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/AdClubEditBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import campusbbs.model.vo.ClubAdmin; 4 | import campusbbs.model.vo.ClubType; 5 | 6 | import java.util.List; 7 | 8 | public class AdClubEditBean extends ClubEditBean{ 9 | 10 | private List typeList; 11 | private List adminList; 12 | 13 | public AdClubEditBean() { 14 | super(); 15 | // TODO Auto-generated constructor stub 16 | } 17 | 18 | public List getTypeList() { 19 | return typeList; 20 | } 21 | 22 | public void setTypeList(List typeList) { 23 | this.typeList = typeList; 24 | } 25 | 26 | public List getAdminList() { 27 | return adminList; 28 | } 29 | 30 | public void setAdminList(List adminList) { 31 | this.adminList = adminList; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "AdClubEditBean [typeList=" + typeList + ", adminList=" + adminList + "]"; 37 | } 38 | 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/impl/MailDAOImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.dao.MailDAO; 6 | import campusbbs.model.utils.SQLUtils; 7 | import campusbbs.model.vo.MailServer; 8 | 9 | public class MailDAOImpl implements MailDAO { 10 | 11 | @Override 12 | public List findMailServerList() { 13 | // TODO Auto-generated method stub 14 | 15 | String sql="select * from mail_server;"; 16 | 17 | return SQLUtils.queryRecordList(sql, MailServer.class); 18 | 19 | } 20 | 21 | @Override 22 | public long getMailServerCount() { 23 | // TODO Auto-generated method stub 24 | 25 | String sql="select count(*) from mail_server;"; 26 | 27 | return SQLUtils.getRecordCount(sql); 28 | 29 | } 30 | 31 | } 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/ClubListBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import campusbbs.model.vo.Club; 7 | import campusbbs.model.vo.ClubType; 8 | 9 | public class ClubListBean { 10 | 11 | private Map> clubMap; 12 | private List clubTypeList; 13 | 14 | public ClubListBean() { 15 | super(); 16 | // TODO Auto-generated constructor stub 17 | } 18 | 19 | public Map> getClubMap() { 20 | return clubMap; 21 | } 22 | 23 | public void setClubMap(Map> clubMap) { 24 | this.clubMap = clubMap; 25 | } 26 | 27 | public List getClubTypeList() { 28 | return clubTypeList; 29 | } 30 | public void setClubTypeList(List clubTypeList) { 31 | this.clubTypeList = clubTypeList; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "ClubListBean [clubMap=" + clubMap + ", clubTypeList=" + clubTypeList + "]"; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/ClubAdmin.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | /** 4 | * 版主 5 | * @author EsauLu 6 | * 7 | */ 8 | public class ClubAdmin { 9 | 10 | /** 11 | * 用户名 12 | */ 13 | private String userName; 14 | 15 | /** 16 | * 版块名 17 | */ 18 | private String clubName; 19 | 20 | public ClubAdmin() { 21 | super(); 22 | // TODO Auto-generated constructor stub 23 | } 24 | 25 | public ClubAdmin(String userName, String clubName) { 26 | super(); 27 | this.userName = userName; 28 | this.clubName = clubName; 29 | } 30 | 31 | public String getUserName() { 32 | return userName; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return "ClubAdmin [userName=" + userName + ", clubName=" + clubName + "]"; 38 | } 39 | 40 | public void setUserName(String userName) { 41 | this.userName = userName; 42 | } 43 | 44 | public String getClubName() { 45 | return clubName; 46 | } 47 | 48 | public void setClubName(String clubName) { 49 | this.clubName = clubName; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /WebContent/public/foot.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 38 | 39 |
40 | 41 | 57 | 58 | 59 | 60 |
61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /WebContent/sys/sysAdmin.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | 3 | 4 | 5 | 6 | 7 | 论坛后台管理 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | <body> 19 | 你的浏览器不支持框架布局,推荐你使用<a href="http://www.firefox.com.cn/download/" style="text-decoration: none;">火狐浏览器</a>, 20 | <a href="http://www.google.cn/intl/zh-CN/chrome/" style="text-decoration: none;">谷歌浏览器</a> 21 | </body> 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/UploadService.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service; 2 | 3 | import java.awt.Image; 4 | import java.io.IOException; 5 | 6 | import javax.servlet.http.Part; 7 | 8 | public interface UploadService { 9 | 10 | // 11 | public Image getImage(Part part) throws IOException; 12 | 13 | public void saveImage(Image img,String path,String fileName); 14 | 15 | /** 16 | * 保存图片 17 | * @param part Part类型参数 18 | * @param path 图片文件保存路径 19 | * @param fileName 图片文件名 20 | */ 21 | public boolean saveImage(Part part,String path,String newfileName,String oldFileName); 22 | 23 | /** 24 | * 获取上传的图片文件名 25 | * @param part Part类型参数 26 | * @return 图片格式 27 | */ 28 | public String getImageName(Part part); 29 | 30 | /** 31 | * 获取文本参数 32 | * @param part Part类型参数 33 | * @return 参数值 34 | */ 35 | public String getStringParameter(Part part); 36 | 37 | } 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /WebContent/sys/public/right.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | 30 | 34 |
35 |

欢迎使用吉珠联盟后台管理

36 |
37 |
38 | 39 |
40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/User.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | /** 4 | * 用户 5 | * @author EsauLu 6 | * 7 | */ 8 | public class User { 9 | 10 | /** 11 | * 用户名 12 | */ 13 | private String userName; 14 | 15 | /** 16 | * 密码 17 | */ 18 | private String passwd; 19 | 20 | /** 21 | * 用户信息 22 | */ 23 | private UserInfo userInfo; 24 | 25 | public User() { 26 | super(); 27 | // TODO Auto-generated constructor stub 28 | } 29 | 30 | public User(String userName, String passwd) { 31 | super(); 32 | this.userName = userName; 33 | this.passwd = passwd; 34 | } 35 | 36 | public String getUserName() { 37 | return userName; 38 | } 39 | 40 | public void setUserName(String userName) { 41 | this.userName = userName; 42 | } 43 | 44 | public String getPasswd() { 45 | return passwd; 46 | } 47 | 48 | public void setPasswd(String passwd) { 49 | this.passwd = passwd; 50 | } 51 | 52 | public UserInfo getUserInfo() { 53 | return userInfo; 54 | } 55 | 56 | public void setUserInfo(UserInfo userInfo) { 57 | this.userInfo = userInfo; 58 | } 59 | 60 | @Override 61 | public String toString() { 62 | String to="User [userName=" + userName + ", passwd=" + passwd; 63 | if(userInfo!=null){ 64 | to+=", userInfo="+userInfo.toString() + "]"; 65 | } 66 | to+="]"; 67 | return to; 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/AdminDAO.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.ClubAdmin; 6 | 7 | public interface AdminDAO { 8 | 9 | /** 10 | * 添加版主 11 | * @param admin 版主信息 12 | */ 13 | public void saveAdmin(ClubAdmin admin); 14 | 15 | /** 16 | * 判断用户userName是否clubName版块的版主 17 | * @param userName 用户名 18 | * @param clubName 版块名 19 | * @return true表示userName是clubName的版主,否则不是 20 | */ 21 | public boolean isClubAdmin(String userName,String clubName); 22 | 23 | /** 24 | * 删除版主 25 | * @param userName 用户名 26 | * @param clubName 版块名 27 | */ 28 | public void deleteAdmin(String userName,String clubName); 29 | 30 | /** 31 | * 查找指定版主的版主 32 | * @param userName 用户名 33 | * @param clubName 版块名 34 | * @return ClubAdmin对象 35 | */ 36 | public ClubAdmin findClubAdmin(String userName,String clubName); 37 | 38 | /** 39 | * 获取某版块的所有版主 40 | * @param clubName 版块名 41 | * @return 版主列表 42 | */ 43 | public List findAdminByClub(String clubName); 44 | 45 | /** 46 | * 获取所有版主信息 47 | * @return 版主列表 48 | */ 49 | public List findAllClubAdmin(int pageCode,int size); 50 | 51 | /** 52 | * 获取版主数量 53 | * @return 版主数量 54 | */ 55 | public long getClubAdminCount(); 56 | 57 | 58 | } 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/PostBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import campusbbs.model.vo.Post; 7 | import campusbbs.model.vo.PostType; 8 | 9 | public class PostBean extends ListBean{ 10 | 11 | private Post post; 12 | private List postTypeIdList; 13 | private Map postTypeMap; 14 | // private boolean isAdmin; 15 | 16 | public PostBean() { 17 | super(); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public Post getPost() { 22 | return post; 23 | } 24 | 25 | public void setPost(Post post) { 26 | this.post = post; 27 | } 28 | 29 | public List getPostTypeIdList() { 30 | return postTypeIdList; 31 | } 32 | 33 | public void setPostTypeIdList(List postTypeIdList) { 34 | this.postTypeIdList = postTypeIdList; 35 | } 36 | 37 | public Map getPostTypeMap() { 38 | return postTypeMap; 39 | } 40 | 41 | public void setPostTypeMap(Map postTypeMap) { 42 | this.postTypeMap = postTypeMap; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return "PostBean [post=" + post + ", postTypeIdList=" + postTypeIdList + ", postTypeMap=" + postTypeMap + "]"; 48 | } 49 | 50 | // public boolean isAdmin() { 51 | // return isAdmin; 52 | // } 53 | // 54 | // public void setAdmin(boolean isAdmin) { 55 | // this.isAdmin = isAdmin; 56 | // } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/ListBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | 5 | public class ListBean{ 6 | 7 | private int pageCode;//当前页码 8 | // private int pageNum;//总页数 9 | private int recordNum;//每页数据条数 10 | private long recordTotel;//数据总数 11 | 12 | private List beanList; 13 | 14 | public ListBean() { 15 | super(); 16 | // TODO Auto-generated constructor stub 17 | } 18 | 19 | public int getPageCode() { 20 | return pageCode; 21 | } 22 | 23 | public void setPageCode(int pageCode) { 24 | this.pageCode = pageCode; 25 | } 26 | 27 | public int getPageNum() { 28 | int num=(int)(recordTotel/recordNum); 29 | return recordTotel%recordNum==0?num:num+1; 30 | } 31 | 32 | // public void setPageNum(int pageNum) { 33 | // this.pageNum = pageNum; 34 | // } 35 | 36 | public int getRecordNum() { 37 | return recordNum; 38 | } 39 | 40 | public void setRecordNum(int recordNum) { 41 | this.recordNum = recordNum; 42 | } 43 | 44 | public long getRecordTotel() { 45 | return recordTotel; 46 | } 47 | 48 | public void setRecordTotel(long recordTotel) { 49 | this.recordTotel = recordTotel; 50 | } 51 | 52 | public List getBeanList() { 53 | return beanList; 54 | } 55 | 56 | public void setBeanList(List beanList) { 57 | this.beanList = beanList; 58 | } 59 | 60 | @Override 61 | public String toString() { 62 | return "ListBean [pageCode=" + pageCode + ", recordNum=" + recordNum + ", recordTotel=" + recordTotel + "]"; 63 | } 64 | 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/UserInfo.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | public class UserInfo { 4 | 5 | 6 | /** 7 | * 头像 8 | */ 9 | private String userName; 10 | 11 | /** 12 | * 头像 13 | */ 14 | private String head; 15 | 16 | /** 17 | * 联系邮箱 18 | */ 19 | private String emailAccount; 20 | 21 | /** 22 | * 邮箱服务器 23 | */ 24 | private int emailServerId; 25 | 26 | /** 27 | * 昵称 28 | */ 29 | private String nickname; 30 | 31 | public UserInfo() { 32 | super(); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | public String getUserName() { 37 | return userName; 38 | } 39 | 40 | public void setUserName(String userName) { 41 | this.userName = userName; 42 | } 43 | 44 | public String getHead() { 45 | return head; 46 | } 47 | 48 | public void setHead(String head) { 49 | this.head = head; 50 | } 51 | 52 | public String getNickname() { 53 | return nickname; 54 | } 55 | 56 | public void setNickname(String nickname) { 57 | this.nickname = nickname; 58 | } 59 | 60 | public String getEmailAccount() { 61 | return emailAccount; 62 | } 63 | 64 | public void setEmailAccount(String emailAccount) { 65 | this.emailAccount = emailAccount; 66 | } 67 | 68 | public int getEmailServerId() { 69 | return emailServerId; 70 | } 71 | 72 | public void setEmailServerId(int emailServerId) { 73 | this.emailServerId = emailServerId; 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return "UserInfo [userName=" + userName + ", head=" + head + ", emailAccount=" + emailAccount 79 | + ", emailServerId=" + emailServerId + ", nickname=" + nickname + "]"; 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/ReplyDAO.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.Reply; 6 | 7 | /** 8 | * 回复 9 | * @author EsauLu 10 | * 11 | */ 12 | public interface ReplyDAO { 13 | 14 | /** 15 | * 保存回复 16 | * @param reply 回复 17 | */ 18 | public void saveReply(Reply reply); 19 | 20 | /** 21 | * 删除指定ID的回复 22 | * @param id 回复ID 23 | */ 24 | public void deleteReplyById(int ReplyId); 25 | 26 | 27 | /** 28 | * 查找指定帖子的所有回复 29 | * @param postId 帖子ID 30 | * @param pageCode 页码 31 | * @param size 查找数量 32 | * @return 回复列表 33 | */ 34 | public List findReplyByPost(int postId,int pageCode, int size); 35 | 36 | 37 | /** 38 | * 查找指定用户的所有回复 39 | * @param userName 用户名 40 | * @param pageCode 页码 41 | * @param size 查找数量 42 | * @return 回复列表 43 | */ 44 | public List findReplyByUser(String userName,int pageCode, int size); 45 | 46 | /** 47 | * 获取所有回复记录 48 | * @return 回复列表 49 | */ 50 | public List findAllReply(int pageCode, int size); 51 | 52 | /** 53 | * 获取某主题帖的回复数 54 | * @param postId 主题帖ID 55 | * @return 回复数量 56 | */ 57 | public long getReplyCountByPost(int postId); 58 | 59 | /** 60 | * 获取某主题帖的回复数 61 | * @param userName 用户名 62 | * @return 回复数量 63 | */ 64 | public long getReplyCountByUser(String userName); 65 | 66 | /** 67 | * 获取所有回复数量 68 | * @return 回复记录总数 69 | */ 70 | public long getAllReplyCount(); 71 | 72 | 73 | } 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /WebContent/sys/public/bottom.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | 3 | 4 | 5 | 6 | 7 | Frame bottom 8 | 9 | 10 | 11 | 47 | 48 | 49 | 50 | 51 |
52 | 53 | 56 | 57 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/UserInfoBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import campusbbs.model.vo.MailServer; 7 | import campusbbs.model.vo.Post; 8 | import campusbbs.model.vo.Reply; 9 | import campusbbs.model.vo.UserInfo; 10 | 11 | public class UserInfoBean { 12 | 13 | private UserInfo userInfo; 14 | private List mailServerList; 15 | private LastPostBean lastPostBean;//用户最新发表的主题帖 16 | private ListBean replyListBean;//用户发表的回复 17 | private Map postMap;//回复所在主题帖的标题 18 | 19 | public UserInfoBean() { 20 | super(); 21 | // TODO Auto-generated constructor stub 22 | } 23 | 24 | public UserInfo getUserInfo() { 25 | return userInfo; 26 | } 27 | 28 | public void setUserInfo(UserInfo userInfo) { 29 | this.userInfo = userInfo; 30 | } 31 | 32 | public List getMailServerList() { 33 | return mailServerList; 34 | } 35 | 36 | public void setMailServerList(List mailServerList) { 37 | this.mailServerList = mailServerList; 38 | } 39 | 40 | public LastPostBean getLastPostBean() { 41 | return lastPostBean; 42 | } 43 | 44 | public void setLastPostBean(LastPostBean lastPostBean) { 45 | this.lastPostBean = lastPostBean; 46 | } 47 | 48 | public ListBean getReplyListBean() { 49 | return replyListBean; 50 | } 51 | 52 | public void setReplyListBean(ListBean replyListBean) { 53 | this.replyListBean = replyListBean; 54 | } 55 | 56 | public Map getPostMap() { 57 | return postMap; 58 | } 59 | 60 | public void setPostMap(Map postMap) { 61 | this.postMap = postMap; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return "UserInfoBean [userInfo=" + userInfo + ", mailServerList=" + mailServerList + ", lastPostBean=" 67 | + lastPostBean + "]"; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/UserService.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service; 2 | 3 | import campusbbs.model.vo.Club; 4 | import campusbbs.model.vo.Post; 5 | import campusbbs.model.vo.Reply; 6 | import campusbbs.model.vo.User; 7 | import campusbbs.model.vo.UserInfo; 8 | 9 | public interface UserService { 10 | 11 | /** 12 | * 用户登录 13 | * @param user 用户 14 | * @return 登录成功返回User对象,否则返回null 15 | */ 16 | public User login(User user); 17 | 18 | /** 19 | * 判断是否版主 20 | * @param user 用户 21 | * @param clubName 版块名 22 | * @return true表示是版主,否则不是 23 | */ 24 | public boolean isClubAdmin(User user,String clubName); 25 | 26 | /** 27 | * 用户注册 28 | * @param user 29 | * @return 30 | */ 31 | public boolean register(User user); 32 | 33 | /** 34 | * 更新用户信息 35 | * @param info 36 | */ 37 | public boolean updateUserInfo(UserInfo info); 38 | 39 | /** 40 | * 修改登录密码 41 | * @param user 用户 42 | * @param oldPwd 旧密码 43 | * @param newPwd 新密码 44 | * @param pwdAgain 确认密码 45 | * @return 修改是否成功 46 | */ 47 | public boolean updatePasswd(User user,String oldPwd,String newPwd,String pwdAgain); 48 | 49 | /** 50 | * 获取出错信息 51 | * @return 出错信息 52 | */ 53 | public String getErrorMessage(); 54 | 55 | /** 56 | * 保存新发表的主题帖 57 | * @param post 主题帖 58 | */ 59 | public void savePost(Post post); 60 | 61 | /** 62 | * 删除主题帖 63 | * @param postId 主题帖ID 64 | */ 65 | public void deletePost(int postId); 66 | 67 | /** 68 | * 保存回复 69 | * @param reply 回复 70 | */ 71 | public void savaReply(Reply reply); 72 | 73 | /** 74 | * 删除回复 75 | * @param id 回复id 76 | */ 77 | public void deleteReply(int id); 78 | 79 | /** 80 | * 更新版块 81 | * @param club 版块 82 | */ 83 | public void updateClub(String clubName,Club club); 84 | 85 | /** 86 | * 获得用户信息 87 | * @param userName 用户名 88 | * @return 用户信息 89 | */ 90 | public UserInfo getUserInfo(String userName); 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/campusbbs/controller/servlet/CheckServlet.java: -------------------------------------------------------------------------------- 1 | package campusbbs.controller.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.imageio.ImageIO; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import javax.servlet.http.HttpSession; 12 | 13 | import campusbbs.model.factory.BeanFactory; 14 | import campusbbs.model.service.CheckService; 15 | 16 | /** 17 | * Servlet implementation class CheckServlet 18 | */ 19 | @WebServlet("/CheckServlet") 20 | public class CheckServlet extends HttpServlet { 21 | private static final long serialVersionUID = 1L; 22 | 23 | private CheckService checkService=BeanFactory.getServiceInstance("checkService", CheckService.class); 24 | 25 | /** 26 | * @see HttpServlet#HttpServlet() 27 | */ 28 | public CheckServlet() { 29 | super(); 30 | // TODO Auto-generated constructor stub 31 | } 32 | 33 | /** 34 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 35 | */ 36 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 37 | // TODO Auto-generated method stub 38 | String checkString=checkService.getCheckString(4); 39 | HttpSession session=request.getSession(); 40 | session.setAttribute("check", checkString); 41 | ImageIO.write(checkService.getCheckImage(checkString, 100, 40), "jpeg", response.getOutputStream()); 42 | } 43 | 44 | /** 45 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 46 | */ 47 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 48 | // TODO Auto-generated method stub 49 | doGet(request, response); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/campusbbs/model/bean/ClubBean.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.bean; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import campusbbs.model.vo.Club; 7 | import campusbbs.model.vo.ClubAdmin; 8 | import campusbbs.model.vo.PostType; 9 | 10 | public class ClubBean extends ListBean { 11 | 12 | private Club club; 13 | private List clubAdminList; 14 | private List postTypeIdList; 15 | private Map postTypeMap; 16 | 17 | public ClubBean() { 18 | super(); 19 | // TODO Auto-generated constructor stub 20 | } 21 | 22 | public Club getClub() { 23 | return club; 24 | } 25 | 26 | public void setClub(Club club) { 27 | this.club = club; 28 | } 29 | 30 | public List getClubAdminList() { 31 | return clubAdminList; 32 | } 33 | 34 | public void setClubAdminList(List clubAdminList) { 35 | this.clubAdminList = clubAdminList; 36 | } 37 | 38 | public List getPostTypeIdList() { 39 | return postTypeIdList; 40 | } 41 | 42 | public void setPostTypeIdList(List postTypeIdList) { 43 | this.postTypeIdList = postTypeIdList; 44 | } 45 | 46 | public Map getPostTypeMap() { 47 | return postTypeMap; 48 | } 49 | 50 | public void setPostTypeMap(Map postTypeMap) { 51 | this.postTypeMap = postTypeMap; 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return "ClubBean [club=" + club + ", clubAdminList=" + clubAdminList + ", postTypeIdList=" + postTypeIdList 57 | + ", postTypeMap=" + postTypeMap + "]"; 58 | } 59 | 60 | } 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/PageService.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service; 2 | 3 | import campusbbs.model.bean.ClubBean; 4 | import campusbbs.model.bean.ClubEditBean; 5 | import campusbbs.model.bean.ClubListBean; 6 | import campusbbs.model.bean.HomeBean; 7 | import campusbbs.model.bean.LastPostBean; 8 | import campusbbs.model.bean.PostBean; 9 | import campusbbs.model.bean.RegistBean; 10 | import campusbbs.model.bean.UserInfoBean; 11 | import campusbbs.model.vo.Post; 12 | import campusbbs.model.vo.Reply; 13 | 14 | public interface PageService { 15 | 16 | 17 | /** 18 | * 获取最新帖子页面的数据 19 | * @param pageCode 开始下标 20 | * @param size 数量 21 | * @return PageBean对象 22 | */ 23 | public LastPostBean getLastPostBean(int pageCode,int size); 24 | 25 | /** 26 | * 获取版块页面的数据 27 | * @param pageCode 页码 28 | * @param size 数量 29 | * @return ClubBean对象 30 | */ 31 | public ClubBean getClubPageBean(String clubName,int pageCode,int size); 32 | 33 | /** 34 | * 获取主题帖页面的数据 35 | * @param postId 主题帖ID 36 | * @param pageCode 页码 37 | * @param size 数量 38 | * @return PostBean对象 39 | */ 40 | public PostBean getPostPageBean(int postId,int pageCode,int size); 41 | 42 | /** 43 | * 获取首页的数据 44 | * @return HomeBean对象 45 | */ 46 | public HomeBean getHomePageBean(); 47 | 48 | /** 49 | * 获取版块选择的页面数据 50 | * @return ClubListBean对象 51 | */ 52 | public ClubListBean getClubListPageBean(); 53 | 54 | /** 55 | * 版块编辑页面数据 56 | * @param clubName 版块名 57 | * @return ClubEditPage对象 58 | */ 59 | public ClubEditBean getClubEditBean(String clubName); 60 | 61 | /** 62 | * 用户信息修改的页面数据 63 | * @param userName 用户名 64 | * @return UserInfoBean对象 65 | */ 66 | public UserInfoBean getUserInfoBean(String userName,int postPageCode, int postPageNum ,int replyPageCode,int replyPageNum); 67 | 68 | /** 69 | * 获得所有支持的邮件服务器列表 70 | * @return 邮件服务器列表 71 | */ 72 | public RegistBean getRegistBean(); 73 | 74 | } 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/UserDAO.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.SystemAdmin; 6 | import campusbbs.model.vo.User; 7 | import campusbbs.model.vo.UserInfo; 8 | 9 | /** 10 | * 用户 11 | * @author EsauLu 12 | * 13 | */ 14 | public interface UserDAO { 15 | 16 | /** 17 | * 添加用户 18 | * @param user 用户 19 | */ 20 | public boolean saveUser(User user); 21 | 22 | /** 23 | * 删除用户 24 | * @param userName 用户名 25 | */ 26 | public boolean deleteUser(String userName); 27 | 28 | /** 29 | * 更新用户 30 | * @param userName 用户名 31 | * @param passwd 用户 32 | */ 33 | public boolean updatePasswd(String userName,String passwd); 34 | 35 | /** 36 | * 更新用户信息 37 | * @param userName 用户名 38 | * @param info 用户信息 39 | */ 40 | public boolean updateUserInfo(UserInfo info); 41 | 42 | /** 43 | * 根据用户名查找用户 44 | * @param userName 用户名 45 | * @return 返回查找到的用户 46 | */ 47 | public User findUserByName(String userName); 48 | 49 | /** 50 | * 根据用户名查找用户信息 51 | * @param userName 用户名 52 | * @return 用户信息 53 | */ 54 | public UserInfo findUserInfoByName(String userName); 55 | 56 | /** 57 | * 根据范围在用户表中查找用户 58 | * @param index 页数 59 | * @param size 查找数量 60 | * @return 用户列表 61 | */ 62 | public List findUserList(int pageCode, int size); 63 | 64 | /** 65 | * 根据范围在用户表中查找用户 66 | * @param index 页数 67 | * @param size 查找数量 68 | * @return 用户列表 69 | */ 70 | public List findUserInfoList(int pageCode, int size); 71 | 72 | /** 73 | * 返回用户数量 74 | * @return 用户总数 75 | */ 76 | public long getUserCount(); 77 | 78 | /** 79 | * 查找系统管理员 80 | * @param adminName 管理员名 81 | * @return 系统管理员账号对象 82 | */ 83 | public SystemAdmin findSystemAdmin(String adminName); 84 | 85 | } 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/ClubDAO.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.Club; 6 | import campusbbs.model.vo.ClubType; 7 | 8 | /** 9 | * 版块 10 | * @author EsauLu 11 | * 12 | */ 13 | public interface ClubDAO { 14 | 15 | /** 16 | * 添加版块 17 | * @param club 版块 18 | */ 19 | public void saveClub(Club club); 20 | 21 | /** 22 | * 删除版块 23 | * @param clubName 版块名 24 | */ 25 | public void deleteClub(String clubName); 26 | 27 | /** 28 | * 更新版块 29 | * @param clubName 版块名 30 | * @param club 版块 31 | */ 32 | public void updateClub(String clubName,Club club); 33 | 34 | /** 35 | * 根据版块名查找版块 36 | * @param clubName版块名 37 | * @return 版块 38 | */ 39 | public Club findClub(String clubName); 40 | 41 | /** 42 | * 查找所有版块 43 | * @return 版块列表 44 | */ 45 | public List findAllClub(); 46 | 47 | /** 48 | * 查找回复数最多的num个版块 49 | * @param num 版块数量 50 | * @return 版块列表 51 | */ 52 | public List findPreClub(int num); 53 | 54 | /** 55 | * 获取版块数量 56 | * @return 版块总数 57 | */ 58 | public long getClubCount(); 59 | 60 | /** 61 | * 获取版块分类的数量 62 | * @return 分类数量 63 | */ 64 | public long getClubTypeCount(); 65 | 66 | /** 67 | * 获取版块类型 68 | * @return 69 | */ 70 | public ClubType getClubTypeById(int typeId); 71 | 72 | /** 73 | * 添加版块类型 74 | * @param clubType 要添加的版块类型 75 | */ 76 | public void addClubType(ClubType clubType); 77 | 78 | /** 79 | * 删除版块类型 80 | * @param clubType 要删除的版块类型 81 | */ 82 | public void deleteClubType(ClubType clubType); 83 | 84 | /** 85 | * 更新版块类型 86 | * @param clubType 要更新的版块类型 87 | */ 88 | public void updateCLubType(ClubType clubType); 89 | 90 | /** 91 | * 获得版块分类 92 | * @return 分类列表 93 | */ 94 | public List getClubTypeList(); 95 | 96 | } 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /WebContent/sys/clubTypeEdit.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 33 | 34 | 35 | 36 | 37 |
38 | 39 |
40 | 版块类型编辑: 41 |
42 | 43 |
44 |
45 | 46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 60 | 61 |
原类型名: ${ clubType.clubType }
更改名称: 56 | 57 | 58 | 59 |
62 | 63 |
64 | 65 |
66 |
67 |
68 | 69 | 74 | 75 | 76 | 77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/Club.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | import java.math.BigDecimal; 4 | 5 | /** 6 | * 版块 7 | * @author EsauLu 8 | * 9 | */ 10 | public class Club { 11 | 12 | /** 13 | * 版块名 14 | */ 15 | private String clubName; 16 | 17 | /** 18 | * 版块图标 19 | */ 20 | private String clubIcon; 21 | 22 | /** 23 | * 版块描述 24 | */ 25 | private String clubDescribe; 26 | 27 | /** 28 | * 该版块的主题帖数量 29 | */ 30 | private long postNum; 31 | 32 | /** 33 | * 该版块的总回复数量 34 | */ 35 | private BigDecimal replyNum; 36 | 37 | /** 38 | * 版块分类 39 | */ 40 | private int clubTypeId; 41 | 42 | public Club() { 43 | super(); 44 | // TODO Auto-generated constructor stub 45 | replyNum=new BigDecimal(0); 46 | } 47 | 48 | public String getClubName() { 49 | return clubName; 50 | } 51 | 52 | public void setClubName(String clubName) { 53 | this.clubName = clubName; 54 | } 55 | 56 | public String getClubIcon() { 57 | return clubIcon; 58 | } 59 | 60 | public void setClubIcon(String clubIcon) { 61 | this.clubIcon = clubIcon; 62 | } 63 | 64 | public String getClubDescribe() { 65 | return clubDescribe; 66 | } 67 | 68 | public void setClubDescribe(String clubDescribe) { 69 | this.clubDescribe = clubDescribe; 70 | } 71 | 72 | public long getPostNum() { 73 | return postNum; 74 | } 75 | 76 | public void setPostNum(long postNum) { 77 | this.postNum = postNum; 78 | } 79 | 80 | public BigDecimal getReplyNum() { 81 | if(replyNum==null){ 82 | return new BigDecimal(0); 83 | } 84 | return replyNum; 85 | } 86 | 87 | public void setReplyNum(BigDecimal replyNum) { 88 | if(replyNum==null){ 89 | return; 90 | } 91 | this.replyNum = replyNum; 92 | } 93 | 94 | public int getClubTypeId() { 95 | return clubTypeId; 96 | } 97 | 98 | public void setClubTypeId(int clubTypeId) { 99 | this.clubTypeId = clubTypeId; 100 | } 101 | 102 | @Override 103 | public String toString() { 104 | return "Club [clubName=" + clubName + ", clubIcon=" + clubIcon + ", clubDescribe=" + clubDescribe + ", postNum=" 105 | + postNum + ", replyNum=" + replyNum + ", clubTypeId=" + clubTypeId + "]"; 106 | } 107 | 108 | 109 | } 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [330套不带论文全目录地址:https://www.blog996.com/md/2021-09-22-1632317852192.html](https://www.blog996.com/md/2021-09-22-1632317852192.html)
2 | [3000套带论文全目录地址:https://www.blog996.com/md/2024-03-16-1710579554528.html](https://www.blog996.com/md/2024-03-16-1710579554528.html) 3 | 4 | # 5.SchoolForumSystem 5 | 6 |

群: 123300273(入群获取sql文件)

7 |

QQ: 1095737364(加好友获取sql文件)

8 | 9 |

5.学校论坛系统

10 | 11 |

12 | 13 | 14 | 15 | 16 |

17 | 18 | ## 简介 19 | 20 | > 本代码来源于网络,仅供学习参考使用, 请入群(123300273)后联系群主索要sql文件! 21 | > 22 | > 提供1.远程部署/2.修改代码/3.设计文档指导/4.框架代码讲解等服务 23 | > 24 | > 前端登录地址:http://localhost:8080/ContentServlet?op=login 25 | > 26 | > 用户名: user 密码: 123456 27 | > 28 | > 后台登录地址: http://localhost:8080/sys/sysAdmin.jsp 29 | > 30 | > 用户名: admin 密码: 123456 31 | > 32 | 33 | 34 | ## 环境 35 | 36 | - IntelliJ IDEA 2009.3 37 | 38 | - Mysql 5.7.26 39 | 40 | - Tomcat 7.0.73 41 | 42 | - JDK 1.8 43 | 44 | 45 | ## 缩略图 46 | 47 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170306886-573626869.png) 48 | 49 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170320389-483190518.png) 50 | 51 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170328874-1622738624.png) 52 | 53 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170338622-1332297223.png) 54 | 55 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170351806-1022321439.png) 56 | 57 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170404464-1886373247.png) 58 | 59 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170413793-1870413443.png) 60 | 61 | ![](https://img2020.cnblogs.com/blog/588112/202011/588112-20201122170424949-590474697.png) 62 | 63 | 64 | ## License 65 | 66 | ##### [个人站点: 全栈九九六(Java全栈知识资料下载)](https://www.blog996.com/) 67 | ##### [个人博客: 博客园精品博客](https://www.cnblogs.com/yysbolg/) 68 | # [更多论文: 全目录查看](https://www.blog996.com/md/2021-09-22-1632317852192.html) 69 | 70 | -------------------------------------------------------------------------------- /WebContent/sys/postTypeEdit.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 33 | 34 | 35 | 36 | 37 |
38 | 39 |
40 | 41 | 42 | 43 | 44 | 45 | 52 | 53 | 54 | 57 | 60 | 61 | 62 | 65 | 68 | 69 | 70 | 71 | 74 | 75 |
46 |
47 | <返回 48 |  |  49 | 添加分类 50 |
51 |
55 | 类型名: 56 | 58 | 59 |
63 | 标题颜色: 64 | 66 | 67 |
72 | 73 |
76 | 77 |
78 |
79 | 80 |
81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/Reply.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * 回复 7 | * @author EsauLu 8 | * 9 | */ 10 | public class Reply { 11 | 12 | /** 13 | * 回复ID 14 | */ 15 | private int replyId; 16 | 17 | /** 18 | * 回复内容 19 | */ 20 | private String replyContent; 21 | 22 | /** 23 | * 回复时间 24 | */ 25 | private Timestamp replyTime; 26 | 27 | /** 28 | * 帖子ID 29 | */ 30 | private int postId; 31 | 32 | /** 33 | * 回复用户 34 | */ 35 | private String userName; 36 | 37 | /** 38 | * 用户头像 39 | */ 40 | private String userHead; 41 | 42 | /** 43 | * 用户头像 44 | */ 45 | private String userNickname; 46 | 47 | public Reply() { 48 | super(); 49 | // TODO Auto-generated constructor stub 50 | } 51 | 52 | public int getReplyId() { 53 | return replyId; 54 | } 55 | 56 | public void setReplyId(int replyId) { 57 | this.replyId = replyId; 58 | } 59 | 60 | public String getReplyContent() { 61 | return replyContent; 62 | } 63 | 64 | public void setReplyContent(String replyContent) { 65 | this.replyContent = replyContent; 66 | } 67 | 68 | public Timestamp getReplyTime() { 69 | return replyTime; 70 | } 71 | 72 | public void setReplyTime(Timestamp replyTime) { 73 | this.replyTime = replyTime; 74 | } 75 | 76 | public int getPostId() { 77 | return postId; 78 | } 79 | 80 | public void setPostId(int postId) { 81 | this.postId = postId; 82 | } 83 | 84 | public String getUserName() { 85 | return userName; 86 | } 87 | 88 | public void setUserName(String userName) { 89 | this.userName = userName; 90 | } 91 | 92 | public String getUserHead() { 93 | return userHead; 94 | } 95 | 96 | public void setUserHead(String userHead) { 97 | this.userHead = userHead; 98 | } 99 | 100 | public String getUserNickname() { 101 | return userNickname; 102 | } 103 | 104 | public void setUserNickname(String userNickname) { 105 | this.userNickname = userNickname; 106 | } 107 | 108 | @Override 109 | public String toString() { 110 | return "Reply [replyId=" + replyId + ", replyContent=" + replyContent + ", replyTime=" + replyTime + ", postId=" 111 | + postId + ", userName=" + userName + ", userHead=" + userHead + ", userNickname=" + userNickname + "]"; 112 | } 113 | 114 | } 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/AdminPageService.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service; 2 | 3 | import campusbbs.model.bean.AdClubEditBean; 4 | import campusbbs.model.bean.AdReplyBean; 5 | import campusbbs.model.bean.AdUserBean; 6 | import campusbbs.model.bean.ClubListBean; 7 | import campusbbs.model.bean.LastPostBean; 8 | import campusbbs.model.bean.ListBean; 9 | import campusbbs.model.bean.UserInfoBean; 10 | import campusbbs.model.vo.Club; 11 | import campusbbs.model.vo.ClubAdmin; 12 | import campusbbs.model.vo.ClubType; 13 | import campusbbs.model.vo.MailServer; 14 | import campusbbs.model.vo.Post; 15 | import campusbbs.model.vo.PostType; 16 | import campusbbs.model.vo.Reply; 17 | import campusbbs.model.vo.User; 18 | import campusbbs.model.vo.UserInfo; 19 | 20 | public interface AdminPageService { 21 | 22 | 23 | //获取系统各个数据表的数据 24 | public ListBean getUserTable(int pageCode,int size); 25 | public ListBean getUserInfoTable(int pageCode,int size); 26 | public ListBean getEmailServerTable(); 27 | public ListBean getClubTable(); 28 | public ListBean getClubTypeTable(); 29 | public ListBean getClubAdminTable(int pageCode,int size); 30 | public ListBean getPostTable(int pageCode,int size); 31 | public ListBean getPostTypeTable(); 32 | public ListBean getReplyTable(int pageCode,int size); 33 | 34 | //管理员管理用户的页面数据 35 | public AdUserBean getAdUserBean(int pageCode,int size); 36 | 37 | //管理员管理版块的页面数据 38 | public ClubListBean getAdClubBean(); 39 | 40 | /** 41 | * 版块分类的编辑页面 42 | * @return 版块类型 43 | */ 44 | public ClubType getClubTypeBean(int typeId); 45 | 46 | /** 47 | * 版块分类的编辑页面 48 | * @return 版块类型 49 | */ 50 | public PostType getPostTypeBean(int typeId); 51 | 52 | /** 53 | * 获取修改版块的页面数据 54 | * @param clubName 版块名 55 | * @return 页面数据 56 | */ 57 | public AdClubEditBean getAdClubEditBean(String clubName); 58 | 59 | /** 60 | * 用户信息修改的页面数据 61 | * @param userName 用户名 62 | * @return UserInfoBean对象 63 | */ 64 | public UserInfoBean getUserInfoBean(String userName,int pageCode, int size,int replyPageCode,int replyNum); 65 | 66 | /** 67 | * 获取管理主题帖页面的数据 68 | * @param pageCode 页码 69 | * @param size 数据量 70 | * @return 页面数据 71 | */ 72 | public LastPostBean getAdPostBean(int pageCode,int size); 73 | 74 | /** 75 | * 获取管理主题回复页面的数据 76 | * @param pageCode 页码 77 | * @param size 数据量 78 | * @return 页面数据 79 | */ 80 | public AdReplyBean getAdReplyBean(int postId, int pageCode,int size); 81 | 82 | } 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/impl/AdminDAOImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.dao.AdminDAO; 6 | import campusbbs.model.utils.SQLUtils; 7 | import campusbbs.model.vo.ClubAdmin; 8 | 9 | public class AdminDAOImpl implements AdminDAO { 10 | 11 | @Override 12 | public void saveAdmin(ClubAdmin admin) { 13 | // TODO Auto-generated method stub 14 | 15 | String sql="insert into club_admin(userName,clubName) value('"+admin.getUserName()+"','"+admin.getClubName()+"');"; 16 | SQLUtils.updateRecord(sql); 17 | 18 | } 19 | 20 | @Override 21 | public boolean isClubAdmin(String userName, String clubName) { 22 | // TODO Auto-generated method stub 23 | System.out.println(userName+",,"+clubName); 24 | return findClubAdmin(userName, clubName)!=null; 25 | } 26 | 27 | 28 | @Override 29 | public void deleteAdmin(String userName, String clubName) { 30 | // TODO Auto-generated method stub 31 | 32 | String sql="delete from club_admin where userName='"+userName+"' and clubName='"+clubName+"';"; 33 | SQLUtils.updateRecord(sql); 34 | 35 | } 36 | 37 | @Override 38 | public ClubAdmin findClubAdmin(String userName, String clubName) { 39 | // TODO Auto-generated method stub 40 | 41 | String sql="select * from club_admin where userName='" 42 | + userName 43 | + "' and clubName='" 44 | + clubName 45 | + "';"; 46 | System.out.println("AdminDAO \t49\t: "+sql); 47 | 48 | return SQLUtils.queryRecordById(sql, ClubAdmin.class); 49 | } 50 | 51 | @Override 52 | public List findAdminByClub(String clubName) { 53 | // TODO Auto-generated method stub 54 | 55 | String sql="select * from club_admin where clubName='"+clubName+"';"; 56 | 57 | return SQLUtils.queryRecordList(sql, ClubAdmin.class); 58 | 59 | } 60 | 61 | @Override 62 | public List findAllClubAdmin(int pageCode,int size) { 63 | // TODO Auto-generated method stub 64 | String sql="select * from club_admin" 65 | + " order by clubName " 66 | + " limit "+((pageCode-1)*size)+","+size+";"; 67 | 68 | return SQLUtils.queryRecordList(sql, ClubAdmin.class); 69 | } 70 | 71 | @Override 72 | public long getClubAdminCount() { 73 | // TODO Auto-generated method stub 74 | 75 | String sql="select count(*) from club_admin;"; 76 | return SQLUtils.getRecordCount(sql); 77 | 78 | } 79 | 80 | 81 | } 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/impl/ServiceUtils.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import campusbbs.model.bean.LastPostBean; 9 | import campusbbs.model.bean.ListBean; 10 | import campusbbs.model.dao.PostDAO; 11 | import campusbbs.model.dao.ReplyDAO; 12 | import campusbbs.model.vo.Post; 13 | import campusbbs.model.vo.PostType; 14 | import campusbbs.model.vo.Reply; 15 | 16 | public class ServiceUtils { 17 | 18 | public static LastPostBean getLastPostBean(List list,ReplyDAO replyDAO,PostDAO postDAO,long recordTatel, int pageCode, int size) { 19 | // TODO Auto-generated method stub 20 | // long recordTatel=postDAO.getAllPostNum(); //数据总数 21 | // List list=postDAO.findLastPost(pageCode, size); //最新的主题帖 22 | 23 | for(Post post:list){ 24 | long replyNum=replyDAO.getReplyCountByPost(post.getPostId());//数据总数 25 | Post post2=postDAO.findPostById(post.getPostId()); 26 | post.setPostContent(post2.getPostContent()); 27 | post.setReplyNum(replyNum); 28 | } 29 | 30 | List postTypeList=postDAO.getPostTypeList(); //帖子分类列表 31 | Map postTypeMap=new HashMap(); //分好类的帖子存放的Map对象 32 | List postTypeIdList=new ArrayList(); //帖子类型的ID表 33 | getPostType(postTypeList, postTypeMap, postTypeIdList); 34 | 35 | LastPostBean lastPostBean=new LastPostBean(); 36 | lastPostBean.setPageCode(pageCode); 37 | lastPostBean.setRecordNum(size); 38 | lastPostBean.setRecordTotel(recordTatel); 39 | lastPostBean.setBeanList(list); 40 | lastPostBean.setPostTypeIdList(postTypeIdList); 41 | lastPostBean.setPostTypeMap(postTypeMap); 42 | 43 | System.out.println(lastPostBean.toString()); 44 | 45 | return lastPostBean; 46 | } 47 | 48 | public static ListBean getReplyListBeanByUser(String userName,ReplyDAO replyDAO,int replyPageCode,int replyPageNum) { 49 | // TODO Auto-generated method stub 50 | //用户回复 51 | ListBean replyListBean=new ListBean<>(); 52 | 53 | //回复总数 54 | long replyTatel=replyDAO.getReplyCountByUser(userName); 55 | replyListBean.setRecordTotel(replyTatel); 56 | 57 | //回复列表 58 | List list=replyDAO.findReplyByUser(userName, replyPageCode, replyPageNum); 59 | replyListBean.setBeanList(list); 60 | 61 | //分页数据 62 | replyListBean.setPageCode(replyPageCode); 63 | replyListBean.setRecordNum(replyPageNum); 64 | return replyListBean; 65 | } 66 | 67 | //将得到的帖子列表按照帖子类型分类放入到Map容器中 68 | public static void getPostType(List postTypeList,Map postTypeMap,List postTypeIdList){ 69 | for(PostType pt:postTypeList){ 70 | postTypeIdList.add(pt.getPostTypeId()); 71 | postTypeMap.put("k"+String.valueOf(pt.getPostTypeId()), pt); 72 | } 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /WebContent/content/public.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html; charset=utf-8" language="java" 2 | import="java.sql.*" errorPage=""%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 37 | 38 | 49 | 50 |
51 | 52 | 53 |
54 | 55 |
56 | 57 | 论坛 58 | 59 |
60 |
61 | > 62 | 63 | 公告 64 | 65 |
66 |
67 | 68 |
69 |
70 |

71 | 【动态】 72 | 关于网站开发进度的说明 73 |

74 |
75 |
76 |

77 | 目前本网站仅仅实现发帖回帖等基本功能,还有其他较多的常用功能,例如在帖子中嵌入图片、表情图等,均没有实现, 78 | 由于时间的限制,加上最近四六级临近,估计开发人员在未来几个星期都没有多少时间投入到开发当中,因此当前本网站所 79 | 实现的所有功能,可能就是课程设计的最终成果,如若四六级过后还有足够的时间,我们将继续维护更新下去,若当前有 80 | 限的功能让你感到不便,敬请原谅。

81 |
82 |
83 |
84 | 2016/12/05 85 |
86 |
87 | 88 |
89 |
90 |
91 | 92 |
93 | 94 | 95 | 96 | 97 |
98 |
99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /WebContent/sys/public/dataTableTop.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 93 | 94 | 95 | 96 |
11 | 数据表: 12 |
18 | 25 | 26 | 33 | 34 | 41 | 42 | 49 | 50 | 57 | 58 | 65 | 66 | 73 | 74 | 81 | 82 | 89 | 90 |
91 |
92 |
97 | 98 |
99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /WebContent/sys/style/css/index_1.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* CSS Document */ 3 | body { 4 | padding: 0; 5 | margin: 0; 6 | } 7 | body,html{ 8 | height: 100%; 9 | } 10 | #log_index{ 11 | width:1024px; 12 | height: 100%; 13 | margin:0 auto; 14 | } 15 | .log_top{ 16 | width:1024px; 17 | height:90px; 18 | background:url(img/flower.gif) no-repeat; 19 | } 20 | #log_middle{ 21 | width:1024px; 22 | background:url(img/middle_bg.gif); 23 | height:442px; 24 | padding-top:140px; 25 | overflow:hidden; 26 | } 27 | #log_midcenter{ 28 | width:1024px; 29 | height:300px; 30 | } 31 | .middle_1{ 32 | float:left; 33 | width:90px; 34 | height:584px; 35 | padding-top:40px; 36 | 37 | } 38 | 39 | .middle_2{ 40 | width:510px; 41 | float:left; 42 | height:292px; 43 | padding-left:167px; 44 | } 45 | .middle_5{ 46 | width:90px; 47 | height:584px; 48 | float:left; 49 | } 50 | 51 | #middle_3{ 52 | width:90px; 53 | height:584px; 54 | float:right; 55 | padding-top:40px; 56 | } 57 | #food_table{ 58 | padding-left:167px; 59 | } 60 | #food_table ul{ 61 | width:510px; 62 | margin:0 auto; 63 | background:#F00; 64 | 65 | } 66 | #food_table ul li{ 67 | list-style:none; 68 | float:left; 69 | margin-right:5px; 70 | } 71 | #food_table a{ 72 | display:block; 73 | width:90px; 74 | height:60px; 75 | background:url(img/table.gif) no-repeat; 76 | padding-left:35px; 77 | font-size:36px; 78 | text-decoration:none; 79 | color:#83230a; 80 | } 81 | 82 | 83 | /**/ 84 | .bg_1{ 85 | width:1024px; 86 | height:90px; 87 | background:url(img/flower.gif) no-repeat; 88 | } 89 | #space{ 90 | width:1024px; 91 | height:150px; 92 | 93 | } 94 | .bg_left{ 95 | width:113px; 96 | height:300px; 97 | background:url(img/middle_left.gif) no-repeat left center; 98 | float:left; 99 | } 100 | .bg_middle{ 101 | width:813px; 102 | height:300px; 103 | text-align:center; 104 | float:left 105 | } 106 | .index_all{ 107 | width:1024px; 108 | margin:0 auto; 109 | } 110 | #index_center{ 111 | width:1024px; 112 | background:url(img/middle_bg.gif); 113 | } 114 | #index_centerleft{ 115 | width:113px; 116 | height:300px; 117 | background:url(img/middle_left.gif) no-repeat left center; 118 | float:left; 119 | } 120 | 121 | #index_centerright{ 122 | width:98px; 123 | height:300px; 124 | background:url(img/middle_left2.gif) no-repeat right center; 125 | float:left 126 | } 127 | #center_bottom{ 128 | width:1000px; 129 | height:100px; 130 | clear:both; 131 | display:table-cell; 132 | text-align:center; 133 | padding-top:10px; 134 | } 135 | #center_bottom ul{ 136 | list-style:none; 137 | text-align:center; 138 | } 139 | #center_bottom ul li{ 140 | float: left; 141 | background:url(img/table.gif); 142 | width: 88px; 143 | height:60px; 144 | margin-left:10px; 145 | text-align:center; 146 | font-weight:bold; 147 | } 148 | #center_bottom a{ 149 | text-decoration:none; 150 | color:#83230a; 151 | text-align:center; 152 | font-weight:bold; 153 | font-size:30px; 154 | } 155 | 156 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/impl/CheckServiceImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service.impl; 2 | 3 | import java.awt.Color; 4 | import java.awt.Font; 5 | import java.awt.Graphics2D; 6 | import java.awt.geom.Rectangle2D; 7 | import java.awt.image.BufferedImage; 8 | import java.util.Random; 9 | import java.awt.FontMetrics; 10 | 11 | import campusbbs.model.service.CheckService; 12 | 13 | public class CheckServiceImpl implements CheckService{ 14 | 15 | public BufferedImage getCheckImage(String check,int width,int height){ 16 | 17 | BufferedImage checkImg=new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); 18 | Graphics2D g2d=(Graphics2D)checkImg.getGraphics(); 19 | int len=check.length(); 20 | int step=width/len; 21 | Random ran=new Random(); 22 | g2d.setColor(Color.white); 23 | g2d.fillRect(0, 0, width+20, height); 24 | 25 | g2d.setFont(new Font("黑体", Font.PLAIN, 24)); 26 | FontMetrics fm=g2d.getFontMetrics(); 27 | Rectangle2D r2d=fm.getStringBounds("0", g2d); 28 | int fw=(int)r2d.getWidth(); 29 | int fh=(int)r2d.getHeight(); 30 | 31 | //绘制验证码 32 | for(int i=0;i255) r%=255; 86 | if(g>255) g%=255; 87 | if(b>255) b%=255; 88 | return new Color(r, g, b); 89 | } 90 | 91 | } 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/PostDAO.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.vo.Post; 6 | import campusbbs.model.vo.PostType; 7 | 8 | /** 9 | * 帖子 10 | * @author EsauLu 11 | * 12 | */ 13 | public interface PostDAO { 14 | 15 | /** 16 | * 保存帖子 17 | * @param post 帖子 18 | */ 19 | public void savaPost(Post post); 20 | 21 | /** 22 | * 添加主题帖类型 23 | * @param type 类型实体 24 | */ 25 | public void addPostType(PostType type); 26 | 27 | /** 28 | * 根据帖子ID删除帖子 29 | * @param postId 帖子 30 | */ 31 | public void deletePostById(int id); 32 | 33 | /** 34 | * 根据帖子ID删除帖子 35 | * @param postId 帖子 36 | */ 37 | public void deletePostType(int id); 38 | 39 | /** 40 | * 查找指定ID的帖子 41 | * @param id 帖子ID 42 | * @return 帖子 43 | */ 44 | public Post findPostById(int id); 45 | 46 | /** 47 | * 查找指定ID的帖子 48 | * @param id 帖子ID 49 | * @return 帖子 50 | */ 51 | public PostType findPostTypeById(int id); 52 | 53 | /** 54 | * 修改主题帖额类型 55 | * @param postType 类型对象 56 | */ 57 | public void updatePostType(PostType postType); 58 | 59 | // /** 60 | // * 获取指定主题帖的内容 61 | // * @param postId 主题帖ID 62 | // * @return 主题帖的内容 63 | // */ 64 | // public String getPostContent(int postId); 65 | 66 | /** 67 | * 返回主题帖总数 68 | * @return 主题帖总数 69 | */ 70 | public long getAllPostNum(); 71 | 72 | /** 73 | * 返回某版块的主题帖总数 74 | * @return 主题帖总数 75 | */ 76 | public long getPostNumByCLub(String clubName); 77 | 78 | /** 79 | * 返回某用户的主题帖总数 80 | * @return 主题帖总数 81 | */ 82 | public long getPostNumByUser(String userName); 83 | 84 | /** 85 | * 获取主题类型数 86 | * @return 类型总数 87 | */ 88 | public long getPostTypeCount(); 89 | 90 | /** 91 | * 查找最新的主题帖 92 | * @param pageCode 页码 93 | * @param size 页面数据大小 94 | * @return 主题帖列表 95 | */ 96 | public List findLastPost(int pageCode,int size); 97 | 98 | // /** 99 | // * 查找所有的主题帖 100 | // * @param pageCode 页码 101 | // * @param size 页面数据大小 102 | // * @return 主题帖列表 103 | // */ 104 | // public List findAllPost(int pageCode,int size); 105 | 106 | /** 107 | * 查找最热门的主题帖 108 | * @param pageCode 页码 109 | * @param size 页面数据大小 110 | * @return 主题帖列表 111 | */ 112 | public List findHostPost(int pageCode,int size); 113 | 114 | /** 115 | * 查找指定版块的帖子 116 | * @param clubName 版块名 117 | * @param pageCode 页码 118 | * @param size 查找数量 119 | * @return 帖子列表 120 | */ 121 | public List findPostByClub(String clubName,int pageCode, int size); 122 | 123 | /** 124 | * 查找指定用户的主题帖 125 | * @param userName 用户名 126 | * @param pageCode 页码 127 | * @param size 查找数量 128 | * @return 帖子列表 129 | */ 130 | public List findPostByUser(String userName,int pageCode, int size); 131 | 132 | /** 133 | * 获取主题帖的分类 134 | * @return 分类列表 135 | */ 136 | public List getPostTypeList(); 137 | 138 | } 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /WebContent/sys/style/js/page_common.js: -------------------------------------------------------------------------------- 1 | // JavaScript Document 2 | 3 | 4 | /** 5 | * 当在页码输入框中按了回车后,就会提交分页表单 6 | */ 7 | function submitPaginationFormByInput( event, pageNum ){ 8 | if( event.keyCode == 13 ){ 9 | gotoPage(pageNum); 10 | return false; 11 | } 12 | } 13 | 14 | 15 | /** 16 | * 页面中需要有一个提交分页要求的表单元素,如果有多个form,则需要指定id为paginationForm。 17 | * 传递的参数中有一个表示要查看的页码的,名称为"pageNum"。 18 | * 19 | * 需要由具体的页面定义 pageCount 变量,用于指定总页码有多少!!! 20 | * 21 | * @param pageNum 要跳转到的页码 22 | * @param pageCountParam 总页码 23 | */ 24 | function gotoPage( pageNum ){ 25 | if( typeof(pageCount) == "undefined" ){ 26 | alert("请指定总页码数(定义变量pageCount)!"); 27 | return; 28 | } 29 | 30 | // 找出输入页面的文本框 31 | var pageNumInput = document.getElementById("PageSelector_PageNumInput"); 32 | 33 | // 默认找id为paginationForm的
元素,一个页面中有多且这个表单不是第1个时使用。 34 | // 如果找不到指定id的,就使用页面中的第1个,当页面中只有一个或分页表单是第1个时这样使用,用起来方便。 35 | var paginationForm = document.getElementById("paginationForm"); 36 | if( paginationForm == null ){ 37 | paginationForm = document.forms[0]; 38 | } 39 | if( paginationForm == null ){ 40 | alert("找不到分页用的表单!"); 41 | return; 42 | } 43 | 44 | // 解决小数点的问题(去掉小数点后的数字) 45 | pageNum = parseInt(pageNum); 46 | 47 | // 如果不是数字,就提示错误 48 | if( pageNum == "" || isNaN(pageNum) ){ 49 | alert("请填写正确的页码数字!范围是 1-" + pageCount); 50 | if( pageNumInput != null ){ 51 | pageNumInput.focus(); 52 | pageNumInput.select(); 53 | } 54 | return; 55 | } 56 | 57 | // 如果数字超出页码范围,就提示错误 58 | if( pageNum < 1 || pageNum > pageCount ){ 59 | alert("请填写正确的页码!范围是 1-" + pageCount); 60 | if( pageNumInput != null ){ 61 | pageNumInput.focus(); 62 | pageNumInput.select(); 63 | } 64 | return; 65 | } 66 | 67 | // 如果找不到名为"pageNum"的字段,就增加一个,用于传递页码参数。 68 | if( paginationForm.pageNum == null ){ 69 | var pageNumInput = document.createElement(""); 70 | paginationForm.appendChild(pageNumInput); 71 | } 72 | 73 | // 处理pageSize 74 | var pageSize = $("#PaginationBar_PageSizeSelector").val(); 75 | 76 | // 如果找不到名为"pageSize"的字段,就增加一个。 77 | if( paginationForm.pageSize == null ){ 78 | var pageSizeField= document.createElement(""); 79 | paginationForm.appendChild(pageSizeField); 80 | //alert("new "); 81 | }else{ 82 | $(paginationForm.pageSize).val( pageSize ); 83 | //alert("old "); 84 | } 85 | 86 | //alert(pageSize); 87 | //alert( $(paginationForm.pageSize).val() ); 88 | 89 | // 修改页码值后提交表单 90 | paginationForm.pageNum.value = pageNum; 91 | paginationForm.submit(); 92 | } 93 | 94 | 95 | /** 96 | * 删除前的确认提示 97 | */ 98 | function delConfirm(){ 99 | return window.confirm("您确定要删除一条记录码?"); 100 | } 101 | 102 | 103 | 104 | /** 105 | * (使用模式对活框)显示图片 106 | */ 107 | function showImage( url, width, height ){ 108 | var sFeatures = "resizable: yes; "; 109 | if( width != null ){ 110 | sFeatures += "dialogWidth:" + width + "px; "; 111 | } 112 | if( height != null ){ 113 | sFeatures += "dialogHeight:" + height + "px; "; 114 | } 115 | window.showModalDialog(url, null, sFeatures); 116 | } 117 | 118 | -------------------------------------------------------------------------------- /src/campusbbs/model/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.utils; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.FileNotFoundException; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.io.OutputStream; 10 | 11 | public class FileUtils { 12 | 13 | //复制文件 14 | public static boolean copyFile(String srcFileName, String destFileName, 15 | boolean overlay) { 16 | 17 | 18 | srcFileName=srcFileName.replaceAll("\\\\","/"); 19 | destFileName=destFileName.replaceAll("\\\\","/"); 20 | 21 | File srcFile = new File(srcFileName); 22 | 23 | System.out.println("复制文件:"+srcFileName+" --> "+destFileName); 24 | // 判断源文件是否存在 25 | if (!srcFile.exists()) { 26 | return false; 27 | } else if (!srcFile.isFile()) { 28 | return false; 29 | } 30 | 31 | // 判断目标文件是否存在 32 | File destFile = new File(destFileName); 33 | if (destFile.exists()) { 34 | // 如果目标文件存在并允许覆盖 35 | if (overlay) { 36 | // 删除已经存在的目标文件,无论目标文件是目录还是单个文件 37 | new File(destFileName).delete(); 38 | } 39 | } else { 40 | // 如果目标文件所在目录不存在,则创建目录 41 | if (!destFile.getParentFile().exists()) { 42 | // 目标文件所在目录不存在 43 | if (!destFile.getParentFile().mkdirs()) { 44 | // 复制文件失败:创建目标文件所在目录失败 45 | return false; 46 | } 47 | } 48 | } 49 | 50 | // 复制文件 51 | int byteread = 0; // 读取的字节数 52 | InputStream in = null; 53 | OutputStream out = null; 54 | 55 | try { 56 | in = new FileInputStream(srcFile); 57 | out = new FileOutputStream(destFile); 58 | byte[] buffer = new byte[1024]; 59 | 60 | while ((byteread = in.read(buffer)) != -1) { 61 | out.write(buffer, 0, byteread); 62 | } 63 | return true; 64 | } catch (FileNotFoundException e) { 65 | System.out.println("复制出错1"); 66 | return false; 67 | } catch (IOException e) { 68 | System.out.println("复制出错2"); 69 | return false; 70 | } finally { 71 | try { 72 | if (out != null) 73 | out.close(); 74 | if (in != null) 75 | in.close(); 76 | } catch (IOException e) { 77 | e.printStackTrace(); 78 | } 79 | System.out.println("复制完成"); 80 | } 81 | } 82 | 83 | //删除文件 84 | public static boolean deleteFile(String fileName){ 85 | File file=new File(fileName); 86 | if(file.isFile()&&file.exists()){ 87 | return file.delete(); 88 | } 89 | return false; 90 | } 91 | 92 | } 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /src/campusbbs/model/vo/Post.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.vo; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * 帖子 7 | * @author EsauLu 8 | * 9 | */ 10 | public class Post { 11 | 12 | /** 13 | * 帖子ID 14 | */ 15 | private int postId; 16 | 17 | /** 18 | * 标题 19 | */ 20 | private String postTitle; 21 | 22 | /** 23 | * 内容 24 | */ 25 | private String postContent; 26 | 27 | /** 28 | * 发帖时间 29 | */ 30 | private Timestamp postTime; 31 | 32 | /** 33 | * 最后回复时间 34 | */ 35 | private Timestamp lastTime; 36 | 37 | /** 38 | * 发帖用户 39 | */ 40 | private String userName; 41 | 42 | /** 43 | * 发帖版块 44 | */ 45 | private String clubName; 46 | 47 | /** 48 | * 帖子类型 49 | */ 50 | private int postTypeId; 51 | 52 | /** 53 | * 回复数量 54 | */ 55 | private long replyNum; 56 | 57 | /** 58 | * 用户头像 59 | */ 60 | private String userHead; 61 | 62 | /** 63 | * 用户头像 64 | */ 65 | private String userNickname; 66 | 67 | public Post() { 68 | super(); 69 | // TODO Auto-generated constructor stub 70 | } 71 | 72 | public int getPostId() { 73 | return postId; 74 | } 75 | 76 | public void setPostId(int postId) { 77 | this.postId = postId; 78 | } 79 | 80 | public String getPostTitle() { 81 | return postTitle; 82 | } 83 | 84 | public void setPostTitle(String postTitle) { 85 | this.postTitle = postTitle; 86 | } 87 | 88 | public String getPostContent() { 89 | return postContent; 90 | } 91 | 92 | public void setPostContent(String postContent) { 93 | this.postContent = postContent; 94 | } 95 | 96 | public Timestamp getPostTime() { 97 | return postTime; 98 | } 99 | 100 | public void setPostTime(Timestamp postTime) { 101 | this.postTime = postTime; 102 | } 103 | 104 | public String getUserName() { 105 | return userName; 106 | } 107 | 108 | public void setUserName(String userName) { 109 | this.userName = userName; 110 | } 111 | 112 | public String getClubName() { 113 | return clubName; 114 | } 115 | 116 | public void setClubName(String clubName) { 117 | this.clubName = clubName; 118 | } 119 | 120 | public long getReplyNum() { 121 | return replyNum; 122 | } 123 | 124 | public void setReplyNum(long replyNum) { 125 | this.replyNum = replyNum; 126 | } 127 | 128 | public Timestamp getLastTime() { 129 | return lastTime; 130 | } 131 | 132 | public void setLastTime(Timestamp lastTime) { 133 | this.lastTime = lastTime; 134 | } 135 | 136 | public int getPostTypeId() { 137 | return postTypeId; 138 | } 139 | 140 | public void setPostTypeId(int postTypeId) { 141 | this.postTypeId = postTypeId; 142 | } 143 | 144 | public String getUserHead() { 145 | return userHead; 146 | } 147 | 148 | public void setUserHead(String userHead) { 149 | this.userHead = userHead; 150 | } 151 | 152 | public String getUserNickname() { 153 | return userNickname; 154 | } 155 | 156 | public void setUserNickname(String userNickname) { 157 | this.userNickname = userNickname; 158 | } 159 | 160 | @Override 161 | public String toString() { 162 | return "Post [postId=" + postId + ", postTitle=" + postTitle + ", postContent=" + postContent + ", postTime=" 163 | + postTime + ", lastTime=" + lastTime + ", userName=" + userName + ", clubName=" + clubName 164 | + ", replyNum=" + replyNum + "]"; 165 | } 166 | 167 | } 168 | -------------------------------------------------------------------------------- /WebContent/content/clubListBody.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 11 | 12 |
13 | 14 |
15 | 16 |
17 | 18 | 论坛 19 | 20 |
21 |
22 | > 23 | 24 | 版块 25 | 26 |
27 |
28 | 29 |
30 | 31 |
32 | 33 | 34 | 35 | 36 | 37 |
38 | 39 |
40 | 41 | ${ type.clubType } 42 | 43 |
44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | 52 | 55 | 62 | 63 | 64 | 67 | 68 | 69 | 72 | 73 |
53 | 图标 54 | 56 | 57 | 58 | ${ item.clubName } 59 | 60 | 61 |
65 | 主题:${ item.postNum } 66 |
70 | 贴数:${ item.replyNum+item.postNum } 71 |
74 |
75 |
76 | 77 |
78 |
79 |
80 | 81 |
82 |
83 |
84 | 85 |

暂无内容

86 |
87 | 88 |
89 | 90 |
91 | 92 | 93 |
94 | 95 | 96 |
97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/SysAdminService.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service; 2 | 3 | import campusbbs.model.vo.Club; 4 | import campusbbs.model.vo.ClubAdmin; 5 | import campusbbs.model.vo.ClubType; 6 | import campusbbs.model.vo.PostType; 7 | import campusbbs.model.vo.SystemAdmin; 8 | import campusbbs.model.vo.User; 9 | import campusbbs.model.vo.UserInfo; 10 | 11 | public interface SysAdminService{ 12 | 13 | /** 14 | * 更新版块类型 15 | * @param clubType 要更新的版块类型 16 | * @return 更新是否成功 17 | */ 18 | public boolean updateClubType(ClubType clubType); 19 | 20 | /** 21 | * 添加版块类型 22 | * @param clubType 要添加的版块类型 23 | * @return 添加是否成功 24 | */ 25 | public boolean addClubType(ClubType clubType); 26 | 27 | /** 28 | * 删除版块类型 29 | * @param clubType 要删除的版块类型 30 | */ 31 | public void deleteClubType(ClubType clubType); 32 | 33 | 34 | /** 35 | * 更新版块 36 | * @param club 版块 37 | * @return 更新是否成功 38 | */ 39 | public boolean updateClub(String clubName,Club club); 40 | 41 | /** 42 | * 添加版块 43 | * @param club 版块 44 | * @return 添加是否成功 45 | */ 46 | public boolean addClub(Club club); 47 | 48 | /** 49 | * 删除版块 50 | * @param clubName 版块名 51 | */ 52 | public void deleteClub(String clubName); 53 | 54 | /** 55 | * 获取操作出错的信息 56 | * @return 出错信息 57 | */ 58 | public String getErrorMessage(); 59 | 60 | /** 61 | * 设置版主 62 | * @param clubAdmin 版主 63 | * @return 返回设置是否成功 64 | */ 65 | public boolean addClubAdmin(ClubAdmin clubAdmin); 66 | 67 | /** 68 | * 删除版主 69 | * @param clubAdmin 版主 70 | * @return 71 | */ 72 | public void deleteClubAdmin(ClubAdmin clubAdmin); 73 | 74 | 75 | /** 76 | * 添加用户 77 | * @param user 用户 78 | * @return 添加是否成功 79 | */ 80 | public boolean addUser(User user); 81 | 82 | /** 83 | * 更新用户 84 | * @param user 用户 85 | * @return 更新是否成功 86 | */ 87 | public boolean updateUserInfo(UserInfo info); 88 | 89 | /** 90 | * 更新用户密码 91 | * @param user 用户 92 | * @return 更新是否成功 93 | */ 94 | public boolean updateUserPasswd(String userName, String oldPwd, String newPwd, String pwdAgain); 95 | 96 | /** 97 | * 删除用户 98 | * @param userName 用具名 99 | * @return 返回删除是否成功 100 | */ 101 | public boolean deleteUser(String userName); 102 | 103 | /** 104 | * 管理员用户登录 105 | * @param adminUser 管理员用户的登录信息 106 | * @return 返回登录是否成功 107 | */ 108 | public SystemAdmin adminLogin(SystemAdmin adminUser); 109 | 110 | /** 111 | * 删除主题帖 112 | * @param postID 主题帖ID 113 | */ 114 | public void deletePost(int postID); 115 | 116 | /** 117 | * 118 | * 删除主题帖 119 | * @param typeID 类型ID 120 | */ 121 | public void deletePostType(int typeID); 122 | 123 | /** 124 | * 添加主题帖类型 125 | * @param postType 类型对象 126 | * @return 添加是否成功 127 | */ 128 | public boolean addPostType(PostType postType); 129 | 130 | /** 131 | * 修改主题帖类型 132 | * @param postType 类型对象 133 | * @return 修改是否成功 134 | */ 135 | public boolean updatePostType(PostType postType); 136 | 137 | /** 138 | * 删除回复 139 | * @param replyId 回复Id 140 | */ 141 | public void deleteReply(int replyId); 142 | 143 | } 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /campusbbs.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/campusbbs/model/utils/BeanHandler.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.utils; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.ResultSetMetaData; 5 | import java.sql.SQLException; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import java.lang.reflect.Field; 9 | 10 | public class BeanHandler { 11 | 12 | private Class classObject; 13 | 14 | public BeanHandler(Class classObject) { 15 | super(); 16 | this.classObject = classObject; 17 | } 18 | 19 | /** 20 | * 将查询结果以列表形式返回 21 | * @param rs 查询结果集 22 | * @return 查询结果列表 23 | * @throws SQLException 抛出sql异常 24 | */ 25 | public List getBeanList(ResultSet rs) throws SQLException{ 26 | 27 | ArrayList list=new ArrayList<>(); 28 | ResultSetMetaData rsmd=rs.getMetaData(); 29 | T bean=null; 30 | int colNum=rsmd.getColumnCount(); 31 | 32 | try { 33 | while(rs.next()){ 34 | bean=classObject.newInstance(); 35 | for(int i=1;i<=colNum;i++){ 36 | Object value=rs.getObject(i); 37 | String pro=rsmd.getColumnLabel(i); 38 | if(value==null){ 39 | continue; 40 | // System.out.println("-------> "+pro+"\t"+value); 41 | } 42 | // System.out.println("--> "+pro); 43 | Field field=classObject.getDeclaredField(pro); 44 | field.setAccessible(true); 45 | field.set(bean, value); 46 | field.setAccessible(false); 47 | } 48 | list.add(bean); 49 | } 50 | } catch (InstantiationException e) { 51 | // TODO Auto-generated catch block 52 | e.printStackTrace(); 53 | } catch (IllegalAccessException e) { 54 | // TODO Auto-generated catch block 55 | e.printStackTrace(); 56 | } catch (NoSuchFieldException e) { 57 | // TODO Auto-generated catch block 58 | e.printStackTrace(); 59 | } catch (SecurityException e) { 60 | // TODO Auto-generated catch block 61 | e.printStackTrace(); 62 | } catch (IllegalArgumentException e) { 63 | // TODO Auto-generated catch block 64 | e.printStackTrace(); 65 | } 66 | return list; 67 | } 68 | 69 | /** 70 | * 将查询结果的对应类对象返回 71 | * @param rs 查询结果 72 | * @return 代表查询结果的类对象 73 | * @throws SQLException 抛出sql异常 74 | */ 75 | public T findBeanById(ResultSet rs) throws SQLException{ 76 | ResultSetMetaData rsmd=rs.getMetaData(); 77 | T bean=null; 78 | int colNum=rsmd.getColumnCount(); 79 | try { 80 | if(rs!=null){ 81 | if(rs.next()){ 82 | bean=classObject.newInstance(); 83 | for(int i=1;i<=colNum;i++){ 84 | Object value=rs.getObject(i); 85 | String pro=rsmd.getColumnLabel(i); 86 | Field field=classObject.getDeclaredField(pro); 87 | field.setAccessible(true); 88 | field.set(bean, value); 89 | field.setAccessible(false); 90 | } 91 | } 92 | } 93 | } catch (InstantiationException e) { 94 | // TODO Auto-generated catch block 95 | bean=null; 96 | e.printStackTrace(); 97 | } catch (IllegalAccessException e) { 98 | // TODO Auto-generated catch block 99 | bean=null; 100 | e.printStackTrace(); 101 | } catch (NoSuchFieldException e) { 102 | // TODO Auto-generated catch block 103 | bean=null; 104 | e.printStackTrace(); 105 | } catch (SecurityException e) { 106 | // TODO Auto-generated catch block 107 | bean=null; 108 | e.printStackTrace(); 109 | } catch (IllegalArgumentException e) { 110 | // TODO Auto-generated catch block 111 | bean=null; 112 | e.printStackTrace(); 113 | } 114 | return bean; 115 | } 116 | 117 | } 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/impl/ReplyDAOImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.dao.ReplyDAO; 6 | import campusbbs.model.utils.SQLUtils; 7 | import campusbbs.model.vo.Reply; 8 | 9 | public class ReplyDAOImpl implements ReplyDAO { 10 | 11 | private static final String REPLY_TABLE="reply"; 12 | 13 | @Override 14 | public void saveReply(Reply reply) { 15 | // TODO Auto-generated method stub 16 | 17 | String sql="insert into "+REPLY_TABLE+"(replyContent,replyTime,postId,userName) values(?,?,?,?);"; 18 | Object[] param={ 19 | reply.getReplyContent(), 20 | reply.getReplyTime(), 21 | reply.getPostId(), 22 | reply.getUserName() 23 | }; 24 | SQLUtils.updateRecord(sql, param); 25 | 26 | //更新最后回复时间 27 | sql="update post set lastTime='"+reply.getReplyTime()+"' where postId="+reply.getPostId()+";"; 28 | SQLUtils.updateRecord(sql,param); 29 | 30 | } 31 | 32 | @Override 33 | public void deleteReplyById(int replyId) { 34 | // TODO Auto-generated method stub 35 | String sql="delete from reply where replyId="+replyId; 36 | SQLUtils.updateRecord(sql); 37 | } 38 | 39 | @Override 40 | public List findReplyByPost(int postId, int pageCode, int size) { 41 | // TODO Auto-generated method stub 42 | String sql="select reply.replyId,reply.replyContent,reply.replyTime,reply.postId,reply.userName,user_info.nickname userNickname,user_info.head userHead " 43 | + " from reply,user_info " 44 | + " where postId="+postId+" and reply.userName=user_info.userName " 45 | + " order by reply.replyTime " 46 | + " limit "+((pageCode-1)*size)+","+size+";"; 47 | 48 | return SQLUtils.queryRecordList(sql, Reply.class); 49 | } 50 | 51 | @Override 52 | public List findReplyByUser(String userName, int pageCode, int size) { 53 | // TODO Auto-generated method stub 54 | String sql="select reply.replyId,reply.replyContent,reply.replyTime,reply.postId,reply.userName,user_info.nickname userNickname,user_info.head userHead " 55 | + " from reply,user_info " 56 | + " where reply.userName='"+userName+"' and reply.userName=user_info.userName " 57 | + " order by reply.replyTime " 58 | + " limit "+((pageCode-1)*size)+","+size+";"; 59 | 60 | return SQLUtils.queryRecordList(sql, Reply.class); 61 | } 62 | 63 | @Override 64 | public List findAllReply(int pageCode, int size) { 65 | // TODO Auto-generated method stub 66 | 67 | String sql="select reply.replyId,reply.replyContent,reply.replyTime,reply.postId,reply.userName,user_info.nickname userNickname,user_info.head userHead " 68 | + " from reply,user_info " 69 | + " where reply.userName=user_info.userName " 70 | + " order by reply.replyTime " 71 | + " limit "+((pageCode-1)*size)+","+size+";"; 72 | 73 | return SQLUtils.queryRecordList(sql, Reply.class); 74 | } 75 | 76 | @Override 77 | public long getReplyCountByPost(int postId) { 78 | // TODO Auto-generated method stub 79 | String sql="select count(*) from reply where postId="+postId+";"; 80 | return SQLUtils.getRecordCount(sql); 81 | } 82 | 83 | @Override 84 | public long getAllReplyCount() { 85 | // TODO Auto-generated method stub 86 | String sql="select count(*) from reply;"; 87 | return SQLUtils.getRecordCount(sql); 88 | } 89 | 90 | @Override 91 | public long getReplyCountByUser(String userName) { 92 | // TODO Auto-generated method stub 93 | String sql="select count(*) from reply where userName='"+userName+"';"; 94 | return SQLUtils.getRecordCount(sql); 95 | } 96 | 97 | } 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/campusbbs/model/service/impl/UploadServiceImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.service.impl; 2 | 3 | import java.awt.Image; 4 | import java.io.ByteArrayInputStream; 5 | import java.io.DataInputStream; 6 | import java.io.DataOutputStream; 7 | import java.io.File; 8 | import java.io.FileOutputStream; 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | 12 | import javax.imageio.ImageIO; 13 | import javax.servlet.http.Part; 14 | import campusbbs.model.service.UploadService; 15 | import campusbbs.model.utils.FileUtils; 16 | 17 | public class UploadServiceImpl implements UploadService{ 18 | 19 | @Override 20 | public Image getImage(Part part) throws IOException{ 21 | // TODO Auto-generated method stub 22 | 23 | byte[] buf=new byte[(int)part.getSize()]; 24 | InputStream is=part.getInputStream(); 25 | is.read(buf); 26 | ByteArrayInputStream bis=new ByteArrayInputStream(buf); 27 | 28 | return ImageIO.read(bis); 29 | 30 | } 31 | 32 | @Override 33 | public void saveImage(Image img, String path, String fileName) { 34 | // TODO Auto-generated method stub 35 | 36 | } 37 | 38 | @Override 39 | public boolean saveImage(Part part, String path,String newFileName,String oldFileName) { 40 | // TODO Auto-generated method stub 41 | 42 | path=path.replaceAll("\\\\","/"); 43 | 44 | String temFileName=path+"/tem";//新文件 45 | String tarFileName=path+"/"+newFileName;//旧文件 46 | System.out.println(temFileName); 47 | System.out.println(tarFileName); 48 | //创建文件 49 | File file=new File(temFileName); 50 | if(file.exists()){ 51 | file.delete(); 52 | } 53 | 54 | try { 55 | file.createNewFile(); 56 | 57 | byte[] data=new byte[1024]; 58 | int len; 59 | 60 | // InputStream is=part.getInputStream(); 61 | DataInputStream dis=new DataInputStream(part.getInputStream()); 62 | DataOutputStream dos=new DataOutputStream(new FileOutputStream(file)); 63 | 64 | //读入图片 65 | while((len=dis.read(data))!=-1){ 66 | dos.write(data, 0, len); 67 | } 68 | 69 | dis.close(); 70 | dos.close(); 71 | 72 | } catch (IOException e) { 73 | // TODO Auto-generated catch block 74 | e.printStackTrace(); 75 | return false; 76 | } 77 | 78 | FileUtils.copyFile(temFileName, tarFileName, true); 79 | 80 | //删除原来的文件 81 | FileUtils.deleteFile(temFileName); 82 | 83 | System.out.println("完成"); 84 | return true; 85 | } 86 | 87 | @Override 88 | public String getImageName(Part part) { 89 | // TODO Auto-generated method stub 90 | 91 | //content-disposition 92 | String head=part.getHeader("Content-Disposition"); 93 | //form-data; name="upImg"; filename="yishutuan.png" 94 | String fileName=head.substring(head.indexOf("filename=\"")+"filename=\"".length()); 95 | fileName=fileName.substring(0,fileName.indexOf("\"")); 96 | System.out.println("::::::"+fileName); 97 | 98 | return fileName; 99 | } 100 | 101 | @Override 102 | public String getStringParameter(Part part) { 103 | // TODO Auto-generated method stub 104 | 105 | StringBuffer sb=new StringBuffer(); 106 | 107 | try { 108 | 109 | byte[] data=new byte[8096]; 110 | int len=0; 111 | InputStream in=part.getInputStream(); 112 | String tem=null; 113 | while((len=in.read(data))!=-1){ 114 | tem=new String(data, 0, len, "utf-8"); 115 | System.out.println(len+" : "+tem); 116 | sb.append(tem); 117 | } 118 | in.close(); 119 | 120 | } catch (IOException e) { 121 | // TODO Auto-generated catch block 122 | e.printStackTrace(); 123 | } 124 | 125 | return sb.toString(); 126 | 127 | } 128 | 129 | 130 | } 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /WebContent/public/top.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html; charset=utf-8" language="java" 2 | import="java.sql.*" errorPage=""%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 校园社团论坛 9 | 75 | 76 | 77 | 78 | 79 | 80 |
81 |
82 |
83 | logo 84 |
85 |
86 | 87 | 88 | 89 | 90 |
92 | ">登录 94 | | ">注册 96 |
97 |
98 | 99 |
100 | 头像 101 |
102 |
103 | 108 |
109 | 110 | 注销 111 | 112 |
113 |
114 |
115 |
116 | 117 |
118 | 119 |
120 |
121 |
122 | 123 |
125 | 126 |
127 |
128 |
129 | 138 |
139 |
140 | 141 | 142 | 143 | 145 | 147 | 148 |
149 | 150 |
151 |
152 |
153 |
154 | 155 |
156 | 157 |
158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/impl/UserDAOImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import campusbbs.model.dao.UserDAO; 7 | import campusbbs.model.utils.SQLUtils; 8 | import campusbbs.model.vo.SystemAdmin; 9 | import campusbbs.model.vo.User; 10 | import campusbbs.model.vo.UserInfo; 11 | 12 | public class UserDAOImpl implements UserDAO { 13 | @Override 14 | public boolean saveUser(User user) { 15 | // TODO Auto-generated method stub 16 | 17 | UserInfo info=user.getUserInfo(); 18 | 19 | if(findUserByName(user.getUserName())!=null){ 20 | return false; 21 | } 22 | 23 | String sql="insert into bbs_user value(" 24 | +"\""+user.getUserName()+"\"," 25 | +"\""+user.getPasswd()+"\");"; 26 | 27 | SQLUtils.updateRecord(sql); 28 | 29 | sql="insert into user_info value(" 30 | +"\""+user.getUserName()+"\"," 31 | +"\""+info.getNickname()+"\"," 32 | +"\""+info.getHead()+"\"," 33 | +"\""+info.getEmailAccount()+"\"," 34 | +"\""+info.getEmailServerId()+"\")" 35 | + ";"; 36 | 37 | SQLUtils.updateRecord(sql); 38 | 39 | return true; 40 | 41 | } 42 | 43 | @Override 44 | public boolean deleteUser(String userName) { 45 | // TODO Auto-generated method stub 46 | 47 | if(findUserByName(userName)==null){ 48 | return false; 49 | } 50 | 51 | String sql="delete from bbs_user where userName=\""+userName+"\";"; 52 | SQLUtils.updateRecord(sql); 53 | return true; 54 | 55 | } 56 | 57 | @Override 58 | public boolean updatePasswd(String userName, String passwd) { 59 | // TODO Auto-generated method stub 60 | 61 | if(findUserByName(userName)==null){ 62 | return false; 63 | } 64 | 65 | String sql="update bbs_user set passwd=\""+passwd+"\" where userName=\""+userName+"\";"; 66 | SQLUtils.updateRecord(sql); 67 | 68 | return true; 69 | } 70 | 71 | @Override 72 | public boolean updateUserInfo(UserInfo info) { 73 | // TODO Auto-generated method stub 74 | 75 | if(findUserByName(info.getUserName())==null){ 76 | return false; 77 | } 78 | 79 | String sql="update user_info set "; 80 | int c=0; 81 | ArrayList arr=new ArrayList<>(); 82 | 83 | if(info.getNickname()!=null){ 84 | sql+=" nickname=? "; 85 | arr.add(info.getNickname()); 86 | System.out.println(info.getNickname()); 87 | c++; 88 | } 89 | 90 | if(info.getHead()!=null){ 91 | if(c!=0){ 92 | sql+=","; 93 | } 94 | sql+=" head=? "; 95 | arr.add(info.getHead()); 96 | System.out.println(info.getHead()); 97 | c++; 98 | } 99 | 100 | if(info.getEmailAccount()!=null){ 101 | if(c!=0){ 102 | sql+=","; 103 | } 104 | sql+=" emailAccount=? , emailServerId=? "; 105 | arr.add(info.getEmailAccount()); 106 | arr.add(info.getEmailServerId()); 107 | System.out.println(info.getEmailAccount()); 108 | } 109 | 110 | sql+="where userName=\""+info.getUserName()+"\";"; 111 | 112 | SQLUtils.updateRecord(sql,arr.toArray()); 113 | 114 | return true; 115 | 116 | } 117 | 118 | @Override 119 | public User findUserByName(String userName) { 120 | // TODO Auto-generated method stub 121 | 122 | String sql="select * from bbs_user where userName=\""+userName+"\""; 123 | return SQLUtils.queryRecordById(sql, User.class); 124 | 125 | } 126 | 127 | @Override 128 | public List findUserList(int pageCode, int size) { 129 | // TODO Auto-generated method stub 130 | 131 | String sql="select * from bbs_user limit "+((pageCode-1)*size)+","+size+";"; 132 | return SQLUtils.queryRecordList(sql, User.class); 133 | 134 | } 135 | 136 | @Override 137 | public List findUserInfoList(int pageCode, int size) { 138 | // TODO Auto-generated method stub 139 | 140 | String sql="select * from user_info limit "+((pageCode-1)*size)+","+size+";"; 141 | 142 | return SQLUtils.queryRecordList(sql, UserInfo.class); 143 | 144 | } 145 | 146 | @Override 147 | public UserInfo findUserInfoByName(String userName) { 148 | // TODO Auto-generated method stub 149 | String sql="select * from user_info where userName=\""+userName+"\""; 150 | return SQLUtils.queryRecordById(sql, UserInfo.class); 151 | } 152 | 153 | @Override 154 | public long getUserCount() { 155 | // TODO Auto-generated method stub 156 | String sql="select count(*) from bbs_user"; 157 | return SQLUtils.getRecordCount(sql); 158 | 159 | } 160 | 161 | @Override 162 | public SystemAdmin findSystemAdmin(String adminName) { 163 | // TODO Auto-generated method stub 164 | String sql="select * from system_admin where adminName='"+adminName+"';"; 165 | return SQLUtils.queryRecordById(sql, SystemAdmin.class); 166 | } 167 | 168 | } 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /WebContent/sys/public/left.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | 3 | 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 5 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 6 | 7 | 8 | 9 | Frame left 10 | 11 | 12 | 13 | 14 | 27 | 28 | 83 | 84 | 85 | 86 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /WebContent/sys/public/top.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 5 | 6 | 7 | 8 | 9 | Frame top 10 | 11 | 12 | 13 | 102 | 103 | 104 | 105 | 106 | 107 |
108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 |
118 |
119 | 请登陆 120 |
121 |
122 |
123 | 124 |
125 | 126 |
127 | 128 | 您好,${ sessionScope.adminUser.adminName } 129 |
130 | 131 | 132 | 140 |
141 |
142 |
143 | 144 |
145 | 146 |
147 | 148 |
149 |
    150 | 151 |
152 |
153 | 154 | 164 | 165 | 180 |
181 | 182 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/impl/ClubDAOImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import campusbbs.model.dao.ClubDAO; 7 | import campusbbs.model.utils.SQLUtils; 8 | import campusbbs.model.vo.Club; 9 | import campusbbs.model.vo.ClubType; 10 | 11 | public class ClubDAOImpl implements ClubDAO { 12 | 13 | private static final String CLUB_TABLE="club"; 14 | 15 | @Override 16 | public void saveClub(Club club) { 17 | // TODO Auto-generated method stub 18 | 19 | String sql="insert into "+CLUB_TABLE+"(clubName,clubIcon,clubDescribe,clubTypeId) value(" 20 | + "\""+club.getClubName()+"\"," 21 | + "\""+club.getClubIcon()+"\"," 22 | + "\""+club.getClubDescribe()+"\"," 23 | +club.getClubTypeId()+");"; 24 | 25 | SQLUtils.updateRecord(sql); 26 | 27 | } 28 | 29 | @Override 30 | public void deleteClub(String clubName) { 31 | // TODO Auto-generated method stub 32 | 33 | String sql="delete from "+CLUB_TABLE+" where clubName='"+clubName+"';"; 34 | SQLUtils.updateRecord(sql); 35 | 36 | } 37 | 38 | @Override 39 | public void updateClub(String clubName,Club club) { 40 | // TODO Auto-generated method stub 41 | 42 | String sql="update "+CLUB_TABLE+" set "; 43 | int c=0; 44 | ArrayList arr=new ArrayList<>(); 45 | 46 | if(club.getClubName()!=null){ 47 | sql+=" clubName=? "; 48 | arr.add(club.getClubName()); 49 | c++; 50 | } 51 | 52 | if(club.getClubIcon()!=null){ 53 | sql+=" clubIcon=? "; 54 | arr.add(club.getClubIcon()); 55 | c++; 56 | } 57 | 58 | if(club.getClubDescribe()!=null){ 59 | if(c!=0){ 60 | sql+=","; 61 | } 62 | sql+=" clubDescribe=? "; 63 | arr.add(club.getClubDescribe()); 64 | c++; 65 | } 66 | 67 | if(club.getClubTypeId()>0){ 68 | if(c!=0){ 69 | sql+=","; 70 | } 71 | sql+=" clubTypeId=? "; 72 | arr.add(club.getClubTypeId()); 73 | c++; 74 | } 75 | 76 | sql+="where clubName='"+clubName+"';"; 77 | 78 | SQLUtils.updateRecord(sql,arr.toArray()); 79 | 80 | } 81 | 82 | @Override 83 | public Club findClub(String clubName) { 84 | // TODO Auto-generated method stub 85 | 86 | String sql="select c.clubName,clubIcon,clubDescribe,clubTypeId,count(postId) postNum,sum(replyNum) replyNum " 87 | + "from (select * from club where club.clubName='"+clubName+"') c " 88 | + "left join ( " 89 | + "select post.postId,post.clubName,count(replyId) replyNum from post " 90 | + "left join reply " 91 | + "on reply.postId=post.postId " 92 | + "group by post.postId) p " 93 | + "on c.clubName=p.clubName " 94 | + "group by c.clubName;"; 95 | 96 | return SQLUtils.queryRecordById(sql, Club.class); 97 | 98 | } 99 | 100 | @Override 101 | public List findAllClub() { 102 | // TODO Auto-generated method stub 103 | 104 | String sql="select club.clubName,clubIcon,clubDescribe,clubTypeId,count(postId) postNum,sum(replyNum) replyNum from club " 105 | + "left join ( " 106 | + "select post.postId,post.clubName,count(replyId) replyNum from post " 107 | + "left join reply " 108 | + "on reply.postId=post.postId " 109 | + "group by post.postId) p " 110 | + "on club.clubName=p.clubName " 111 | + "group by club.clubName;"; 112 | 113 | return SQLUtils.queryRecordList(sql, Club.class); 114 | 115 | } 116 | 117 | @Override 118 | public List findPreClub(int num) { 119 | // TODO Auto-generated method stub 120 | 121 | String sql="select r.clubName,clubIcon,clubDescribe,clubTypeId,postNum,replyNum from ( " 122 | + "select club.clubName,clubIcon,clubDescribe,clubTypeId,count(postId) postNum,sum(replyNum) replyNum from club " 123 | + "left join ( " 124 | + "select post.postId,post.clubName,count(replyId) replyNum from post " 125 | + "left join reply " 126 | + "on reply.postId=post.postId " 127 | + "group by post.postId) p " 128 | + "on club.clubName=p.clubName " 129 | + "group by club.clubName " 130 | + "order by postNum " 131 | + ") r " 132 | + "order by (r.postNum+r.replyNum) desc " 133 | + "limit 0,"+num+";"; 134 | 135 | return SQLUtils.queryRecordList(sql, Club.class); 136 | 137 | } 138 | 139 | @Override 140 | public long getClubCount() { 141 | // TODO Auto-generated method stub 142 | String sql="select count(*) from "+CLUB_TABLE+";"; 143 | return SQLUtils.getRecordCount(sql); 144 | } 145 | 146 | @Override 147 | public long getClubTypeCount() { 148 | // TODO Auto-generated method stub 149 | String sql="select count(*) from club_type;"; 150 | return SQLUtils.getRecordCount(sql); 151 | } 152 | 153 | @Override 154 | public ClubType getClubTypeById(int typeId) { 155 | // TODO Auto-generated method stub 156 | String sql="select * from club_type where clubTypeId="+typeId+";"; 157 | return SQLUtils.queryRecordById(sql, ClubType.class); 158 | } 159 | 160 | @Override 161 | public void addClubType(ClubType clubType) { 162 | // TODO Auto-generated method stub 163 | String sql="insert into club_type(clubType) value('"+clubType.getClubType()+"');"; 164 | SQLUtils.updateRecord(sql); 165 | } 166 | 167 | @Override 168 | public void updateCLubType(ClubType clubType) { 169 | // TODO Auto-generated method stub 170 | String sql="update club_type set clubType='"+clubType.getClubType()+"' where clubTypeId="+clubType.getClubTypeId()+";"; 171 | SQLUtils.updateRecord(sql); 172 | } 173 | 174 | @Override 175 | public void deleteClubType(ClubType clubType) { 176 | // TODO Auto-generated method stub 177 | String sql="delete from club_type where clubTypeId="+clubType.getClubTypeId()+";"; 178 | SQLUtils.updateRecord(sql); 179 | } 180 | 181 | @Override 182 | public List getClubTypeList() { 183 | // TODO Auto-generated method stub 184 | String sql="select * from club_type order by clubTypeId;"; 185 | return SQLUtils.queryRecordList(sql, ClubType.class); 186 | } 187 | 188 | } 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | -------------------------------------------------------------------------------- /src/campusbbs/model/dao/impl/PostDAOImpl.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import campusbbs.model.dao.PostDAO; 6 | import campusbbs.model.utils.SQLUtils; 7 | import campusbbs.model.vo.Post; 8 | import campusbbs.model.vo.PostType; 9 | import campusbbs.model.vo.UserInfo; 10 | 11 | public class PostDAOImpl implements PostDAO { 12 | 13 | @Override 14 | public void savaPost(Post post) { 15 | // TODO Auto-generated method stub 16 | 17 | String sql="insert into post(postTitle,postContent,postTime,lastTime,userName,clubName,postTypeId) value(?,?,?,?,?,?,?);"; 18 | Object[] objs={ 19 | post.getPostTitle(), 20 | post.getPostContent(), 21 | post.getPostTime(), 22 | post.getLastTime(), 23 | post.getUserName(), 24 | post.getClubName(), 25 | post.getPostTypeId() 26 | }; 27 | 28 | SQLUtils.updateRecord(sql, objs); 29 | 30 | } 31 | 32 | @Override 33 | public void addPostType(PostType type) { 34 | // TODO Auto-generated method stub 35 | 36 | String sql="insert into post_type(postType,color) value(?,?);"; 37 | Object[] param={ 38 | type.getPostType(), 39 | type.getColor() 40 | }; 41 | SQLUtils.updateRecord(sql, param); 42 | 43 | } 44 | 45 | @Override 46 | public void deletePostById(int id) { 47 | // TODO Auto-generated method stub 48 | String sql="delete from post where postId="+id+";"; 49 | SQLUtils.updateRecord(sql); 50 | } 51 | 52 | @Override 53 | public void deletePostType(int id) { 54 | // TODO Auto-generated method stub 55 | String sql="delete from post_type where postTypeId="+id+";"; 56 | SQLUtils.updateRecord(sql); 57 | } 58 | 59 | @Override 60 | public Post findPostById(int id) { 61 | // TODO Auto-generated method stub 62 | String sql="select * from post " 63 | + "where postId="+id+";"; 64 | 65 | Post post=SQLUtils.queryRecordById(sql, Post.class); 66 | 67 | //用户发帖用户的头像 68 | sql="select nickname,head from user_info where userName= '"+post.getUserName()+"';"; 69 | 70 | UserInfo info=SQLUtils.queryRecordById(sql, UserInfo.class); 71 | post.setUserHead(info.getHead()); 72 | post.setUserNickname(info.getNickname()); 73 | 74 | return post; 75 | } 76 | 77 | @Override 78 | public PostType findPostTypeById(int id) { 79 | // TODO Auto-generated method stub 80 | String sql="select * from post_type where postTypeId="+id+";"; 81 | return SQLUtils.queryRecordById(sql, PostType.class); 82 | } 83 | 84 | @Override 85 | public void updatePostType(PostType postType) { 86 | // TODO Auto-generated method stub 87 | 88 | String sql="update post_type set postType=?,color=? where postTypeId="+postType.getPostTypeId(); 89 | Object[] param={ 90 | postType.getPostType(), 91 | postType.getColor() 92 | }; 93 | SQLUtils.updateRecord(sql, param); 94 | 95 | } 96 | 97 | @Override 98 | public long getAllPostNum() { 99 | // TODO Auto-generated method stub 100 | String sql="select count(*) from post"; 101 | return SQLUtils.getRecordCount(sql); 102 | } 103 | 104 | @Override 105 | public long getPostNumByCLub(String clubName) { 106 | // TODO Auto-generated method stub 107 | String sql="select count(*) from post where clubName='"+clubName+"';"; 108 | return SQLUtils.getRecordCount(sql); 109 | } 110 | 111 | @Override 112 | public long getPostTypeCount() { 113 | // TODO Auto-generated method stub 114 | String sql="select count(*) from post"; 115 | return SQLUtils.getRecordCount(sql); 116 | } 117 | 118 | @Override 119 | public List findPostByClub(String clubName, int pageCode, int size) { 120 | // TODO Auto-generated method stub 121 | 122 | String sql="select post.postId,post.postTitle,post.postTime,post.lastTime,post.userName,post.clubName,post.postTypeId from post " 123 | + "where post.clubName='"+clubName+"' " 124 | + "order by post.lastTime desc " 125 | + "limit "+((pageCode-1)*size)+","+size+";"; 126 | return SQLUtils.queryRecordList(sql, Post.class); 127 | } 128 | 129 | @Override 130 | public List findLastPost(int pageCode, int size) { 131 | // TODO Auto-generated method stub 132 | 133 | String sql="select post.postId,post.postTitle,post.postTime,post.lastTime,post.userName,post.clubName,post.postTypeId from post " 134 | + "order by postTime desc " 135 | + "limit "+((pageCode-1)*size)+","+size+";"; 136 | 137 | return SQLUtils.queryRecordList(sql, Post.class); 138 | 139 | } 140 | 141 | @Override 142 | public List findHostPost(int pageCode, int size) { 143 | // TODO Auto-generated method stub 144 | 145 | String sql="select post.postId,post.postTitle,post.postTime,post.lastTime,post.userName,post.clubName,post.postTypeId from post " 146 | + "left join reply " 147 | + "on post.postId=reply.postId " 148 | + "group by post.postId " 149 | + "order by count(reply.replyId) desc " 150 | + "limit "+((pageCode-1)*size)+","+size+";"; 151 | 152 | return SQLUtils.queryRecordList(sql, Post.class); 153 | } 154 | 155 | @Override 156 | public List getPostTypeList() { 157 | // TODO Auto-generated method stub 158 | String sql="select * from post_type;"; 159 | return SQLUtils.queryRecordList(sql, PostType.class); 160 | } 161 | 162 | @Override 163 | public long getPostNumByUser(String userName) { 164 | // TODO Auto-generated method stub 165 | String sql="select count(*) from post where userName='"+userName+"';"; 166 | return SQLUtils.getRecordCount(sql); 167 | } 168 | 169 | @Override 170 | public List findPostByUser(String userName, int pageCode, int size) { 171 | // TODO Auto-generated method stub 172 | 173 | String sql="select post.postId,post.postTitle,post.postTime,post.lastTime,post.userName,post.clubName,post.postTypeId from post " 174 | + "where post.userName='"+userName+"' " 175 | + "order by post.lastTime desc " 176 | + "limit "+((pageCode-1)*size)+","+size+";"; 177 | 178 | return SQLUtils.queryRecordList(sql, Post.class); 179 | 180 | } 181 | 182 | } 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /WebContent/sys/adminLogin.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 83 | 84 | 107 | 108 | 109 | 110 |
111 | 112 |
113 | 114 |
117 | 118 | 119 | 120 | 121 | 122 | 127 | 128 | 129 | 138 | 139 | 140 | 149 | 150 | 151 | 174 | 175 | 176 | 187 | 188 | 189 | 197 | 198 |
123 |
124 |

管理员登陆

125 |
126 |
133 |
134 |
用户名
137 |
144 |
145 |
密码
148 |
152 |
153 | 157 |
158 |
验证码
161 |
162 |
163 |
164 | 167 |
168 |
169 | 171 |
172 |
173 |
177 | 178 |
179 |  记住我 180 |
181 |
182 | 忘记密码 183 |
184 |
185 | 186 |
199 | 200 |
201 | 202 | 203 | 206 | 207 | 208 |
209 | 210 |
211 | 212 | -------------------------------------------------------------------------------- /WebContent/sys/adClub.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 11 | 72 | 73 | 74 | 75 | 76 | 77 |
78 | 79 |
80 | 81 |
82 | 版块类型管理: 83 |
84 | 85 | 86 | 87 | 88 | 89 | 92 | 95 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 108 | 111 | 114 | 115 | 116 | 117 | 118 | 119 | 120 |
90 | 分类 91 | 93 | 编辑 94 | 96 | 删除 97 |
106 | ${ type.clubType } 107 | 109 | 编辑 110 | 112 | 删除 113 |
121 | 122 |
123 | 124 |
125 | 添加分类: 126 |
127 | 128 |
129 | 130 | 131 | 132 | 133 |
134 | 135 |
136 | 137 |
138 | 139 | 140 |
141 |
142 |
143 | 144 |
145 | 146 |
147 |
148 | 版块管理: 149 |
150 | 155 |
156 |
157 | 158 |
159 | 160 | 161 | 162 | 163 | 164 |
165 | 166 |
167 | 168 | ${ type.clubType } 169 | 170 |
171 | 172 |
173 | 174 | 175 | 176 |
177 | 178 | 179 | 187 | 194 | 195 | 196 | 199 | 200 | 201 | 204 | 205 |
180 |
182 | 183 | 图标 185 |
186 |
188 | 189 | 190 | ${ item.clubName } 191 | 192 | 193 |
197 | 主题:${ item.postNum } 198 |
202 | 贴数:${ item.replyNum+item.postNum } 203 |
206 |
207 |
208 | 209 |
210 |
211 |
212 | 213 |
214 |
215 |
216 | 217 |

暂无版块

218 |
219 | 220 |
221 | 222 | 223 |
224 | 225 |
226 | 227 | 228 |
229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /src/campusbbs/model/utils/SQLUtils.java: -------------------------------------------------------------------------------- 1 | package campusbbs.model.utils; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.util.List; 8 | 9 | import javax.sql.DataSource; 10 | 11 | public class SQLUtils { 12 | 13 | private Connection con; 14 | 15 | public SQLUtils(Connection con) { 16 | super(); 17 | this.con = con; 18 | } 19 | 20 | public SQLUtils(DataSource source) throws SQLException{ 21 | super(); 22 | this.con = source.getConnection(); 23 | } 24 | 25 | /** 26 | * 查找一组数据 27 | * @param sql sql查询语句 28 | * @param beanClass 结果集数据的封装类 29 | * @return 所查找的一组数据 30 | */ 31 | public List queryByList(String sql,Class beanClass){ 32 | PreparedStatement p=null; 33 | ResultSet rs=null; 34 | List list=null; 35 | try { 36 | p=con.prepareStatement(sql); 37 | rs=p.executeQuery(); 38 | BeanHandler handler=new BeanHandler<>(beanClass); 39 | list=handler.getBeanList(rs); 40 | } catch (SQLException e) { 41 | // TODO Auto-generated catch block 42 | e.printStackTrace(); 43 | } finally{ 44 | try { 45 | if(rs!=null){ 46 | rs.close(); 47 | } 48 | if(p!=null){ 49 | p.close(); 50 | } 51 | } catch (SQLException e) { 52 | // TODO Auto-generated catch block 53 | e.printStackTrace(); 54 | } 55 | } 56 | return list; 57 | } 58 | 59 | /** 60 | * 查找一组数据的静态方法 61 | * @param sql sql查询语句 62 | * @param beanClass 结果集数据的封装类 63 | * @return 所查找的一组数据 64 | */ 65 | public static List queryRecordList(String sql,Class beanClass){ 66 | 67 | System.out.println("queryRecordList\t"+sql); 68 | 69 | SQLUtils sqlUtils=DBUtils.getSQLUtils(); 70 | List list=sqlUtils.queryByList(sql, beanClass); 71 | sqlUtils.close(); 72 | 73 | return list; 74 | 75 | } 76 | 77 | /** 78 | * 根据主键查询数据 79 | * @param sql 查询sql语句 80 | * @param beanClass 每条查询结果的类型 81 | * @return 查询结果对象 82 | */ 83 | public T queryById(String sql,Class beanClass){ 84 | PreparedStatement p=null; 85 | ResultSet rs=null; 86 | T res=null; 87 | try { 88 | p=con.prepareStatement(sql); 89 | rs=p.executeQuery(); 90 | BeanHandler handler=new BeanHandler<>(beanClass); 91 | res=handler.findBeanById(rs); 92 | } catch (SQLException e) { 93 | // TODO Auto-generated catch block 94 | e.printStackTrace(); 95 | } finally { 96 | try { 97 | if(rs!=null){ 98 | rs.close(); 99 | } 100 | if(p!=null){ 101 | p.close(); 102 | } 103 | } catch (SQLException e) { 104 | // TODO Auto-generated catch block 105 | e.printStackTrace(); 106 | } 107 | } 108 | return res; 109 | } 110 | 111 | /** 112 | * 静态方法,根据主键查询数据 113 | * @param sql 查询sql语句 114 | * @param beanClass 每条查询结果的类型 115 | * @return 查询结果对象 116 | */ 117 | public static T queryRecordById(String sql,Class beanClass){ 118 | 119 | System.out.println("queryRecordById\t"+sql); 120 | 121 | SQLUtils sqlUtils=DBUtils.getSQLUtils(); 122 | T obj=sqlUtils.queryById(sql, beanClass); 123 | sqlUtils.close(); 124 | 125 | return obj; 126 | 127 | } 128 | 129 | /** 130 | * 执行获取记录条数的sql语句 131 | * @param sql sql语句 132 | * @return 数据数量 133 | */ 134 | public long getCount(String sql){ 135 | PreparedStatement p=null; 136 | ResultSet rs=null; 137 | long count=0; 138 | try { 139 | p=con.prepareStatement(sql); 140 | rs=p.executeQuery(); 141 | if(rs!=null){ 142 | rs.next(); 143 | count=rs.getLong(1); 144 | } 145 | } catch (SQLException e) { 146 | // TODO Auto-generated catch block 147 | e.printStackTrace(); 148 | } finally { 149 | try { 150 | if(rs!=null){ 151 | rs.close(); 152 | } 153 | if(p!=null){ 154 | p.close(); 155 | } 156 | } catch (SQLException e) { 157 | // TODO Auto-generated catch block 158 | e.printStackTrace(); 159 | } 160 | } 161 | return count; 162 | } 163 | 164 | /** 165 | * 执行获取记录条数的sql语句 166 | * @param sql sql语句 167 | * @return 数据数量 168 | */ 169 | public static long getRecordCount(String sql){ 170 | 171 | System.out.println("getRecordCount\t"+sql); 172 | 173 | SQLUtils sqlUtils = DBUtils.getSQLUtils(); 174 | long count=sqlUtils.getCount(sql); 175 | sqlUtils.close(); 176 | 177 | return count; 178 | } 179 | 180 | /** 181 | * 更新数据 182 | * @param sql 更新数据库的sql语句 183 | */ 184 | public void update(String sql){ 185 | try { 186 | PreparedStatement p=con.prepareStatement(sql); 187 | p.execute(); 188 | p.close(); 189 | } catch (SQLException e) { 190 | // TODO Auto-generated catch block 191 | e.printStackTrace(); 192 | } 193 | } 194 | 195 | /** 196 | * 更新数据 197 | * @param sql 更新数据库的sql语句 198 | */ 199 | public static void updateRecord(String sql){ 200 | 201 | System.out.println("updateRecord\t"+sql); 202 | 203 | @SuppressWarnings("rawtypes") 204 | SQLUtils sqlUtils = DBUtils.getSQLUtils(); 205 | sqlUtils.update(sql); 206 | sqlUtils.close(); 207 | 208 | } 209 | 210 | /** 211 | * 212 | * 更新数据 213 | * @param sql 更新数据库的sql语句 214 | * @param param 参数 215 | */ 216 | public void update(String sql,Object[] param){ 217 | try { 218 | PreparedStatement p=con.prepareStatement(sql); 219 | 220 | for(int i=0;i10){ 117 | saveErrorMessage("昵称长度不能超过十个字!"); 118 | return false; 119 | } 120 | 121 | saveErrorMessage(""); 122 | userDAO.saveUser(user); 123 | 124 | return true; 125 | } 126 | 127 | @Override 128 | public boolean updateUserInfo(UserInfo info) { 129 | // TODO Auto-generated method stub 130 | 131 | if(info.getEmailAccount()==null||info.getEmailAccount().trim().isEmpty()){ 132 | saveErrorMessage("邮箱不能为空!"); 133 | return false; 134 | } 135 | 136 | if(info.getNickname().length()>10){ 137 | saveErrorMessage("昵称长度不能超过十个字!"); 138 | return false; 139 | } 140 | 141 | saveErrorMessage(""); 142 | userDAO.updateUserInfo(info); 143 | return true; 144 | } 145 | 146 | @Override 147 | public boolean updatePasswd(User user, String oldPwd, String newPwd, String pwdAgain) { 148 | // TODO Auto-generated method stub 149 | 150 | if(oldPwd==null||oldPwd==""||newPwd==null||newPwd==""){ 151 | saveErrorMessage("密码不能为空"); 152 | return false; 153 | } 154 | 155 | User acc=userDAO.findUserByName(user.getUserName()); 156 | if(acc!=null){ 157 | if(!acc.getPasswd().equals(oldPwd)){ 158 | saveErrorMessage("密码错误"); 159 | return false; 160 | } 161 | }else{ 162 | saveErrorMessage("用户不存在"); 163 | return false; 164 | } 165 | 166 | if(!newPwd.equals(pwdAgain)){ 167 | saveErrorMessage("前后密码不一致"); 168 | return false; 169 | } 170 | 171 | userDAO.updatePasswd(acc.getUserName(), newPwd); 172 | 173 | return true; 174 | } 175 | 176 | @Override 177 | public String getErrorMessage() { 178 | // TODO Auto-generated method stub 179 | return errorMessage; 180 | } 181 | 182 | @Override 183 | public void savePost(Post post) { 184 | // TODO Auto-generated method stub 185 | 186 | String content=post.getPostContent(); 187 | 188 | if(content!=null){ 189 | StringBuffer sb=new StringBuffer(); 190 | String[] lines=content.split("\n"); 191 | for (int i=0;i"); 193 | sb.append(lines[i]); 194 | sb.append(""); 195 | if(i!=lines.length-1){ 196 | sb.append("
"); 197 | } 198 | } 199 | post.setPostContent(sb.toString()); 200 | } 201 | 202 | postDAO.savaPost(post); 203 | 204 | } 205 | 206 | @Override 207 | public void deletePost(int postId) { 208 | // TODO Auto-generated method stub 209 | postDAO.deletePostById(postId); 210 | } 211 | 212 | @Override 213 | public void savaReply(Reply reply) { 214 | // TODO Auto-generated method stub 215 | replyDAO.saveReply(reply); 216 | } 217 | 218 | @Override 219 | public void updateClub(String clubName,Club club) { 220 | // TODO Auto-generated method stub 221 | clubDAO.updateClub(clubName,club); 222 | } 223 | 224 | private void saveErrorMessage(String errorMessage){ 225 | this.errorMessage=errorMessage; 226 | } 227 | 228 | @Override 229 | public UserInfo getUserInfo(String userName) { 230 | // TODO Auto-generated method stub 231 | 232 | //查找用户信息 233 | UserInfo info=userDAO.findUserInfoByName(userName); 234 | return info; 235 | 236 | } 237 | 238 | @Override 239 | public void deleteReply(int id) { 240 | // TODO Auto-generated method stub 241 | replyDAO.deleteReplyById(id); 242 | } 243 | 244 | } 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | --------------------------------------------------------------------------------