diff --git a/README.md b/README.md index fbc657f..3dc386e 100644 --- a/README.md +++ b/README.md @@ -27,28 +27,29 @@ Kyrie Blog是由SpringBoot1.5 + MyBatis + Thymeleaf等技术实现的个人网 ### 预览效果 #### 前端效果 -![index](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/index.png) +![index](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/index.png) -![archives](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/archives.png) +![archives](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/archives.png) -![detail](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/detail.png) +![detail](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/detail.png) -![category](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/category.png) +![category](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/category.png) -![about](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/about.png) +![about](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/about.png) #### 后端效果 -![adminlogin](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/adminlogin.png) -![adminindex](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/adminindex.png) +![adminlogin](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/adminlogin.png) -![articlepublish](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/articlepublish.png) +![adminindex](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/adminindex.png) -![articlemanager](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/articlemanager.png) +![articlepublish](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/articlepublish.png) -![filemanager](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/filemanager.png) +![articlemanager](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/articlemanager.png) -![setting](http://caozongpeng.oss-cn-shenzhen.aliyuncs.com/image/blog/setting.png) +![filemanager](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/filemanager.png) + +![setting](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/setting.png) ### 安装 下载源码,执行sql文件,然后修改application-dev.yml文件中连接数据库的用户名、密码。运行项目即可。 @@ -57,5 +58,10 @@ Kyrie Blog是由SpringBoot1.5 + MyBatis + Thymeleaf等技术实现的个人网 后台访问地址:http://localhost:8888/admin 用户名:admin 密码:123456 -### 更新日志 -2018年08月04日发布第一个版本 +### 交流群 +#### 欢迎加入:1103081979 +![setting](https://github.com/caozongpeng/github-static/blob/master/springBootBlog/study.png) + +### 如果此博客能帮助到你,请作者喝杯咖啡吧或者建设演示服务器 +![wacht](https://github.com/caozongpeng/github-static/blob/master/money/wacht.jpg) +![alipay](https://github.com/caozongpeng/github-static/blob/master/money/alipay.jpg) diff --git a/pom.xml b/pom.xml index e13c25a..4420f6f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,18 +4,17 @@ 4.0.0 com.wip - my-blog - 0.0.1-SNAPSHOT + springboot-blog + 1.0.0-SNAPSHOT jar - my-blog - Demo project for Spring Boot + springboot-blog + Spring Boot Blog org.springframework.boot spring-boot-starter-parent 1.5.14.RELEASE - @@ -50,12 +49,6 @@ spring-boot-starter-aop - - org.springframework.boot - spring-boot-starter-test - test - - org.springframework.boot @@ -73,24 +66,6 @@ commons-lang3 3.4 - - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - - - com.fasterxml.jackson.module - jackson-module-parameter-names - - com.github.pagehelper @@ -129,19 +104,6 @@ 1.9.22 - - - com.qcloud - cos_api - 5.2.4 - - - - com.google.code.gson - gson - 2.8.0 - - com.atlassian.commonmark @@ -162,13 +124,6 @@ 7.2.11 - - - - - - - javax.servlet javax.servlet-api @@ -197,9 +152,5 @@ - - blog - - diff --git a/src/main/java/com/wip/MyBlogApplication.java b/src/main/java/com/wip/MyBlogApplication.java index 9913371..1a0efe7 100644 --- a/src/main/java/com/wip/MyBlogApplication.java +++ b/src/main/java/com/wip/MyBlogApplication.java @@ -3,7 +3,6 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.annotation.EnableCaching; @SpringBootApplication @MapperScan("com.wip.dao") diff --git a/src/main/java/com/wip/api/QiNiuCloudService.java b/src/main/java/com/wip/api/QiNiuCloudService.java index 5552864..ec4d6c2 100644 --- a/src/main/java/com/wip/api/QiNiuCloudService.java +++ b/src/main/java/com/wip/api/QiNiuCloudService.java @@ -13,6 +13,8 @@ import com.qiniu.storage.UploadManager; import com.qiniu.storage.model.DefaultPutRet; import com.qiniu.util.Auth; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; @@ -22,6 +24,10 @@ */ public class QiNiuCloudService { + private QiNiuCloudService(){} + + private static final Logger LOGGER = LoggerFactory.getLogger(QiNiuCloudService.class); + /** * 密钥凭证 */ @@ -44,7 +50,6 @@ public class QiNiuCloudService { * @return */ public static String upload(MultipartFile file, String fileName) { - // 构造一个带指定Zone对象的配置类 // 华东 Zone.zone0() // 华北 Zone.zone1() @@ -53,30 +58,27 @@ public static String upload(MultipartFile file, String fileName) { Configuration cfg = new Configuration(Zone.zone2()); // 其它参数参考类注释 UploadManager uploadManager = new UploadManager(cfg); - // 默认不指定key的情况下,以文件内容的hash值作为文件名 - String key = null; Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY); String upToken = auth.uploadToken(BUCKET); try { Response response = null; response = uploadManager.put(file.getInputStream(), fileName, upToken,null,null); - // 解析上传成功的结果 DefaultPutRet putRet = new Gson().fromJson(response.bodyString(),DefaultPutRet.class); - System.out.println(putRet.key); - System.out.println(putRet.hash); + LOGGER.info(putRet.key); + LOGGER.info(putRet.hash); return putRet.key; } catch (QiniuException ex) { Response r = ex.response; - System.out.println(r.toString()); + LOGGER.error(r.toString()); try { - System.out.println(r.bodyString()); + LOGGER.error(r.bodyString()); } catch (QiniuException ex2) { - + LOGGER.error(ex2.error()); } } catch (IOException e) { - e.printStackTrace(); + LOGGER.error(e.getMessage()); } return null; } diff --git a/src/main/java/com/wip/constant/Types.java b/src/main/java/com/wip/constant/Types.java index 85d13a3..3ac94c5 100644 --- a/src/main/java/com/wip/constant/Types.java +++ b/src/main/java/com/wip/constant/Types.java @@ -1,7 +1,5 @@ package com.wip.constant; -import com.wip.model.ContentDomain; - /** * Created by IntelliJ IDEA. * User: Kyrie diff --git a/src/main/java/com/wip/constant/WebConst.java b/src/main/java/com/wip/constant/WebConst.java index 02d3762..84b9fb9 100644 --- a/src/main/java/com/wip/constant/WebConst.java +++ b/src/main/java/com/wip/constant/WebConst.java @@ -11,6 +11,8 @@ @Component public class WebConst { + private WebConst() {} + /** * 一些网站配置 diff --git a/src/main/java/com/wip/controller/BaseController.java b/src/main/java/com/wip/controller/BaseController.java index dd6e7ff..f4b96d4 100644 --- a/src/main/java/com/wip/controller/BaseController.java +++ b/src/main/java/com/wip/controller/BaseController.java @@ -42,15 +42,10 @@ public Integer getUid(HttpServletRequest request) { * @return String */ public String join(String[] arr) { - StringBuffer buffer = new StringBuffer(); - String[] temp = arr; - int length = arr.length; - - for (int i = 0; i < length; i++) { - String item = temp[i]; + StringBuilder buffer = new StringBuilder(); + for (String item : arr) { buffer.append(",").append(item); } - return buffer.length()> 0 ? buffer.substring(1) : buffer.toString(); } diff --git a/src/main/java/com/wip/controller/HomeController.java b/src/main/java/com/wip/controller/HomeController.java index cc4bc38..680d97c 100644 --- a/src/main/java/com/wip/controller/HomeController.java +++ b/src/main/java/com/wip/controller/HomeController.java @@ -6,9 +6,7 @@ import com.wip.constant.Types; import com.wip.constant.WebConst; import com.wip.dto.MetaDto; -import com.wip.dto.StatisticsDto; import com.wip.dto.cond.ContentCond; -import com.wip.dto.cond.MetaCond; import com.wip.exception.BusinessException; import com.wip.model.CommentDomain; import com.wip.model.ContentDomain; @@ -16,7 +14,6 @@ import com.wip.service.article.ContentService; import com.wip.service.comment.CommentService; import com.wip.service.meta.MetaService; -import com.wip.service.site.SiteService; import com.wip.utils.APIResponse; import com.wip.utils.IPKit; import com.wip.utils.TaleUtils; @@ -31,7 +28,6 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import java.net.URLEncoder; import java.util.List; @@ -194,15 +190,15 @@ public APIResponse comment(HttpServletRequest request, HttpServletResponse respo @RequestParam(name = "email", required = false) String email, @RequestParam(name = "url", required = false) String url, @RequestParam(name = "content", required = true) String content, - @RequestParam(name = "csrf_token", required = true) String csrf_token + @RequestParam(name = "csrf_token", required = true) String csrfToken ) { String ref = request.getHeader("Referer"); - if (StringUtils.isBlank(ref) || StringUtils.isBlank(csrf_token)){ + if (StringUtils.isBlank(ref) || StringUtils.isBlank(csrfToken)){ return APIResponse.fail("访问失败"); } - String token = cache.hget(Types.CSRF_TOKEN.getType(), csrf_token); + String token = cache.hget(Types.CSRF_TOKEN.getType(), csrfToken); if (StringUtils.isBlank(token)) { return APIResponse.fail("访问失败"); } diff --git a/src/main/java/com/wip/controller/admin/ArticleController.java b/src/main/java/com/wip/controller/admin/ArticleController.java index ab13694..2c274c3 100644 --- a/src/main/java/com/wip/controller/admin/ArticleController.java +++ b/src/main/java/com/wip/controller/admin/ArticleController.java @@ -15,12 +15,9 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; - import javax.servlet.http.HttpServletRequest; import java.util.List; @@ -29,8 +26,6 @@ @RequestMapping("/admin/article") public class ArticleController extends BaseController { - private static final Logger LOGGER = LoggerFactory.getLogger(ArticleController.class); - @Autowired private MetaService metaService; @@ -130,7 +125,7 @@ public APIResponse modifyArticle( contentDomain.setStatus(status); contentDomain.setTags(tags); contentDomain.setCategories(categories); - contentDomain.setAllowComment(allowComment ? 1: 0); + contentDomain.setAllowComment(Boolean.TRUE.equals(allowComment) ? 1: 0); contentService.updateArticleById(contentDomain); return APIResponse.success(); @@ -181,7 +176,7 @@ public APIResponse publishArticle( // 只允许博客文章有分类,防止作品被收入分类 contentDomain.setTags(type.equals(Types.ARTICLE.getType()) ? tags : null); contentDomain.setCategories(type.equals(Types.ARTICLE.getType()) ? categories : null); - contentDomain.setAllowComment(allowComment ? 1 : 0); + contentDomain.setAllowComment(Boolean.TRUE.equals(allowComment) ? 1 : 0); // 添加文章 contentService.addArticle(contentDomain); diff --git a/src/main/java/com/wip/controller/admin/AttachController.java b/src/main/java/com/wip/controller/admin/AttachController.java index 9f70a63..5d58d85 100644 --- a/src/main/java/com/wip/controller/admin/AttachController.java +++ b/src/main/java/com/wip/controller/admin/AttachController.java @@ -19,13 +19,10 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @@ -36,8 +33,6 @@ @RequestMapping("admin/attach") public class AttachController extends BaseController { - private static final Logger LOGGER = LoggerFactory.getLogger(AttachController.class); - public static final String CLASSPATH = TaleUtils.getUploadFilePath(); @Autowired diff --git a/src/main/java/com/wip/controller/admin/AuthController.java b/src/main/java/com/wip/controller/admin/AuthController.java index cb4dbe6..40a095f 100644 --- a/src/main/java/com/wip/controller/admin/AuthController.java +++ b/src/main/java/com/wip/controller/admin/AuthController.java @@ -8,7 +8,6 @@ import com.wip.service.log.LogService; import com.wip.service.user.UserService; import com.wip.utils.APIResponse; -import com.wip.utils.GsonUtils; import com.wip.utils.TaleUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -61,29 +60,29 @@ public APIResponse toLogin( String password, @ApiParam(name = "remember_me", value = "记住我", required = false) @RequestParam(name = "remember_me", required = false) - String remember_me + String rememberMe ) { - Integer error_count = cache.get("login_error_count"); + Integer errorCount = cache.get("login_error_count"); try { // 调用Service登录方法 UserDomain userInfo = userService.login(username, password); // 设置用户信息session request.getSession().setAttribute(WebConst.LOGIN_SESSION_KEY, userInfo); // 判断是否勾选记住我 - if (StringUtils.isNotBlank(remember_me)) { + if (StringUtils.isNotBlank(rememberMe)) { TaleUtils.setCookie(response, userInfo.getUid()); } // 写入日志 logService.addLog(LogActions.LOGIN.getAction(), userInfo.getUsername()+"用户", request.getRemoteAddr(), userInfo.getUid()); } catch (Exception e) { LOGGER.error(e.getMessage()); - error_count = null == error_count ? 1 : error_count + 1; - if (error_count> 3) { + errorCount = null == errorCount ? 1 : errorCount + 1; + if (errorCount> 3) { return APIResponse.fail("您输入密码已经错误超过3次,请10分钟后尝试"); } - System.out.println(error_count); + LOGGER.error(String.valueOf(errorCount)); // 设置缓存为10分钟 - cache.set("login_error_count", error_count, 10 * 60); + cache.set("login_error_count", errorCount, 10L * 60); String msg = "登录失败"; if (e instanceof BusinessException) { msg = e.getMessage(); @@ -114,7 +113,4 @@ public void logout(HttpSession session, HttpServletRequest request, HttpServletR LOGGER.error("注销失败",e); } } - - - } diff --git a/src/main/java/com/wip/controller/admin/CategoryController.java b/src/main/java/com/wip/controller/admin/CategoryController.java index 31e7d38..04da40f 100644 --- a/src/main/java/com/wip/controller/admin/CategoryController.java +++ b/src/main/java/com/wip/controller/admin/CategoryController.java @@ -78,7 +78,6 @@ public APIResponse deleteCategory( try { metaService.deleteMetaById(mid); } catch (Exception e) { - e.printStackTrace(); LOGGER.error(e.getMessage()); return APIResponse.fail(e.getMessage()); } diff --git a/src/main/java/com/wip/controller/admin/CommentController.java b/src/main/java/com/wip/controller/admin/CommentController.java index 128905d..5be91c5 100644 --- a/src/main/java/com/wip/controller/admin/CommentController.java +++ b/src/main/java/com/wip/controller/admin/CommentController.java @@ -4,7 +4,6 @@ import com.wip.controller.BaseController; import com.wip.dto.cond.CommentCond; import com.wip.model.CommentDomain; -import com.wip.model.UserDomain; import com.wip.service.comment.CommentService; import com.wip.utils.APIResponse; import io.swagger.annotations.Api; @@ -15,8 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @Api("评论相关接口") @@ -41,7 +38,6 @@ public String index( HttpServletRequest request ) { - UserDomain user = this.user(request); PageInfo comments = commentService.getCommentsByCond(new CommentCond(), page, limit); request.setAttribute("comments", comments); return "admin/comment_list"; @@ -73,5 +69,27 @@ public APIResponse changeStatus( } return APIResponse.success(); } - + @ApiOperation("删除评论") + @PostMapping(value = "/delete") + @ResponseBody + public APIResponse deleteStatus( + HttpServletRequest request, + @ApiParam(name = "coid", value = "评论主键", required = true) + @RequestParam(name = "coid", required = true) + Integer coid + ) { + try { + CommentDomain comment = commentService.getCommentById(coid); + if (null != comment) { + commentService.deleteComment(coid); + } else { + return APIResponse.fail("通过失败"); + } + } catch (Exception e) { + e.printStackTrace(); + LOGGER.error(e.getMessage()); + return APIResponse.fail(e.getMessage()); + } + return APIResponse.success(); + } } diff --git a/src/main/java/com/wip/controller/admin/LinksController.java b/src/main/java/com/wip/controller/admin/LinksController.java index 41fc5c1..91e7e60 100644 --- a/src/main/java/com/wip/controller/admin/LinksController.java +++ b/src/main/java/com/wip/controller/admin/LinksController.java @@ -76,7 +76,7 @@ public APIResponse addLink( } } catch (Exception e) { - e.printStackTrace(); + LOGGER.error(e.getMessage()); throw BusinessException.withErrorCode(ErrorConstant.Meta.ADD_META_FAIL); } @@ -94,7 +94,7 @@ public APIResponse deleteLink( try { metaService.deleteMetaById(mid); } catch (Exception e) { - e.printStackTrace(); + LOGGER.error(e.getMessage()); throw BusinessException.withErrorCode(ErrorConstant.Meta.DELETE_META_FAIL); } diff --git a/src/main/java/com/wip/controller/admin/SettingController.java b/src/main/java/com/wip/controller/admin/SettingController.java index 9303d61..06ed6bd 100644 --- a/src/main/java/com/wip/controller/admin/SettingController.java +++ b/src/main/java/com/wip/controller/admin/SettingController.java @@ -43,9 +43,7 @@ public class SettingController extends BaseController { public String index(HttpServletRequest request) { List optionsList = optionService.getOptions(); Map options = new HashMap(); - optionsList.forEach((option) ->{ - options.put(option.getName(),option.getValue()); - }); + optionsList.forEach(option -> options.put(option.getName(),option.getValue())); request.setAttribute("options", options); return "admin/setting"; } @@ -54,25 +52,19 @@ public String index(HttpServletRequest request) { @PostMapping(value = "") @ResponseBody public APIResponse saveSetting(HttpServletRequest request) { - try { Map parameterMap = request.getParameterMap(); Map querys = new HashMap(); - parameterMap.forEach((key, value) -> { - //System.out.println(key + "------" + join(value)); - querys.put(key, join(value)); - }); - + parameterMap.forEach((key, value) -> querys.put(key, join(value))); optionService.saveOptions(querys); WebConst.initConfig = querys; - // 写入日志 logService.addLog(LogActions.SYS_SETTING.getAction(),GsonUtils.toJsonString(querys),request.getRemoteAddr(),this.getUid(request)); return APIResponse.success(); - } catch (Exception e) { String msg = "保存设置失败"; - return APIResponse.fail(e.getMessage()); + LOGGER.error(e.getMessage()); + return APIResponse.fail(msg); } } diff --git a/src/main/java/com/wip/exception/BusinessException.java b/src/main/java/com/wip/exception/BusinessException.java index cf1ec04..30e2537 100644 --- a/src/main/java/com/wip/exception/BusinessException.java +++ b/src/main/java/com/wip/exception/BusinessException.java @@ -48,7 +48,7 @@ public String getErrorCode() { } public String[] getErrorMessageArguments() { - return this.errorMessageArguments = errorMessageArguments; + return errorMessageArguments; } public BusinessException withErrorMessageArguments(String... errorMessageArguments) { diff --git a/src/main/java/com/wip/interceptor/BaseInterceptor.java b/src/main/java/com/wip/interceptor/BaseInterceptor.java index b098aad..71bcc73 100644 --- a/src/main/java/com/wip/interceptor/BaseInterceptor.java +++ b/src/main/java/com/wip/interceptor/BaseInterceptor.java @@ -90,10 +90,10 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons // 设置GET请求的token if (request.getMethod().equals("GET")) { - String csrf_token = UUID.UU64(); + String csrfToken = UUID.UU64(); // 默认存储30分钟 - cache.hset(Types.CSRF_TOKEN.getType(), csrf_token, uri,30 * 60); - request.setAttribute("_csrf_token", csrf_token); + cache.hset(Types.CSRF_TOKEN.getType(), csrfToken, uri,30L * 60); + request.setAttribute("_csrf_token", csrfToken); } // 返回true才会执行postHandle return true; @@ -118,22 +118,20 @@ public void postHandle(HttpServletRequest request, HttpServletResponse response, request.setAttribute("commons", commons); request.setAttribute("option", ov); request.setAttribute("adminCommons", adminCommons); - initSiteConfig(request); + initSiteConfig(); } - private void initSiteConfig(HttpServletRequest request) { + private void initSiteConfig() { if (WebConst.initConfig.isEmpty()) { List options = optionService.getOptions(); Map querys = new HashMap(); - options.forEach(option -> { - querys.put(option.getName(),option.getValue()); - }); + options.forEach(option -> querys.put(option.getName(),option.getValue())); WebConst.initConfig = querys; } } @Override - public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { + public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) { } } diff --git a/src/main/java/com/wip/interceptor/WebMvcConfig.java b/src/main/java/com/wip/interceptor/WebMvcConfig.java index 92c220c..6f9fb5c 100644 --- a/src/main/java/com/wip/interceptor/WebMvcConfig.java +++ b/src/main/java/com/wip/interceptor/WebMvcConfig.java @@ -1,10 +1,8 @@ package com.wip.interceptor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** diff --git a/src/main/java/com/wip/service/article/impl/ContentServiceImpl.java b/src/main/java/com/wip/service/article/impl/ContentServiceImpl.java index c1843c2..49bd6e0 100644 --- a/src/main/java/com/wip/service/article/impl/ContentServiceImpl.java +++ b/src/main/java/com/wip/service/article/impl/ContentServiceImpl.java @@ -21,12 +21,14 @@ import com.wip.model.RelationShipDomain; import com.wip.service.article.ContentService; import com.wip.service.meta.MetaService; +import java.util.Collections; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.List; @@ -111,8 +113,7 @@ public PageInfo getArticlesByCond(ContentCond contentCond, int pa throw BusinessException.withErrorCode(ErrorConstant.Common.PARAM_IS_EMPTY); PageHelper.startPage(pageNum,pageSize); List contents = contentDao.getArticleByCond(contentCond); - PageInfo pageInfo = new PageInfo(contents); - return pageInfo; + return new PageInfo(contents); } @Override @@ -126,15 +127,13 @@ public void deleteArticleById(Integer cid) { // 同时要删除该 文章下的所有评论 List comments = commentDao.getCommentByCId(cid); - if (null != comments && comments.size()> 0) { - comments.forEach(comment -> { - commentDao.deleteComment(comment.getCoid()); - }); + if (null != comments && !comments.isEmpty()) { + comments.forEach(comment -> commentDao.deleteComment(comment.getCoid())); } // 删除标签和分类关联 List relationShips = relationShipDao.getRelationShipByCid(cid); - if (null != relationShips && relationShips.size()> 0) { + if (!CollectionUtils.isEmpty(relationShips)) { relationShipDao.deleteRelationShipByCid(cid); } @@ -163,9 +162,9 @@ public List getArticleByTags(MetaDomain tags) { if (null == tags) throw BusinessException.withErrorCode(ErrorConstant.Common.PARAM_IS_EMPTY); List relationShip = relationShipDao.getRelationShipByMid(tags.getMid()); - if (null != relationShip && relationShip.size()> 0) { + if (!CollectionUtils.isEmpty(relationShip)) { return contentDao.getArticleByTags(relationShip); } - return null; + return Collections.emptyList(); } } diff --git a/src/main/java/com/wip/service/attach/impl/AttAchServiceImpl.java b/src/main/java/com/wip/service/attach/impl/AttAchServiceImpl.java index c6cf74c..1575646 100644 --- a/src/main/java/com/wip/service/attach/impl/AttAchServiceImpl.java +++ b/src/main/java/com/wip/service/attach/impl/AttAchServiceImpl.java @@ -42,8 +42,7 @@ public void addAttAch(AttAchDomain attAchDomain) { public PageInfo getAtts(int pageNum, int pageSize) { PageHelper.startPage(pageNum, pageSize); List atts = attAchDao.getAtts(); - PageInfo pageInfo = new PageInfo(atts); - return pageInfo; + return new PageInfo(atts); } @Override diff --git a/src/main/java/com/wip/service/comment/CommentService.java b/src/main/java/com/wip/service/comment/CommentService.java index a999a87..5611b67 100644 --- a/src/main/java/com/wip/service/comment/CommentService.java +++ b/src/main/java/com/wip/service/comment/CommentService.java @@ -51,4 +51,11 @@ public interface CommentService { * @param status */ void updateCommentStatus(Integer coid, String status); + + /** + * 删除评论 + * @param id + */ + void deleteComment(Integer id); + } diff --git a/src/main/java/com/wip/service/comment/impl/CommentServiceImpl.java b/src/main/java/com/wip/service/comment/impl/CommentServiceImpl.java index 11ab086..0c4003d 100644 --- a/src/main/java/com/wip/service/comment/impl/CommentServiceImpl.java +++ b/src/main/java/com/wip/service/comment/impl/CommentServiceImpl.java @@ -63,7 +63,9 @@ public void addComment(CommentDomain comments) { if (null == comments) { msg = "评论对象为空"; } - + if (comments == null) { + throw BusinessException.withErrorCode("评论不能为空"); + } if (StringUtils.isBlank(comments.getAuthor())) { comments.setAuthor("热心网友"); } @@ -118,8 +120,7 @@ public PageInfo getCommentsByCond(CommentCond commentCond, int pa throw BusinessException.withErrorCode(ErrorConstant.Common.PARAM_IS_EMPTY); PageHelper.startPage(pageNum,pageSize); List comments = commentDao.getCommentsByCond(commentCond); - PageInfo pageInfo = new PageInfo(comments); - return pageInfo; + return new PageInfo(comments); } @Override @@ -137,4 +138,11 @@ public void updateCommentStatus(Integer coid, String status) { throw BusinessException.withErrorCode(ErrorConstant.Common.PARAM_IS_EMPTY); commentDao.updateCommentStatus(coid, status); } + + @Override + public void deleteComment(Integer coid) { + if (null == coid) + throw BusinessException.withErrorCode(ErrorConstant.Common.PARAM_IS_EMPTY); + commentDao.deleteComment(coid); + } } diff --git a/src/main/java/com/wip/service/log/impl/LogServiceImpl.java b/src/main/java/com/wip/service/log/impl/LogServiceImpl.java index dad5b67..c1b2ac2 100644 --- a/src/main/java/com/wip/service/log/impl/LogServiceImpl.java +++ b/src/main/java/com/wip/service/log/impl/LogServiceImpl.java @@ -40,8 +40,7 @@ public void addLog(String action, String data, String ip, Integer authorId) { public PageInfo getLogs(int pageNum, int pageSize) { PageHelper.startPage(pageNum,pageSize); List logs = logDao.getLogs(); - PageInfo pageInfo = new PageInfo(logs); - return pageInfo; + return new PageInfo(logs); } } diff --git a/src/main/java/com/wip/service/meta/impl/MetaServiceImpl.java b/src/main/java/com/wip/service/meta/impl/MetaServiceImpl.java index f6fbb94..36f3396 100644 --- a/src/main/java/com/wip/service/meta/impl/MetaServiceImpl.java +++ b/src/main/java/com/wip/service/meta/impl/MetaServiceImpl.java @@ -18,12 +18,14 @@ import com.wip.model.RelationShipDomain; import com.wip.service.article.ContentService; import com.wip.service.meta.MetaService; +import java.util.Collections; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.HashMap; import java.util.List; @@ -53,7 +55,7 @@ public void saveMeta(String type, String name, Integer mid) { // 通过项目名和类型查找有没有存在的 List metas = metaDao.getMetasByCond(metaCond); // 判断是否找到有相同的 - if (null == metas || metas.size() ==0) { + if (CollectionUtils.isEmpty(metas)) { MetaDomain metaDomain = new MetaDomain(); metaDomain.setName(name); // 如果有mid代表需要更新 @@ -92,7 +94,7 @@ public List getMetaList(String type, String orderBy, int limit) { paraMap.put("limit", limit); return metaDao.selectFromSql(paraMap); } - return null; + return Collections.emptyList(); } @Override @@ -187,36 +189,38 @@ public void deleteMetaById(Integer mid) { // 通过ID找到该项目 MetaDomain meta = metaDao.getMetaById(mid); - if (null != meta) { - String type = meta.getType(); - String name = meta.getName(); - // 删除meta - metaDao.deleteMetaById(mid); - // 需要把相关的数据删除 - List relationShips = relationShipDao.getRelationShipByMid(mid); - // 判断是否查找到项目编号 - if (null != relationShips && relationShips.size()> 0) { - for (RelationShipDomain relationShip : relationShips) { - // 通过关联表的文章ID找到该文章 - ContentDomain article = contentService.getArticleById(relationShip.getCid()); - // 判断是否找到文章 - if (null != article) { - ContentDomain temp = new ContentDomain(); - temp.setCid(relationShip.getCid()); - if (type.equals(Types.CATEGORY.getType())) { - temp.setCategories(reMeta(name,article.getCategories())); - } - if (type.equals(Types.TAG.getType())) { - temp.setTags(reMeta(name,article.getTags())); - } - // 将删除的标签和分类从文章表中去除 - contentService.updateArticleById(temp); - } + if (null == meta) { + return; + } + String type = meta.getType(); + String name = meta.getName(); + // 删除meta + metaDao.deleteMetaById(mid); + // 需要把相关的数据删除 + List relationShips = relationShipDao.getRelationShipByMid(mid); + // 判断是否查找到项目编号 + if (CollectionUtils.isEmpty(relationShips)) { + return; + } + for (RelationShipDomain relationShip : relationShips) { + // 通过关联表的文章ID找到该文章 + ContentDomain article = contentService.getArticleById(relationShip.getCid()); + // 判断是否找到文章 + if (null != article) { + ContentDomain temp = new ContentDomain(); + temp.setCid(relationShip.getCid()); + if (type.equals(Types.CATEGORY.getType())) { + temp.setCategories(reMeta(name,article.getCategories())); + } + if (type.equals(Types.TAG.getType())) { + temp.setTags(reMeta(name,article.getTags())); } - // 删除关联meta - relationShipDao.deleteRelationShipByMid(mid); + // 将删除的标签和分类从文章表中去除 + contentService.updateArticleById(temp); } } + // 删除关联meta + relationShipDao.deleteRelationShipByMid(mid); } private String reMeta(String name, String metas) { String[] ms = StringUtils.split(metas,","); diff --git a/src/main/java/com/wip/service/option/OptionService.java b/src/main/java/com/wip/service/option/OptionService.java index 85c5896..c5339c2 100644 --- a/src/main/java/com/wip/service/option/OptionService.java +++ b/src/main/java/com/wip/service/option/OptionService.java @@ -29,15 +29,15 @@ public interface OptionService { /** * 更新网站配置 - * @param s - * @param s1 + * @param name + * @param value */ void updateOptionByName(String name, String value); /** * 通过名称获取网站配置 - * @param site_record + * @param siteRecord * @return */ - OptionsDomain getOptionByName(String site_record); + OptionsDomain getOptionByName(String siteRecord); } diff --git a/src/main/java/com/wip/service/user/impl/UserServiceImpl.java b/src/main/java/com/wip/service/user/impl/UserServiceImpl.java index 0eb18fd..77acd26 100644 --- a/src/main/java/com/wip/service/user/impl/UserServiceImpl.java +++ b/src/main/java/com/wip/service/user/impl/UserServiceImpl.java @@ -10,7 +10,6 @@ import com.wip.exception.BusinessException; import com.wip.model.UserDomain; import com.wip.service.user.UserService; -import com.wip.utils.APIResponse; import com.wip.utils.TaleUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/com/wip/utils/AdminCommons.java b/src/main/java/com/wip/utils/AdminCommons.java index ff9f91f..12345a1 100644 --- a/src/main/java/com/wip/utils/AdminCommons.java +++ b/src/main/java/com/wip/utils/AdminCommons.java @@ -15,6 +15,8 @@ @Component public final class AdminCommons { + private AdminCommons(){} + /** * 判断category和cat的交集 diff --git a/src/main/java/com/wip/utils/Commons.java b/src/main/java/com/wip/utils/Commons.java index 9300aad..adbdf4b 100644 --- a/src/main/java/com/wip/utils/Commons.java +++ b/src/main/java/com/wip/utils/Commons.java @@ -17,6 +17,8 @@ @Component public class Commons { + private Commons() {} + /** * 获取随机数数 @@ -79,7 +81,7 @@ public static String fmtdate(Integer unixTime, String patten) { * @return */ public static String blogPermalink(Integer cid) { - return site_url("/blog/article/" + cid.toString()); + return site_url("/detail/" + cid.toString()); } /** diff --git a/src/main/java/com/wip/utils/DateKit.java b/src/main/java/com/wip/utils/DateKit.java index e6ce77e..e352c51 100644 --- a/src/main/java/com/wip/utils/DateKit.java +++ b/src/main/java/com/wip/utils/DateKit.java @@ -13,7 +13,7 @@ */ public class DateKit { - + private DateKit(){} public static String formatDateByUnixTime(long unixTime, String dateFormat) { return dateFormat(new Date(unixTime * 1000L), dateFormat); diff --git a/src/main/java/com/wip/utils/GsonUtils.java b/src/main/java/com/wip/utils/GsonUtils.java index 8d30d9d..7b15a6b 100644 --- a/src/main/java/com/wip/utils/GsonUtils.java +++ b/src/main/java/com/wip/utils/GsonUtils.java @@ -11,6 +11,8 @@ * json转换工具 */ public class GsonUtils { + + private GsonUtils (){} private static final Gson gson = new Gson(); public static String toJsonString(Object object) { diff --git a/src/main/java/com/wip/utils/IPKit.java b/src/main/java/com/wip/utils/IPKit.java index 2942c20..050e074 100644 --- a/src/main/java/com/wip/utils/IPKit.java +++ b/src/main/java/com/wip/utils/IPKit.java @@ -9,6 +9,8 @@ */ public class IPKit { + private IPKit() {} + /** * 获取请求IP地址 * @param request diff --git a/src/main/java/com/wip/utils/MapCache.java b/src/main/java/com/wip/utils/MapCache.java index 080a45e..74179a1 100644 --- a/src/main/java/com/wip/utils/MapCache.java +++ b/src/main/java/com/wip/utils/MapCache.java @@ -5,8 +5,6 @@ **/ package com.wip.utils; -import javafx.collections.MapChangeListener; - import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/com/wip/utils/TaleUtils.java b/src/main/java/com/wip/utils/TaleUtils.java index 8bf10c1..2cc5365 100644 --- a/src/main/java/com/wip/utils/TaleUtils.java +++ b/src/main/java/com/wip/utils/TaleUtils.java @@ -14,7 +14,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import javax.swing.text.html.parser.Parser; import java.awt.*; import java.io.File; import java.io.InputStream; @@ -28,6 +27,8 @@ public class TaleUtils { + private TaleUtils() {} + /** * 匹配邮箱正则 */ @@ -118,8 +119,6 @@ public static String getUploadFilePath() { } catch (UnsupportedEncodingException e) { e.printStackTrace(); } - int lastIndex = path.lastIndexOf("/") + 1; - path = path.substring(0, lastIndex); File file = new File(""); return file.getAbsolutePath() + "/"; } diff --git a/src/main/java/com/wip/utils/Tools.java b/src/main/java/com/wip/utils/Tools.java index 3a3c68a..f4175d2 100644 --- a/src/main/java/com/wip/utils/Tools.java +++ b/src/main/java/com/wip/utils/Tools.java @@ -5,16 +5,19 @@ import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; import java.util.Random; public class Tools { + private Tools() {} + private static final Random random = new Random(); public static String enAes(String data, String key) throws Exception { Cipher cipher = Cipher.getInstance("AES"); - SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes("UTF-8"),"ASE"); + SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8),"ASE"); cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec); byte[] encryptedBytes = cipher.doFinal(data.getBytes()); return new BASE64Encoder().encode(encryptedBytes); @@ -22,7 +25,7 @@ public static String enAes(String data, String key) throws Exception { public static String deAes(String data, String key) throws Exception { Cipher cipher = Cipher.getInstance("AES"); - SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES"); + SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES"); cipher.init(Cipher.DECRYPT_MODE, secretKeySpec); byte[] cipherTextBytes = new BASE64Decoder().decodeBuffer(data); byte[] decValue = cipher.doFinal(cipherTextBytes); diff --git a/src/main/java/com/wip/utils/UUID.java b/src/main/java/com/wip/utils/UUID.java index 9925156..81da41b 100644 --- a/src/main/java/com/wip/utils/UUID.java +++ b/src/main/java/com/wip/utils/UUID.java @@ -8,6 +8,8 @@ */ public abstract class UUID { + private UUID() {} + static Random r = new Random(); /** @@ -81,7 +83,6 @@ public static String UU64(java.util.UUID uu) { public static String UU32(java.util.UUID uuid) { StringBuilder sb = new StringBuilder(); long m = uuid.getMostSignificantBits(); - long l = uuid.getLeastSignificantBits(); for (int i = 0; i < 13; i++) { sb.append(_UU32[(int) (m>> ((13 - i - 1) * 5)) & 31]); } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 0411d79..d23713c 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -10,9 +10,9 @@ spring: filters: stat driver-class-name: com.mysql.jdbc.Driver #基本属性 - url: jdbc:mysql://127.0.0.1:3306/lu_tale?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=true + url: jdbc:mysql://192.168.0.22:3306/lu_tale?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=true username: root - password: root + password: minstone@123 #配置初始化大小/最小/最大 initial-size: 1 min-idle: 1 diff --git a/src/main/resources/lu_tale.sql b/src/main/resources/lu_tale.sql index 03704f5..a5c6cf3 100644 --- a/src/main/resources/lu_tale.sql +++ b/src/main/resources/lu_tale.sql @@ -128,6 +128,20 @@ CREATE TABLE `t_options` ( PRIMARY KEY (`name`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +INSERT INTO lu_tale.t_options (name, value, description) VALUES('baidu_site_verification', '无', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('google_site_verification', '无', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('site_description', 'KyrieCao的博客', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('site_record', '无', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('site_title', 'KyrieCao', 'KyrieCao'); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('social_csdn', 'https://blog.csdn.net/qq_22067469', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('social_github', 'https://github.com/caozongpeng', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('social_jianshu', 'https://www.jianshu.com/', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('social_resume', '', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('social_twitter', '', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('social_weibo', 'https://weibo.com/', NULL); +INSERT INTO lu_tale.t_options (name, value, description) VALUES('social_zhihu', 'https://www.zhihu.com/', NULL); + + -- ---------------------------- -- Table structure for t_relationships -- ---------------------------- @@ -138,24 +152,6 @@ CREATE TABLE `t_relationships` ( PRIMARY KEY (`cid`, `mid`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; --- ---------------------------- --- Records of t_relationships --- ---------------------------- -INSERT INTO `t_relationships` VALUES (27, 41); -INSERT INTO `t_relationships` VALUES (27, 42); -INSERT INTO `t_relationships` VALUES (27, 43); -INSERT INTO `t_relationships` VALUES (27, 46); -INSERT INTO `t_relationships` VALUES (28, 41); -INSERT INTO `t_relationships` VALUES (28, 43); -INSERT INTO `t_relationships` VALUES (29, 41); -INSERT INTO `t_relationships` VALUES (29, 42); -INSERT INTO `t_relationships` VALUES (29, 43); -INSERT INTO `t_relationships` VALUES (30, 48); -INSERT INTO `t_relationships` VALUES (31, 48); -INSERT INTO `t_relationships` VALUES (32, 41); -INSERT INTO `t_relationships` VALUES (32, 43); -INSERT INTO `t_relationships` VALUES (33, 48); - -- ---------------------------- -- Table structure for t_users -- ---------------------------- diff --git a/src/main/resources/static/blog/css/fonts.css b/src/main/resources/static/blog/css/fonts.css new file mode 100644 index 0000000..09b901e --- /dev/null +++ b/src/main/resources/static/blog/css/fonts.css @@ -0,0 +1,392 @@ +/* vietnamese */ +@font-face { + font-family: 'Monda'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/monda/v16/TK3tWkYFABsmjspuPho7vA.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Monda'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/monda/v16/TK3tWkYFABsmjspvPho7vA.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Monda'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/monda/v16/TK3tWkYFABsmjsphPho.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Monda'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/monda/v16/TK3gWkYFABsmjsLaGw8Lnep_Kg.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Monda'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/monda/v16/TK3gWkYFABsmjsLaGw8Knep_Kg.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Monda'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/monda/v16/TK3gWkYFABsmjsLaGw8Eneo.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'PT Mono'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/ptmono/v13/9oRONYoBnWILk-9AnCIzM-Py.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'PT Mono'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/ptmono/v13/9oRONYoBnWILk-9AnCszM-Py.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* latin-ext */ +@font-face { + font-family: 'PT Mono'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/ptmono/v13/9oRONYoBnWILk-9AnCEzM-Py.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'PT Mono'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/ptmono/v13/9oRONYoBnWILk-9AnC8zMw.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufA5qW54A.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufJ5qW54A.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufB5qW54A.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufO5qW54A.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufC5qW54A.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufD5qW54A.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufN5qU.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufA5qW54A.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufJ5qW54A.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufB5qW54A.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufO5qW54A.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufC5qW54A.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufD5qW54A.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufN5qU.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufA5qW54A.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufJ5qW54A.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufB5qW54A.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufO5qW54A.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufC5qW54A.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufD5qW54A.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/robotoslab/v25/BngMUXZYTXPIvIBgJJSb6ufN5qU.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNwCbHhL4.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNwSbHhL4.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNzybH.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNwCbHhL4.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNwSbHhL4.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNzybH.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNwCbHhL4.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNwSbHhL4.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Rosario'; + font-style: italic; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfuz0WDhWW_fOEoY2FbNzybH.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2Fz9zT7D.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2F39zT7D.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2FP9zQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2Fz9zT7D.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2F39zT7D.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2FP9zQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2Fz9zT7D.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2F39zT7D.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Rosario'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/rosario/v31/xfux0WDhWW_fOEoY2FP9zQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} diff --git a/src/main/resources/templates/admin/comment_list.html b/src/main/resources/templates/admin/comment_list.html index ab43d9d..352e77f 100644 --- a/src/main/resources/templates/admin/comment_list.html +++ b/src/main/resources/templates/admin/comment_list.html @@ -28,7 +28,7 @@

