基于ssm小说阅读网站源码和论文

基于SSM的在线网络小说阅读网站的设计与实现

摘  要

现在是互联网快速发展的时代,网络是一种新媒体的类型,被称为“第四媒体”,随着越来越多的人进入互联网时代,网络阅读一种由文本的变化所带来的新的阅读方式,借助计算机、网络技术来获取多媒体合成信息和知识的阅读行为,对人们来说是一个新的阅读体验,改变了阅读的媒介(以前是纸质的),是时代的进步。

基于SSM的在线网络小说阅读网站主要实现了阅读书籍、搜索书籍、收藏自己喜欢的书籍等功能。管理员可以管理用户、管理作者、管理书架,可以切换页面主题有暗黑模式和明亮模式,还可以切换简体、繁体、英语三种语言使得后台管理更加方便。

本系统在IDEA编译软件下,使用纯面向对象的Java语言,SSM作为后端框架,MySQL数据库等技术进行开发,使用JSP对网站前端界面进行设计,用Navicat for MySQL管理MySQL数据库。

【646】基于ssm小说阅读网站源码和论文

关字段长度词 SSM;阅读;Java语言;MySQL数据库

Design and implementation of online network novel reading website based on SSM

Abstract

Now is the era of rapid development of the Internet. The network is a type of new media, known as the "fourth media". With more and more people entering the Internet era, network reading is a new reading mode brought by the changes of text. It is a new reading experience for people to obtain multimedia synthetic information and knowledge by means of computer and network technology, Changing the medium of reading (formerly paper) is the progress of the times。

The online online online novel reading website based on SSM mainly realizes the functions of reading books, searching books, and collecting favorite books. The administrator can manage users, authors and bookshelves, and can switch the page theme to dark mode and bright mode, and also switch the simplified, traditional and English languages to make the background management more convenient。

The system is developed with pure object-oriented Java language, SSM as the back-end framework, MySQL database and other technologies under idea compilation software. The front-end interface of the website is designed with Vue, and the MySQL database is managed with Navicat for MySQL.

Keywords  SSM, read, Java Language, MySQL Database

 

 

package com.xh.controller;

import com.github.pagehelper.PageInfo;
import com.xh.dto.ResultData;
import com.xh.pojo.Reader;
import com.xh.pojo.*;
import com.xh.service.ReaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class ReaderController {
    @Autowired
    private ReaderService readerService;


    @RequestMapping("/duzhe")
    public String duzhe(HttpServletRequest request){
        request.getSession().removeAttribute("reader");

        return "loginreader";
    }

    @RequestMapping("/book/getByType?bookType=1")
    public String xiangqing(){
        return "front/personal";
    }



    /**
     * 登陆操作
     * @return
     */
    @RequestMapping("/loginreader")
    @ResponseBody

        public ResultData login1(Reader reader,HttpServletRequest request){
            // 登陆操作
            ResultData resultData = readerService.login1(reader);
            // 判断登陆成功,将用户数据保存到 session中
            // 如何获取session对象?
            if(resultData.getCode() == 200){
                HttpSession session = request.getSession();
                session.setAttribute("reader",resultData.getData());
            }

            return resultData;
        }




//    @RequestMapping("/login")
//    @ResponseBody// 该方法返回的是json字符串
//    public ResultData login(Admin admin,HttpServletRequest request){
//        // 登陆操作
//        ResultData resultData = adminService.login(admin);
//        // 判断登陆成功,将用户数据保存到 session中
//        // 如何获取session对象?
//        if(resultData.getCode() == 200){
//            HttpSession session = request.getSession();
//            session.setAttribute("admin",resultData.getData());
//        }
//
//        return resultData;
//    }
//
    //读者列表
    @RequestMapping("/reader/list")
    public String list(Model model,
                       @RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "5") Integer pageSize){


        PageInfo<Reader> pageInfo = readerService.list(page,pageSize);



        model.addAttribute("list",pageInfo.getList());
        model.addAttribute("pageInfo",pageInfo);

        return "reader/reader-list";
    }

    //搜索读者显示列表
    @RequestMapping("/reader/search")
    public String searchList(Model model,
                       @RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "5") Integer pageSize,
                             String keyword){

        PageInfo<Reader> pageInfo = readerService.searchList(page, pageSize, keyword);
        model.addAttribute("list",pageInfo.getList());
        model.addAttribute("pageInfo",pageInfo);

        return "reader/reader-list";
    }

    //读者删除列表
    @RequestMapping("/reader/deleteList")
    public String deleteList(Model model,
                       @RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "5") Integer pageSize){

        PageInfo<Reader> pageInfo = readerService.DeleteList(page,pageSize);
        model.addAttribute("list",pageInfo.getList());
        model.addAttribute("pageInfo",pageInfo);
        return "reader/reader-del";
    }

    //添加读者
    @RequestMapping("/reader/addPage")
    public String addPage(){
        return "front/register";
    }


