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/t_article建表sql

create table `t_article` (
	`id` int (11),
	`title` varchar (600),
	`summary` varchar (1500),
	`content` longtext ,
	`publish_date` datetime ,
	`status` int (11),
	`download_content` varchar (15000),
	`download_btn_content` varchar (300),
	`key_words` varchar (3000),
	`hot` bit (1),
	`hot_date` datetime ,
	`download` bit (1)
); 

导入数据;

获取一页热门数据:

application.setAttribute("hotArticleList",articleService.page(new Page<>(1,20),new QueryWrapper<Article>().eq("hot",true).orderByDesc("hot_date")).getRecords());

index.html

<div class="main_wrapper">
    <div class="w1220 index_content">
        <div class="content_left">
            左侧
        </div>

        <div class="content_right">
            <div class="card">
                <h4 class="card_title">热门帖子推荐</h4>
                <ul class="item_list">
                    <li th:each="hotArticle,status:${application.hotArticleList}"><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>
    </div>
</div>