评论管理

- diff --git a/src/main/resources/templates/admin/fragments/footer.html b/src/main/resources/templates/admin/fragments/footer.html index bd38693..ede0925 100644 --- a/src/main/resources/templates/admin/fragments/footer.html +++ b/src/main/resources/templates/admin/fragments/footer.html @@ -2,7 +2,7 @@
diff --git a/src/main/resources/templates/blog/fragments/footer.html b/src/main/resources/templates/blog/fragments/footer.html index 53c9859..51685db 100644 --- a/src/main/resources/templates/blog/fragments/footer.html +++ b/src/main/resources/templates/blog/fragments/footer.html @@ -4,7 +4,7 @@
- © 2017 - 2018 + © 2023 - 2025 Kyrie
@@ -17,7 +17,7 @@
- +
diff --git a/src/main/resources/templates/blog/layout.html b/src/main/resources/templates/blog/layout.html index bc6a18a..17df54d 100644 --- a/src/main/resources/templates/blog/layout.html +++ b/src/main/resources/templates/blog/layout.html @@ -8,9 +8,9 @@ - - - + + + @@ -80,8 +80,8 @@ window.Promise = null; } - - + + diff --git a/src/test/java/com/wip/MyBlogApplicationTests.java b/src/test/java/com/wip/MyBlogApplicationTests.java deleted file mode 100644 index 80395cd..0000000 --- a/src/test/java/com/wip/MyBlogApplicationTests.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.wip; - -import com.wip.utils.Commons; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class MyBlogApplicationTests { - - @Test - public void contextLoads() { - } - -}

AltStyle によって変換されたページ (->オリジナル) /