//    添加读者的方法
    @RequestMapping("/reader/add")
    @ResponseBody
    public ResultData add(Reader reader){
        return readerService.add(reader);
    }

    /**
     * 编辑读者状态信息
     * @param readerId : 当前读者Id
     * @param readerStatus: 读者当前状态
     * @return
     */
    @RequestMapping("/reader/editStatus")
    @ResponseBody
    public ResultData editStatus(Integer readerId, Integer readerStatus){
        return readerService.updateStatus(readerId, readerStatus);
    }

    /**
     * 编辑读者
     * @param
     * @param
     * @return
     */
    @RequestMapping("/reader/editPage")
    public String editPage(Model model, Integer readerId){
        Reader dbreadder = readerService.findById(readerId);
        model.addAttribute("reader",dbreadder);
        return "reader/reader-edit";
    }

    /**
     * 更新读者基本信息的方法
     * @param reader
     * @return
     */
    @RequestMapping("/reader/edit")
    @ResponseBody
    public ResultData edit(Reader reader){
        return readerService.edit(reader);
    }

    /**
     * 批量删除
     * @param ids
     * @return
     */
    @RequestMapping("/reader/deleteAll")
    @ResponseBody
    public ResultData deleteAll(@RequestParam(name = "ids") String ids){
//        将ids转换成数组
        String[] idArr=ids.split(",");
        return readerService.batchDelete(idArr);
    };

    /**
     * 批量恢复
     * @param ids
     * @return
     */
    @RequestMapping("/reader/huifuAll")
    @ResponseBody
    public ResultData huifuDelete(@RequestParam(name = "ids") String ids){
//        将ids转换成数组
        String[] idArr=ids.split(",");
        return readerService.huifuDelete(idArr);
    };

    @RequestMapping("/reader/delete")
    @ResponseBody
    public ResultData deleteReader(Integer readerId, Integer readerStatus){
        return readerService.deletereader(readerId,readerStatus);
    }



    @RequestMapping("/reader/toCenter")
    public String toCenter(HttpSession session, Model model){
//         Reader reader = (Reader)session.getAttribute("reader");
//        if(reader==null){
//            return  "login";
//        }
        Reader reader = readerService.findById(1 );
        model.addAttribute("reader",reader);
        return "front/center";
    }



}
<%--<%@page contentType="text/html; charset=utf-8" language="java" %>--%>
<%--&lt;%&ndash;jsp 动作标签 => 转发&ndash;%&gt;--%>
<%--<jsp:forward page="/index"/>--%>
<%@page contentType="text/html; charset=utf-8" language="java"  isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--<%@ page contentType="text/html;charset=UTF-8" language="java" %>--%>
<html>
<%--<jsp:forward page="/book/getByType?bookType=1"/>--%>
<head>
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
            text-decoration: none;
        }

        .wrap {
            width: 1000px;
            height: 60px;
            margin-left: auto;
            margin-right: auto;
        }

        .header_top {
            width: 100%;
            height: 60px;
            padding-top: 20px;
            background-color: #fefefe;
        }

        .header_bottom {
            width: 100%;
            height: 50px;
            margin-top:20px;
            background-color: #217c70;
        }

        header {
            width: 100%;
            height: 150px;
            background-color: #fefefe;
        }




        .middle {
            width: 700px;
            height: 50px;
            line-height: 50px;

        }

        .middle li {
            float: left;
            margin-left: 20px;
        }

        .middle li a {
            color: white;
        }

        #first {
            margin-left: 0;
        }

        .right {
            float: right;
            width: 100px;
            height: 40px;
            margin-top:5px;
            text-align: center;
            border-radius: 5px;
            background-color: rgb(187, 175, 175);
        }

        .login {
            line-height: 40px;
            width: 50px;
            height: 50px;

        }

        .zhuce {
            line-height: 50px;
            width: 50px;
            height: 50px;
        }

        .wrap1 {
            width: 1000px;
            height: 100px;
            margin-left: auto;
            margin-right: auto;
        }

        section {
            width: 100%;
            height: 950px;
            background-color:rgb(255, 245, 245);
        }

        .tuijian {
            width: 90%;
            height: 400px;
            background-color: white;
            margin-left: auto;
            margin-right: auto;
            margin-top: 50px;
        }

        .zhanweifu {
            height: 1px;
        }

        .tuijian_top {
            width: 88%;
            height: 50px;
            margin-left: auto;
            margin-right: auto;
            line-height: 50px;
            border-bottom: 1px solid black;
        }

        .context {
            width: 88%;
            height: 300px;
            margin-left: auto;
            margin-right: auto;
            margin-top: 10px;

        }

        .neirong li {
            width: 480px;
            float: left;
            margin-left: 30px;
            margin-top: 20px;
        }

        .tupian {
            width: 120px;
            height: 150px;
            float: left;
        }

        .wenzi {
            float: left;
            width: 160px;
            height: 150px;
            margin-left: 10px;
        }

        img {
            width: 130px;
            height: 150px;
        }

        .wenzi p {
            margin-top: 14px;
            font-size: 18px;
        }

        footer {
            width: 100%;
            height: 100px;
            background-color: #ffebee
        }

        .last {
            width: 800px;
            height: 50px;
            padding: 20px;
            margin-left: auto;
            margin-right: auto;
        }

        .last ul li {
            float: left;
            margin-left: 20px;
        }
        .shuru{
            width: 400px;
            height: 50px;
            float: left;
            margin-left: 100px;
        }
        #inp{
            outline: none;
            padding: 0 15px;
        }
        .shuru input{
            float: left;
            width: 300px;
            height: 40px;
            margin-top: 5px;
            border-radius: 20px;
            border:1px solid #217c70;
        }
        .shuru button{
            width: 80px;
            height: 35px;
            margin-top: 8px;
            margin-left: 5px;
            background-color: #217c70;
            border-radius: 5px;
            border: none;
            float:left;
        }
        .logo{
            float: left;
        }
        .logo a{
            display: block;
            width: 190px;
            height:60px;
        }
        .logo a img{
            width: 190px;
            height:60px;
        }
    </style>
