python222网站实战(SpringBoot+SpringSecurity+MybatisPlus+thymeleaf+layui)-帖子详情页实现

锋哥原创的Springboot+Layui python222网站实战:

python222网站实战课程视频教程(SpringBoot+Python爬虫实战) ( 火爆连载更新中... )_哔哩哔哩_bilibilipython222网站实战课程视频教程(SpringBoot+Python爬虫实战) ( 火爆连载更新中... )共计23条视频,包括:python222网站实战课程视频教程(SpringBoot+Python爬虫实战) ( 火爆连载更新中... )、第2讲 架构搭建实现、第3讲 页面系统属性动态化设计实现等,UP主更多精彩视频,请关注UP账号。icon-default.png?t=N7T8https://www.bilibili.com/video/BV1yX4y1a7qM/后端:

/**
 * 根据id查询帖子详细信息
 * @param id
 * @return
 * @throws Exception
 */
@RequestMapping("/{id}")
public ModelAndView view(@PathVariable("id")Integer id)throws Exception{
    Article article = articleService.getById(id);
    if(article!=null && article.getStatus()!=2){
        return null;
    }else{
        ModelAndView mav=new ModelAndView();
        mav.setViewName("article");
        mav.addObject("article",article);
        return mav;
    }
}

前端article.html

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title th:text="${article.title}+'-'+${application.propertyMap['k1']}"></title>
<meta name="keywords" th:content="${article.keyWords}">
<meta name="description" th:content="${article.title}">
<link href="/systemImages/favicon.ico" rel="SHORTCUT ICON">
<link rel="stylesheet" href="/static/layui/css/layui.css"/>
<link rel="stylesheet" href="/static/css/css.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/normalize.css" />
<link rel="stylesheet" href="/static/css/font-awesome.min.css">

</head>
<body>

    <div class="header_top" th:include="common/head::#h" />

    <div class="header" th:include="common/menu::#m" />

    <div class="main_wrapper">
        <div class="w1220 index_content">
            <div class="content_left">
                <div class="article">
                    <div class="title" th:text="${article.title}"></div>
                    <div class="publishDateAndDownload">
                        <div class="publishDate" th:text="${'发布于:'+#dates.format(article.publishDate, 'yyyy-MM-dd HH:mm:ss')}"></div>
                    </div>
                    <div class="content" th:utext="${article.content}"></div>
                    <div class="downloadContent" th:if="${!article.download}" th:text="${'转载自:'+article.downloadContent}"></div>
                </div>
            </div>

            <div class="content_right">
                <div class="card">
                    <h4 class="card_title">热门帖子推荐</h4>
                    <ul class="item_list">
                        <li th:each="hotArticle,status:${application.hotArticleList.subList(0,10)}"><span class="number" th:text="${status.index+1}+'.'"></span><a th:href="'/article/'+${hotArticle.id}" target="_blank"  th:title="${hotArticle.title}" th:text="${hotArticle.title}"></a></li>
                    </ul>
                </div>


                <div class="tag">
                    <h4 class="tag_title">热门标签推荐</h4>
                    <ul class="item_list">
                        <li th:each="tag:${application.tagList}">
                            <a th:href="@{'/search/1?keyWord='+${tag.name}}" target="_blank"><button type="button" class="layui-btn layui-btn-sm" th:text="${tag.name}"></button></a>
                        </li>
                    </ul>
                </div>
            </div>



        </div>
    </div>


    <div class="footer" th:include="common/footer::#f" />


</body>
</html>

最近更新

  1. TCP协议是安全的吗?

    2024-01-21 11:42:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-21 11:42:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-21 11:42:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-21 11:42:03       18 阅读

热门阅读

  1. 在Mac终端命令行中允许下载的应用程序运行

    2024-01-21 11:42:03       36 阅读
  2. vue+elenemt分页+springboot

    2024-01-21 11:42:03       22 阅读
  3. XSS语句

    2024-01-21 11:42:03       26 阅读
  4. 自然语言处理的就业前景

    2024-01-21 11:42:03       31 阅读
  5. 开发安全之:Cross-Site Scripting: Poor Validation

    2024-01-21 11:42:03       28 阅读
  6. 力扣labuladong一刷day63天单词拆分

    2024-01-21 11:42:03       38 阅读