parent
74e514ee80
commit
2749754eb0
17 changed files with 489 additions and 622 deletions
@ -0,0 +1,39 @@ |
||||
package cc.bnblogs.common; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.LinkedHashSet; |
||||
import java.util.List; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* @author zfp@bnblogs.cc |
||||
* @createTime: 2022/10/21 |
||||
*/ |
||||
public class LRUCache { |
||||
|
||||
// 使用hashSet
|
||||
private final Set<String> cache = new LinkedHashSet<>(); |
||||
|
||||
// 最大缓存数量
|
||||
private final int limit; |
||||
|
||||
public LRUCache(int limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public int size() { |
||||
return cache.size(); |
||||
} |
||||
|
||||
public List<String> list() { |
||||
return new ArrayList<>(cache); |
||||
} |
||||
|
||||
public void add(String keyword) { |
||||
while (cache.size() >= limit) { |
||||
cache.remove(cache.stream().findFirst().orElse(null)); |
||||
} |
||||
cache.remove(keyword); |
||||
cache.add(keyword); |
||||
} |
||||
} |
@ -1,289 +1,113 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<title>Title</title> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
||||
<!-- 最新版本的 Bootstrap 核心 CSS 文件 --> |
||||
<link rel="stylesheet" href="/static/plugin/bootstrap/css/bootstrap.min.css"> |
||||
<!-- 可选的 Bootstrap 主题文件(一般不用引入) --> |
||||
<link rel="stylesheet" href="/static/plugin/bootstrap/css/bootstrap-theme.min.css"> |
||||
<link rel="stylesheet" href="/static/plugin/font-awesome/css/font-awesome.min.css"> |
||||
<!-- 自定义css文件 --> |
||||
<link rel="stylesheet" href="/static/css/style.css"> |
||||
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html" lang="en"> |
||||
<head th:replace="common::header(~{::title},~{},~{})"> |
||||
<title th:text="${'分类云' + ' - ' + @webSite.title}"></title> |
||||
</head> |
||||
<body> |
||||
<nav class="lw-md-show"> |
||||
<div class="lw-container lw-header lw-posr "> |
||||
<div class="lw-logo lw-fl"> |
||||
<a href="/"> |
||||
<img src="/static/image/logo.png" alt="冷文的个人博客"> |
||||
</a> |
||||
</div> |
||||
<span>让崇拜从这里开始,用代码做点好玩的事件,让每一天都变的充实起来!</span> |
||||
<div class="lw-fr lw-linkme"> |
||||
<a href="#"><i class="fa fa-qq" aria-hidden="true"></i></a> |
||||
<a href="#"><i class="fa fa-wechat" aria-hidden="true"></i></a> |
||||
<a href="#"><i class="fa fa-weibo" aria-hidden="true"></i></a> |
||||
<a href="#"><i class="fa fa-envelope" aria-hidden="true"></i></a> |
||||
</div> |
||||
<div class="lw-nav lw-posa"> |
||||
<a href="/"><i class="fa fa-home" aria-hidden="true"></i>首页</a> |
||||
<a href="#">技术分享</a> |
||||
<a href="#">闲言碎语</a> |
||||
<a href="#">个人随笔</a> |
||||
<a href="#"><i class="fa fa-users" aria-hidden="true"></i>友情链接</a> |
||||
<a href="#"><i class="fa fa-user" aria-hidden="true"></i>关于我</a> |
||||
<a href="#"><i class="fa fa-edit" aria-hidden="true"></i>留言板</a> |
||||
<a href="javascript:void(0)" class="lw-fr lw-search-btn" style="padding: 0;"> |
||||
<i class="fa fa-search" aria-hidden="true"></i> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
</nav> |
||||
<div class="lw-md-hidden lw-phone-header"> |
||||
<a href="javascript:void(0)" class="lw-posa lw-phone-topbtn lw-search-show lw-search-btn"><i |
||||
class="fa fa-search"></i></a> |
||||
<a class="lw-index" href="/"><h1>冷文学习者</h1></a> |
||||
</div> |
||||
<div class="lw-md-hidden" style="height: 100px;"></div> |
||||
<th:block th:include="common::nav"></th:block> |
||||
|
||||
|
||||
<div class="lw-container lw-main lw-posr"> |
||||
<div class="lw-left-list"> |
||||
<ol class="breadcrumb lw-crumb"> |
||||
<li><a href="/">首页</a></li> |
||||
<li class="active">分类大全</li> |
||||
<li class="active">分类云</li> |
||||
</ol> |
||||
<ul class="lw-category-list"> |
||||
<li> |
||||
<a href=""><i class="fa fa-folder lw-mr5"></i>emlog相关 <span>(Total 5 Articles)</span></a> |
||||
<p>与emlog相关的主题及插件,也有少部分相关教程...</p> |
||||
<p class="lw-category-update">最后更新: 2021-12-20</p> |
||||
</li> |
||||
<li> |
||||
<a href=""><i class="fa fa-folder lw-mr5"></i>typecho相关 <span>(Total 5 Articles)</span></a> |
||||
<p>与typecho相关的主题及插件,同时也有不少我自己在用typecho时的心得以及技巧...</p> |
||||
<p class="lw-category-update">最后更新: 2021-12-20</p> |
||||
</li> |
||||
<li> |
||||
<a href=""><i class="fa fa-folder lw-mr5"></i> 网站相关 <span>(Total 5 Articles)</span></a> |
||||
<p>有一些网站源码和建站技巧,也有一些前端相关的知识,博主也还有学习中...</p> |
||||
<p class="lw-category-update">最后更新: 2021-12-20</p> |
||||
</li> |
||||
<li> |
||||
<a href=""><i class="fa fa-folder lw-mr5"></i> Linux学习 <span>(Total 5 Articles)</span></a> |
||||
<p>Linux常用命令的学习笔记,也有一些开发生产环境的搭建...</p> |
||||
<p class="lw-category-update">最后更新: 2021-12-20</p> |
||||
</li> |
||||
<li> |
||||
<a href=""><i class="fa fa-folder lw-mr5"></i> Mac相关 <span>(Total 5 Articles)</span></a> |
||||
<p>因为大部分情况下我用的都是MacBook,所有在使用Mac方面有不少的心得体会...</p> |
||||
<p class="lw-category-update">最后更新: 2021-12-20</p> |
||||
</li> |
||||
<li> |
||||
<a href=""><i class="fa fa-folder lw-mr5"></i> Freewind相关 <span>(Total 5 Articles)</span></a> |
||||
<p>这里就有我一直维护的typecho主题Freewind啦,里面有每次更新的内容及功能介绍、下载地址...</p> |
||||
<p class="lw-category-update">最后更新: 2021-12-20</p> |
||||
</li> |
||||
<li> |
||||
<a href=""><i class="fa fa-folder lw-mr5"></i> 个人随笔 <span>(Total 5 Articles)</span></a> |
||||
<p>除了写技术贴当然也要写一些文章记录一下心情和日常...</p> |
||||
<p class="lw-category-update">最后更新: 2021-12-20</p> |
||||
<li th:each="category:${categories}"> |
||||
<a th:href="@{/category/{id}.html(id=${category.id})}"> |
||||
<i class="fa fa-folder lw-mr5"></i><th:block th:text="${category.name}"></th:block> |
||||
<span style="color: #de2424">(共<th:block th:text="${category.getArticleCount()}"></th:block>篇文章)</span> |
||||
</a> |
||||
<p style="font-size: 16px;font-weight: bold;color:black" th:text="${category.summary}"></p> |
||||
<p class="lw-category-update">最后更新: |
||||
<th:block th:text="${#dates.format(category.getLastUpdated(),'yyyy-MM-dd')}"> |
||||
</th:block> |
||||
</p> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="lw-right-list lw-md-show lw-posa"> |
||||
<th:block th:fragment="right"> |
||||
<div class="lw-right-item lw-profile"> |
||||
<div class="lw-avatar-content lw-posr" |
||||
style="background-image:url(/static/image/5-120601094K3-50.gif);"> |
||||
<div class="lw-avatar lw-posa"> |
||||
<img src="/static/image/avatar.jpeg" alt=""> |
||||
<img th:src="${@webSite.avatar}" src="/static/image/avatar.jpeg" alt=""> |
||||
</div> |
||||
</div> |
||||
<ul class="lw-info"> |
||||
<li><span>博主</span>Mr丶冷文</li> |
||||
<li><span>坐标</span>北京 昌平</li> |
||||
<li><span>标签</span>Java、Web设计、Python、大数据、爬虫</li> |
||||
<li><span>博主</span> |
||||
<th:block th:text="${@webSite.nickname}"></th:block> |
||||
</li> |
||||
<li><span>坐标</span> |
||||
<th:block th:text="${T(java.lang.String).join(' ',@webSite.address)}"></th:block> |
||||
</li> |
||||
<li><span>标签</span> |
||||
<th:block th:text="${T(java.lang.String).join('、',@webSite.tags)}"></th:block> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="lw-right-item lw-right-hot"> |
||||
<h4><i class="fa fa-fire lw-mr5" aria-hidden="true"></i>热门文章</h4> |
||||
<ul class="lw-hot-list"> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="lw-hot-img"> |
||||
<span class="label label-danger lw-posa">1</span> |
||||
<img src="/static/image/1.jpg" alt=""> |
||||
</div> |
||||
<p class="lw-hot-title">Freewind主题编辑器展示</p> |
||||
<p class="lw-hot-info"><i class="fa-solid fa-fire-flame-curved"></i> 65580 </p> |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<!--/*@thymesVar id="hots" type="java.util.List<cc.bnblogs.pojo.Article>"*/--> |
||||
<li th:each="hot,it:${hots}"> |
||||
<a th:href="@{/{id}.html(id=${hot.id})}" target="_blank"> |
||||
<div class="lw-hot-img"> |
||||
<span class="label label-warning lw-posa">2</span> |
||||
<img src="/static/image/2.jpg" alt=""> |
||||
</div> |
||||
<p class="lw-hot-title">Conda虚拟环境使用</p> |
||||
<p class="lw-hot-info"><i class="fa-solid fa-fire-flame-curved"></i> 56283 </p> |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="lw-hot-img"> |
||||
<span class="label label-info lw-posa">3</span> |
||||
<img src="/static/image/3.jpg" alt=""> |
||||
</div> |
||||
<p class="lw-hot-title">纯 CSS 图片碎裂动画教程</p> |
||||
<p class="lw-hot-info"><i class="fa-solid fa-fire-flame-curved"></i> 52213 </p> |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="lw-hot-img"> |
||||
<span class="label label-default lw-posa">4</span> |
||||
<img src="/static/image/4.jpg" alt=""> |
||||
</div> |
||||
<p class="lw-hot-title">Spring Boot 3.0 M1 发布</p> |
||||
<p class="lw-hot-info"><i class="fa-solid fa-fire-flame-curved"></i> 23132 </p> |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="lw-hot-img"> |
||||
<span class="label label-default lw-posa">5</span> |
||||
<img src="/static/image/5.jpg" alt=""> |
||||
</div> |
||||
<p class="lw-hot-title">异步上传文件显示进度条</p> |
||||
<p class="lw-hot-info"><i class="fa-solid fa-fire-flame-curved"></i> 12322 </p> |
||||
<span class="label label-danger lw-posa" th:if="${it.index eq 0}">1</span> |
||||
<span class="label label-warning lw-posa" th:if="${it.index eq 1}">2</span> |
||||
<span class="label label-info lw-posa" th:if="${it.index eq 2}">3</span> |
||||
<span class="label label-default lw-posa" th:if="${it.index > 2}" th:text="${it.index+1}"></span> |
||||
<img th:src="${@defaultImages.cover(hot.cover)}" alt=""> |
||||
</div> |
||||
<p class="lw-hot-title" th:text="${hot.title}"></p> |
||||
<p class="lw-hot-info"><i class="fa fa-eye lw-mr5"></i> |
||||
<th:block th:text="${hot.views}"></th:block> |
||||
</p> |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="lw-right-item lw-tag-cloud"> |
||||
<h4><i class="fa fa-tags lw-mr5" aria-hidden="true"></i>标签云</h4> |
||||
|
||||
<a href="https://www.kevinlu98.cn/tag/freewind/" title="freewind"> |
||||
freewind</a> |
||||
<a href="https://www.kevinlu98.cn/tag/typecho/" title="typecho"> |
||||
typecho</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E6%8F%92%E4%BB%B6/" title="插件"> |
||||
插件</a> |
||||
<a href="https://www.kevinlu98.cn/tag/emlog/" title="emlog"> |
||||
emlog</a> |
||||
<a href="https://www.kevinlu98.cn/tag/java/" title="java"> |
||||
java</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E4%B8%BB%E9%A2%98/" title="主题"> |
||||
主题</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E8%87%AA%E7%94%B1%E4%B9%8B%E9%A3%8E/" title="自由之风"> |
||||
自由之风</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E5%9B%BE%E5%BA%8A/" title="图床"> |
||||
图床</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E5%86%B7%E6%96%87%E5%9B%BE%E5%BA%8A/" title="冷文图床"> |
||||
冷文图床</a> |
||||
<a href="https://www.kevinlu98.cn/tag/markdown/" title="markdown"> |
||||
markdown</a> |
||||
<a href="https://www.kevinlu98.cn/tag/gitee/" title="gitee"> |
||||
gitee</a> |
||||
<a href="https://www.kevinlu98.cn/tag/springboot/" title="springboot"> |
||||
springboot</a> |
||||
<a href="https://www.kevinlu98.cn/tag/linux/" title="linux"> |
||||
linux</a> |
||||
<a href="https://www.kevinlu98.cn/tag/mac/" title="mac"> |
||||
mac</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E5%AD%A6%E4%B9%A0/" title="学习"> |
||||
学习</a> |
||||
<a href="https://www.kevinlu98.cn/tag/python/" title="python"> |
||||
python</a> |
||||
<a href="https://www.kevinlu98.cn/tag/conda/" title="conda"> |
||||
conda</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E7%9B%B8%E5%86%8C/" title="相册"> |
||||
相册</a> |
||||
<a href="https://www.kevinlu98.cn/tag/jsDelivr/" title="jsDelivr"> |
||||
jsDelivr</a> |
||||
<a href="https://www.kevinlu98.cn/tag/cdn/" title="cdn"> |
||||
cdn</a> |
||||
<a href="https://www.kevinlu98.cn/tag/codemirror/" title="codemirror"> |
||||
codemirror</a> |
||||
<a href="https://www.kevinlu98.cn/tag/freedom/" title="freedom"> |
||||
freedom</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E8%85%BE%E8%AE%AFcos/" title="腾讯cos"> |
||||
腾讯cos</a> |
||||
<a href="https://www.kevinlu98.cn/tag/cos/" title="cos"> |
||||
cos</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E7%A7%81%E4%BA%BA%E5%9B%BE%E5%BA%8A/" title="私人图床"> |
||||
私人图床</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E6%AC%A2%E8%BF%8E%E9%A1%B5/" title="欢迎页"> |
||||
欢迎页</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E7%99%BB%E5%BD%95%E6%B3%A8%E5%86%8C/" title="登录注册"> |
||||
登录注册</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E6%95%99%E7%A8%8B%E4%B8%8B%E8%BD%BD/" title="教程下载"> |
||||
教程下载</a> |
||||
<a href="https://www.kevinlu98.cn/tag/itjc8/" title="itjc8"> |
||||
itjc8</a> |
||||
<a href="https://www.kevinlu98.cn/tag/%E8%99%9A%E6%8B%9F%E6%9C%BA/" title="虚拟机"> |
||||
虚拟机</a> |
||||
|
||||
<!--/*@thymesVar id="tags" type="java.util.List<cc.bnblogs.pojo.Tag>"*/--> |
||||
<a th:each="tag:${tags}" th:href="@{/tag/{id}.html(id=${tag.id})}" th:title="${tag.name}" th:text="${tag.name}"></a> |
||||
</div> |
||||
</th:block> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="lw-friend-link"> |
||||
<th:block th:fragment="footer"> |
||||
<div class="lw-friend-link"> |
||||
<div class="lw-container"> |
||||
<h2>友情链接</h2> |
||||
<a href="">冷文学习者</a> |
||||
<a href="">冷文博客</a> |
||||
<a href="">冷文聊编程</a> |
||||
<a href="">GetHub</a> |
||||
<a href="">CSDN</a> |
||||
<a href="">百度一下</a> |
||||
<a href="">新浪微博</a> |
||||
<a href="">谷歌搜索</a> |
||||
<a href="">知乎</a> |
||||
<a href="">掘金</a> |
||||
<!--/*@thymesVar id="friends" type="java.util.List<cc.bnblogs.pojo.Friends>"*/--> |
||||
<a th:each="friend:${friends}" target="_blank" th:href="${friend.link}" th:text="${friend.title}"></a> |
||||
</div> |
||||
</div> |
||||
|
||||
<footer> |
||||
<p>冷文学习者 版权所有 <span class="lw-mr5"></span>Copyright © www.kevinlu98.cn All Rights Reserved.</p> |
||||
<p>备案号:陕ICP备19024566-1号 京公网安备 11011402012109号</p> |
||||
</footer> |
||||
|
||||
<div class="lw-mask" id="lw-search-box"> |
||||
</div> |
||||
<footer th:utext="${@webSite.footer}"></footer> |
||||
<div class="lw-mask" id="lw-search-box"> |
||||
<div class="lw-search-conetnt"> |
||||
<a href="javascript:void(0)" class="lw-search-close lw-posa"><i class="fa fa-close"></i></a> |
||||
<div class="lw-search-input lw-posr"> |
||||
<form action="" method="post"> |
||||
<input type="text" placeholder="请输入搜索关键字..."> |
||||
<form th:action="@{/search.html}" method="get"> |
||||
<input type="text" required name="keyword" placeholder="请输入搜索关键字..."> |
||||
<button class="lw-posa"><i class="fa fa-search lw-mr5"></i>搜索</button> |
||||
</form> |
||||
</div> |
||||
<p>推荐关键字: |
||||
<a href="javascript:void (0)">独立下载</a> |
||||
<a href="javascript:void (0)">评论通知</a> |
||||
<a href="javascript:void (0)">点赞</a> |
||||
<a href="javascript:void (0)">非插件</a> |
||||
<a href="javascript:void (0)">tp5</a> |
||||
<a href="javascript:void (0)">ajax</a> |
||||
<a href="javascript:void (0)">json</a> |
||||
<a href="javascript:void (0)">IO模型</a> |
||||
<a href="javascript:void (0)">跨域</a> |
||||
<a href="javascript:void (0)">javascript</a> |
||||
<a href="javascript:void (0)">springboot</a> |
||||
<a href="javascript:void (0)">视频剪辑</a> |
||||
<a href="javascript:void (0)">后期</a> |
||||
<a href="javascript:void (0)">个人随笔</a> |
||||
<a class="lw-mr5" th:each="keyword:${keywords}" th:href="@{/search.html(keyword=${keyword})}" |
||||
th:text="${keyword}" th:title="${keyword}"></a> |
||||
</p> |
||||
</div> |
||||
</div> |
||||
|
||||
<script src="/static/plugin/jquery/jquery-3.5.1.min.js"></script> |
||||
<!-- 最新的 Bootstrap 核心 JavaScript 文件 --> |
||||
<script src="/static/plugin/bootstrap/js/bootstrap.min.js"></script> |
||||
<script src="/static/js/main.js"></script> |
||||
</div> |
||||
<script src="/static/plugin/jquery/jquery-3.5.1.min.js"></script> |
||||
<!-- 最新的 Bootstrap 核心 JavaScript 文件 --> |
||||
<script src="/static/plugin/bootstrap/js/bootstrap.min.js"></script> |
||||
<script src="/static/plugin/swiper-bundle/swiper-bundle.min.js"></script> |
||||
<script src="/static/js/main.js"></script> |
||||
</th:block> |
||||
</body> |
||||
</html> |
Loading…
Reference in new issue