</head>

<body>
<header>
    <div class="header_top">
        <div class="wrap">
            <div class="logo">
                <%--<a href="/shiduPage">--%>
                    <%--<img src="/static/images/logo.a180d.png" />--%>
                <%--</a>--%>
            </div>
            <div class="shuru">
                <input type="text" id="inp" >
                <button>搜索</button>
            </div>
            <div class="right">
                <a href="/loginPage" class="login">登录</a>
            </div>
        </div>
    </div>
    <div class="header_bottom">
        <div class="wrap1">
            <ul class="middle">
                <li id="first"><a href="#">全部分类</a></li>
                <li><a href="#">排行榜</a></li>
                <li><a href="#">免费</a></li>
                <li><a href="#">玄幻仙侠</a></li>
                <li><a href="#">轻小说</a></li>
                <li><a href="#">古代</a></li>
                <li><a href="#">现言</a></li>
                <li><a href="#">完本</a></li>
                <li><a href="#">青春</a></li>
            </ul>
        </div>
    </div>

</header>
<section>

    <div class="zhanweifu"></div>
    <div class="tuijian">
        <div class="tuijian_top">
            <h3>编辑强推</h3>
        </div>
        <div class="context">
            <ul class="neirong">
                <li>
                    <div class="tupian"><a href="/novelPage"><img src="/static/images/4.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>婚途脉脉</h5>
                        <p>宁城人尽皆知,秦家独子秦遇时生性凉薄,不近女色。</p>
                        <p>帝业</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="/novelPage"><img src="/static/images/90.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>他来时有星光</h5>
                        <p>冷艳毒舌女明星VS铁血硬汉男警察每个人都有自己的罪</p>
                        <p>北风未眠</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/90%20(1).jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>你如星辰入梦来</h5>
                        <p>他是风头正盛的顶级偶像;她是初出茅庐的小透明编</p>
                        <p>小心</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/90.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>他来时有星光</h5>
                        <p>冷艳毒舌女明星VS铁血硬汉男警察每个人都有自己的罪</p>
                        <p>北风未眠</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/2.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>他的小九九</h5>
                        <p>我的身体里流淌着罪恶的鲜血,可我的灵魂却永远向往</p>
                        <p>雨果果</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/3.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>空降男神</h5>
                        <p>陆总不过是遛遛狗,竟然被小奶包缠上了,还诱来了国</p>
                        <p>19</p>
                    </div>
                </li>


            </ul>
        </div>
    </div>
    <div class="tuijian">
        <div class="tuijian_top">
            <h3>人气完本</h3>
        </div>
        <div class="context">
            <ul class="neirong">
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/5.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>原来你暗恋我啊</h5>
                        <p>四岁的陆西泽见到刚出生的楚瑶,嫌弃:“真丑。”</p>
                        <p>小飞</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/6.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>卦妃天下</h5>
                        <p>本文已由悦读纪出版,出版名《盛世繁华为君倾》,当</p>
                        <p>烟花</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/7.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>来自星河的妖狐</h5>
                        <p>1V1强强联手,盛宠无双,顾酒,畅销女漫画家,</p>
                        <p>别离</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/8.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5锦鲤</h5>
                        <p>温乔穿越了,从末世穿越到现代,不仅如此,她的空间</p>
                        <p>北风</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/9.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>限时密爱</h5>
                        <p>(正文已结局,番外进行时)1v1双洁。他是北城最</p>
                        <p>小苏苏</p>
                    </div>
                </li>
                <li>
                    <div class="tupian"><a href="#"><img src="/static/images/10.jpg" alt=""></a></div>
                    <div class="wenzi">
                        <h5>皇妃</h5>
                        <p>穿来清朝,温馨基本上就绝望了!在这个清穿多如狗</p>
                        <p>未眠</p>
                    </div>
                </li>

            </ul>
        </div>
    </div>
</section>
<footer>
    <div class="last">
        <ul>
            <li><a href="#">关于我们</a></li>
            <li><a href="#">联系我们</a></li>
            <li><a href="#">帮助中心</a></li>
            <li><a href="#">客服中心</a></li>
            <li><a href="#">加入我们</a></li>
            <li><a href="#">作家专区</a></li>
            <li><a href="#">动漫频道</a></li>
            <li><a href="#">游戏专区</a></li>
        </ul>
    </div>
</footer>
</body>

</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值