├── .idea ├── .gitignore ├── KsForum.iml ├── compiler.xml ├── dataSources.xml ├── dictionaries │ └── Hanabi.xml ├── encodings.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── uiDesigner.xml └── vcs.xml ├── KsForum.iml ├── README.md ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── zhuqiu │ │ ├── controller │ │ ├── backend │ │ │ ├── BackArticleController.java │ │ │ ├── BackCategoryController.java │ │ │ ├── BackCommentController.java │ │ │ ├── BackHomeController.java │ │ │ ├── BackUploadFileController.java │ │ │ └── BackUserController.java │ │ └── frontend │ │ │ ├── ArticleController.java │ │ │ ├── CategoryController.java │ │ │ ├── CommentController.java │ │ │ ├── HomeController.java │ │ │ └── UserController.java │ │ ├── dto │ │ ├── ArticleParam.java │ │ ├── CategoryTree.java │ │ ├── JsonResult.java │ │ ├── PasswordParam.java │ │ └── UploadFileVO.java │ │ ├── enums │ │ └── Status.java │ │ ├── interceptor │ │ ├── HomeInterceptor.java │ │ └── SecurityInterceptor.java │ │ ├── mapper │ │ ├── ArticleCategoryRefMapper.java │ │ ├── ArticleFunctionMapper.java │ │ ├── ArticleMapper.java │ │ ├── CategoryMapper.java │ │ ├── CommentMapper.java │ │ ├── UserFavoriteRefMapper.java │ │ └── UserMapper.java │ │ ├── pojo │ │ ├── Article.java │ │ ├── ArticleCategoryRef.java │ │ ├── Category.java │ │ ├── Comment.java │ │ ├── User.java │ │ └── UserFavoriteRef.java │ │ └── service │ │ ├── ArticleFunctionService.java │ │ ├── ArticleService.java │ │ ├── CategoryService.java │ │ ├── CommentService.java │ │ ├── UserService.java │ │ └── impl │ │ ├── ArticleFunctionServiceImpl.java │ │ ├── ArticleServiceImpl.java │ │ ├── CategoryServiceImpl.java │ │ ├── CommentServiceImpl.java │ │ └── UserServiceImpl.java ├── resources │ ├── druid.properties │ ├── log4j.properties │ ├── mapper │ │ ├── ArticleCategoryRefMapper.xml │ │ ├── ArticleFunctionMapper.xml │ │ ├── ArticleMapper.xml │ │ ├── CategoryMapper.xml │ │ ├── CommentMapper.xml │ │ ├── UserFavoriteRefMapper.xml │ │ └── UserMapper.xml │ ├── mybatis │ │ └── mybatis-config.xml │ ├── redis.properties │ └── spring │ │ ├── applicationContext.xml │ │ ├── spring-mvc.xml │ │ ├── spring-mybatis.xml │ │ └── spring-service.xml └── webapp │ ├── WEB-INF │ ├── html │ │ ├── case │ │ │ └── case.html │ │ ├── catalog.html │ │ ├── common │ │ │ ├── column.html │ │ │ ├── filter.html │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── link.html │ │ │ └── user-nav.html │ │ ├── index.html │ │ ├── jie │ │ │ ├── add.html │ │ │ ├── detail.html │ │ │ └── index.html │ │ ├── other │ │ │ ├── 404.html │ │ │ ├── notice.html │ │ │ └── tips.html │ │ └── user │ │ │ ├── activate.html │ │ │ ├── forget.html │ │ │ ├── home.html │ │ │ ├── index.html │ │ │ ├── login.html │ │ │ ├── message.html │ │ │ ├── reg.html │ │ │ └── set.html │ ├── view │ │ ├── Back │ │ │ ├── Article │ │ │ │ ├── edit.jsp │ │ │ │ ├── index.jsp │ │ │ │ └── insert.jsp │ │ │ ├── Category │ │ │ │ ├── edit.jsp │ │ │ │ └── index.jsp │ │ │ ├── Comment │ │ │ │ ├── edit.jsp │ │ │ │ ├── index.jsp │ │ │ │ └── reply.jsp │ │ │ ├── Public │ │ │ │ ├── framework.jsp │ │ │ │ └── paging.jsp │ │ │ ├── User │ │ │ │ ├── edit.jsp │ │ │ │ ├── index.jsp │ │ │ │ ├── insert.jsp │ │ │ │ └── profile.jsp │ │ │ ├── index.jsp │ │ │ └── login.jsp │ │ └── Home │ │ │ ├── Article │ │ │ ├── detail.jsp │ │ │ ├── edit.jsp │ │ │ ├── index.jsp │ │ │ └── write.jsp │ │ │ ├── Category │ │ │ └── index.jsp │ │ │ ├── Public │ │ │ ├── framework.jsp │ │ │ ├── index_framework.jsp │ │ │ └── user_framework.jsp │ │ │ ├── User │ │ │ ├── comment.jsp │ │ │ ├── home.jsp │ │ │ ├── index.jsp │ │ │ └── setting.jsp │ │ │ ├── index.jsp │ │ │ ├── login.jsp │ │ │ └── reg.jsp │ └── web.xml │ ├── res │ └── mods │ │ ├── case.js │ │ ├── face.js │ │ ├── index.js │ │ ├── jie.js │ │ └── user.js │ └── statics │ ├── css │ ├── back.css │ ├── full.css │ ├── global.css │ ├── highlight.css │ ├── iconfont.eot │ ├── iconfont.svg │ ├── iconfont.ttf │ └── iconfont.woff │ ├── img │ ├── avatar │ │ ├── 0.jpg │ │ ├── 00.jpg │ │ ├── 1.jpg │ │ ├── 10.jpg │ │ ├── 11.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ ├── 8.jpg │ │ ├── 9.jpg │ │ └── default.png │ ├── case.png │ ├── fly.jpg │ ├── logo-1.png │ ├── logo.png │ ├── other │ │ ├── 1437100018023.jpg │ │ └── study-a.png │ └── weixin.jpg │ ├── js │ ├── back.js │ └── jquery-3.4.1.js │ └── plugin │ ├── font-awesome │ ├── HELP-US-OUT.txt │ ├── css │ │ ├── font-awesome.css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── less │ │ ├── animated.less │ │ ├── bordered-pulled.less │ │ ├── core.less │ │ ├── fixed-width.less │ │ ├── font-awesome.less │ │ ├── icons.less │ │ ├── larger.less │ │ ├── list.less │ │ ├── mixins.less │ │ ├── path.less │ │ ├── rotated-flipped.less │ │ ├── screen-reader.less │ │ ├── stacked.less │ │ └── variables.less │ └── scss │ │ ├── _animated.scss │ │ ├── _bordered-pulled.scss │ │ ├── _core.scss │ │ ├── _fixed-width.scss │ │ ├── _icons.scss │ │ ├── _larger.scss │ │ ├── _list.scss │ │ ├── _mixins.scss │ │ ├── _path.scss │ │ ├── _rotated-flipped.scss │ │ ├── _screen-reader.scss │ │ ├── _stacked.scss │ │ ├── _variables.scss │ │ └── font-awesome.scss │ └── layui │ ├── css │ ├── layui.css │ ├── layui.mobile.css │ └── modules │ │ ├── code.css │ │ ├── laydate │ │ └── default │ │ │ └── laydate.css │ │ └── layer │ │ └── default │ │ ├── icon-ext.png │ │ ├── icon.png │ │ ├── layer.css │ │ ├── loading-0.gif │ │ ├── loading-1.gif │ │ └── loading-2.gif │ ├── font │ ├── iconfont.eot │ ├── iconfont.svg │ ├── iconfont.ttf │ ├── iconfont.woff │ └── iconfont.woff2 │ ├── images │ └── face │ │ ├── 0.gif │ │ ├── 1.gif │ │ ├── 10.gif │ │ ├── 11.gif │ │ ├── 12.gif │ │ ├── 13.gif │ │ ├── 14.gif │ │ ├── 15.gif │ │ ├── 16.gif │ │ ├── 17.gif │ │ ├── 18.gif │ │ ├── 19.gif │ │ ├── 2.gif │ │ ├── 20.gif │ │ ├── 21.gif │ │ ├── 22.gif │ │ ├── 23.gif │ │ ├── 24.gif │ │ ├── 25.gif │ │ ├── 26.gif │ │ ├── 27.gif │ │ ├── 28.gif │ │ ├── 29.gif │ │ ├── 3.gif │ │ ├── 30.gif │ │ ├── 31.gif │ │ ├── 32.gif │ │ ├── 33.gif │ │ ├── 34.gif │ │ ├── 35.gif │ │ ├── 36.gif │ │ ├── 37.gif │ │ ├── 38.gif │ │ ├── 39.gif │ │ ├── 4.gif │ │ ├── 40.gif │ │ ├── 41.gif │ │ ├── 42.gif │ │ ├── 43.gif │ │ ├── 44.gif │ │ ├── 45.gif │ │ ├── 46.gif │ │ ├── 47.gif │ │ ├── 48.gif │ │ ├── 49.gif │ │ ├── 5.gif │ │ ├── 50.gif │ │ ├── 51.gif │ │ ├── 52.gif │ │ ├── 53.gif │ │ ├── 54.gif │ │ ├── 55.gif │ │ ├── 56.gif │ │ ├── 57.gif │ │ ├── 58.gif │ │ ├── 59.gif │ │ ├── 6.gif │ │ ├── 60.gif │ │ ├── 61.gif │ │ ├── 62.gif │ │ ├── 63.gif │ │ ├── 64.gif │ │ ├── 65.gif │ │ ├── 66.gif │ │ ├── 67.gif │ │ ├── 68.gif │ │ ├── 69.gif │ │ ├── 7.gif │ │ ├── 70.gif │ │ ├── 71.gif │ │ ├── 8.gif │ │ └── 9.gif │ ├── lay │ └── modules │ │ ├── carousel.js │ │ ├── code.js │ │ ├── colorpicker.js │ │ ├── element.js │ │ ├── flow.js │ │ ├── form.js │ │ ├── jquery.js │ │ ├── laydate.js │ │ ├── layedit.js │ │ ├── layer.js │ │ ├── laypage.js │ │ ├── laytpl.js │ │ ├── mobile.js │ │ ├── rate.js │ │ ├── slider.js │ │ ├── table.js │ │ ├── transfer.js │ │ ├── tree.js │ │ ├── upload.js │ │ └── util.js │ ├── layer.js │ ├── layui.all.js │ ├── layui.js │ ├── mobile │ ├── layer.js │ └── need │ │ └── layer.css │ └── skin │ └── default │ ├── icon-ext.png │ ├── icon.png │ ├── layer.css │ ├── loading-0.gif │ ├── loading-1.gif │ └── loading-2.gif └── test └── java └── service ├── ArticleTest.java ├── CategoryTest.java ├── CommentTest.java ├── RedisTest.java └── UserServiceTest.java /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml 3 | 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml -------------------------------------------------------------------------------- /.idea/KsForum.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql.8 6 | true 7 | com.mysql.cj.jdbc.Driver 8 | jdbc:mysql://localhost:3306/ks_forum?serverTimezone=UTC 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/dictionaries/Hanabi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | layui 5 | zhuqiu 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 40 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /KsForum.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KsForum 2 | SSM 论坛\博客系统 3 | 4 | Spring + SpringMVC + Mybatis + Mysql 5 | 6 | JSP + layui 7 | 8 | 个人练手项目,基本功能完成。 9 | 10 | 包含了基本的论坛文章发布、编辑、浏览、收藏等功能,以及对文章的评论、对用户信息的管理等功能。 11 | 12 | 除了前台论坛功能以外,还包含后台管理功能。 13 | 14 | 整个项目仍然有许多想到的和没想到的不完善之处,代码的整洁度、健壮性还有待提升。 15 | 16 | 在页面样式和业务逻辑方面,借鉴和学习了 17 | 18 | [Layui的Fly社区](https://fly.layui.com/) 以及 [[言曌博客](https://liuyanzhao.com/)](https://liuyanzhao.com/) 19 | 20 | 感谢! 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/controller/backend/BackCategoryController.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.controller.backend; 2 | 3 | import com.zhuqiu.pojo.Article; 4 | import com.zhuqiu.pojo.Category; 5 | import com.zhuqiu.service.ArticleService; 6 | import com.zhuqiu.service.CategoryService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.data.redis.core.RedisTemplate; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | 15 | import java.util.ArrayList; 16 | import java.util.HashMap; 17 | import java.util.List; 18 | 19 | /** 20 | * @author zhuqiu 21 | * @date 2020/2/10 22 | */ 23 | 24 | @Controller("backCategoryController") 25 | @RequestMapping("/back/category") 26 | public class BackCategoryController { 27 | 28 | @Autowired 29 | private CategoryService categoryService; 30 | 31 | @Autowired 32 | private ArticleService articleService; 33 | 34 | @Autowired 35 | private RedisTemplate redisTemplate; 36 | 37 | /** 38 | * 后台分类列表显示 39 | * 40 | * @return 41 | */ 42 | @RequestMapping("") 43 | public String categoryList(Model model){ 44 | List categoryList = categoryService.listCategoryWithArticleCount(); 45 | model.addAttribute("categoryList", categoryList); 46 | return "/Back/Category/index"; 47 | } 48 | 49 | @RequestMapping("/{categoryId}") 50 | public String cateArticles(Model model, @PathVariable("categoryId") Integer categoryId){ 51 | HashMap criteria = new HashMap<>(); 52 | ArrayList statusList = new ArrayList<>(); 53 | statusList.add(1); 54 | statusList.add(2); 55 | criteria.put("articleStatus", statusList); 56 | criteria.put("categoryId", categoryId); 57 | 58 | List
articleList = articleService.listAllNotWithContent(criteria); 59 | 60 | model.addAttribute("articleList", articleList); 61 | 62 | return "/Back/Article/index"; 63 | } 64 | 65 | /** 66 | * 后台添加分类提交 67 | * 68 | * @param category 69 | * @return 70 | */ 71 | @RequestMapping(value = "/insertSubmit",method = RequestMethod.POST) 72 | public String insertCategorySubmit(Category category) { 73 | categoryService.insertCategory(category); 74 | 75 | redisTemplate.delete("categoryList"); 76 | redisTemplate.delete("categoryTree"); 77 | 78 | return "redirect:/back/category"; 79 | } 80 | 81 | /** 82 | * 删除分类 83 | * @param categoryId 84 | * @return 85 | */ 86 | @RequestMapping("/delete/{categoryId}") 87 | public String delete(@PathVariable("categoryId") Integer categoryId){ 88 | Integer count = articleService.countArticleByCategoryId(categoryId); 89 | if (count == 0){ 90 | categoryService.deleteCategory(categoryId); 91 | } 92 | redisTemplate.delete("categoryList"); 93 | redisTemplate.delete("categoryTree"); 94 | 95 | return "redirect:/back/category"; 96 | } 97 | 98 | /** 99 | * 跳转至编辑界面 100 | * @param categoryId 101 | * @param model 102 | * @return 103 | */ 104 | @RequestMapping("/edit/{categoryId}") 105 | public String edit(@PathVariable("categoryId") Integer categoryId, Model model){ 106 | Category category = categoryService.findCategoryById(categoryId); 107 | model.addAttribute("category", category); 108 | 109 | List categoryList = categoryService.listCategoryWithArticleCount(); 110 | model.addAttribute("categoryList", categoryList); 111 | return "/Back/Category/edit"; 112 | } 113 | 114 | /** 115 | * 提交更新 116 | * @param category 117 | * @return 118 | */ 119 | @RequestMapping(value = "/editSubmit", method = RequestMethod.POST) 120 | public String editSubmit(Category category){ 121 | categoryService.updateCategory(category); 122 | 123 | redisTemplate.delete("categoryList"); 124 | redisTemplate.delete("categoryTree"); 125 | 126 | return "redirect:/back/category"; 127 | } 128 | 129 | 130 | } 131 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/controller/backend/BackHomeController.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.controller.backend; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.zhuqiu.pojo.Article; 5 | import com.zhuqiu.pojo.Comment; 6 | import com.zhuqiu.pojo.User; 7 | import com.zhuqiu.service.ArticleService; 8 | import com.zhuqiu.service.CommentService; 9 | import com.zhuqiu.service.UserService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | import javax.servlet.http.HttpSession; 19 | import java.util.HashMap; 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | /** 24 | * @author zhuqiu 25 | * @date 2020/2/7 26 | */ 27 | 28 | @Controller("backHomeController") 29 | public class BackHomeController { 30 | 31 | @Autowired 32 | private UserService userService; 33 | 34 | @Autowired 35 | private ArticleService articleService; 36 | 37 | @Autowired 38 | private CommentService commentService; 39 | 40 | 41 | /** 42 | * 跳转至后台首页 43 | * @return 44 | */ 45 | @RequestMapping("/back/index") 46 | public String index(Model model) { 47 | List commentList = commentService.findAllComment(); 48 | for (Comment comment : commentList) { 49 | comment.setArticle(articleService.findArticleNotWithContentById(comment.getArticleId())); 50 | } 51 | List
articleList = articleService.listAllNotWithContent(new HashMap<>()); 52 | model.addAttribute("commentList", commentList); 53 | model.addAttribute("articleList", articleList); 54 | 55 | return "Back/index"; 56 | } 57 | 58 | /** 59 | * 登录页面 60 | * 61 | * @return 62 | */ 63 | @RequestMapping("/back/login") 64 | public String loginPage() { 65 | return "Back/login"; 66 | } 67 | 68 | 69 | /** 70 | * 确认登录信息 71 | * @return 72 | */ 73 | @ResponseBody 74 | @RequestMapping(value = "/back/loginVerify", method = RequestMethod.POST) 75 | public String loginVerify(HttpServletRequest request) { 76 | Map map = new HashMap<>(); 77 | String username = request.getParameter("username"); 78 | String password = request.getParameter("password"); 79 | 80 | User user = userService.findAdminByName(username); 81 | if (user == null) { 82 | map.put("status", "error"); 83 | map.put("msg", "用户名或者密码错误!"); 84 | } else if (!user.getUserPass().equals(password)) { 85 | map.put("status", "error"); 86 | map.put("msg", "用户名或者密码错误!"); 87 | } else { 88 | map.put("status", "success"); 89 | map.put("msg", "验证成功!"); 90 | 91 | request.getSession().setAttribute("admin", user); 92 | } 93 | 94 | String result = new JSONObject(map).toString(); 95 | return result; 96 | } 97 | 98 | /** 99 | * 退出登录 100 | * 101 | * @param session 102 | * @return 103 | */ 104 | @RequestMapping(value = "/back/logout") 105 | public String logout(HttpSession session) { 106 | session.removeAttribute("admin"); 107 | session.invalidate(); 108 | return "redirect:/back/login"; 109 | } 110 | 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/controller/backend/BackUploadFileController.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.controller.backend; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.zhuqiu.dto.JsonResult; 5 | import com.zhuqiu.dto.UploadFileVO; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestMethod; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.RestController; 11 | import org.springframework.web.multipart.MultipartFile; 12 | 13 | import java.io.File; 14 | import java.io.IOException; 15 | import java.util.Calendar; 16 | 17 | /** 18 | * @author zhuqiu 19 | * @date 2020/2/10 20 | */ 21 | 22 | @Slf4j 23 | @RestController("backUploadFileController") 24 | @RequestMapping("/back/upload") 25 | public class BackUploadFileController { 26 | 27 | /** 28 | * 文件保存目录,物理路径 29 | */ 30 | public final String rootPath = "D:/KsForum_upload/"; 31 | 32 | public final String allowSuffix = ".bmp.jpg.jpeg.png.gif.pdf.doc.zip.rar.gz"; 33 | 34 | /** 35 | * 上传文件 36 | * 37 | * @param file 38 | * @return 39 | * @throws IOException 40 | */ 41 | @RequestMapping(value = "/img", method = RequestMethod.POST) 42 | public String uploadFile(@RequestParam("file") MultipartFile file) { 43 | 44 | //1.文件后缀过滤,只允许部分后缀 45 | //文件的完整名称,如spring.jpeg 46 | String filename = file.getOriginalFilename(); 47 | //文件名,如spring 48 | String name = filename.substring(0, filename.indexOf(".")); 49 | //文件后缀,如.jpeg 50 | String suffix = filename.substring(filename.lastIndexOf(".")); 51 | 52 | if (allowSuffix.indexOf(suffix) == -1) { 53 | return JSON.toJSONString(new JsonResult().fail("不允许上传该后缀的文件!")); 54 | } 55 | 56 | 57 | //2.创建文件目录 58 | //创建年月文件夹 59 | Calendar date = Calendar.getInstance(); 60 | File dateDirs = new File(date.get(Calendar.YEAR) 61 | + File.separator + (date.get(Calendar.MONTH) + 1)); 62 | 63 | //目标文件 64 | File descFile = new File(rootPath + File.separator + dateDirs + File.separator + filename); 65 | int i = 1; 66 | //若文件存在重命名 67 | String newFilename = filename; 68 | while (descFile.exists()) { 69 | newFilename = name + "(" + i + ")" + suffix; 70 | String parentPath = descFile.getParent(); 71 | descFile = new File(parentPath + File.separator + newFilename); 72 | i++; 73 | } 74 | //判断目标文件所在的目录是否存在 75 | if (!descFile.getParentFile().exists()) { 76 | //如果目标文件所在的目录不存在,则创建父目录 77 | descFile.getParentFile().mkdirs(); 78 | } 79 | 80 | //3.存储文件 81 | //将内存中的数据写入磁盘 82 | try { 83 | file.transferTo(descFile); 84 | } catch (Exception e) { 85 | e.printStackTrace(); 86 | log.error("上传失败,cause:{}", e); 87 | } 88 | //完整的url 89 | String fileUrl = File.separator + "uploads" + File.separator + dateDirs + File.separator + newFilename; 90 | 91 | //4.返回URL 92 | UploadFileVO uploadFileVO = new UploadFileVO(); 93 | uploadFileVO.setTitle(filename); 94 | uploadFileVO.setSrc(fileUrl); 95 | JsonResult result = new JsonResult().ok(uploadFileVO); 96 | // System.out.println(result); 97 | return JSON.toJSONString(result); 98 | } 99 | } -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/controller/frontend/CommentController.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.controller.frontend; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.zhuqiu.pojo.Comment; 6 | import com.zhuqiu.pojo.User; 7 | import com.zhuqiu.service.ArticleService; 8 | import com.zhuqiu.service.CommentService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | import javax.servlet.http.HttpSession; 16 | import java.util.Date; 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | 20 | /** 21 | * @author zhuqiu 22 | * @date 2020/2/25 23 | */ 24 | 25 | @Controller 26 | @RequestMapping("/home/comment") 27 | public class CommentController { 28 | 29 | @Autowired 30 | private CommentService commentService; 31 | 32 | @Autowired 33 | private ArticleService articleService; 34 | 35 | 36 | 37 | @ResponseBody 38 | @RequestMapping("/reply") 39 | public String insertSubmit(Comment comment, HttpSession session){ 40 | System.out.println(comment); 41 | 42 | User user = (User) session.getAttribute("user"); 43 | Map map = new HashMap<>(); 44 | if (user == null){ 45 | map.put("status", "login"); 46 | map.put("msg", "请先登录!"); 47 | return JSON.toJSONString(new JSONObject(map)); 48 | } 49 | try { 50 | comment.setCommentCreateTime(new Date()); 51 | commentService.insertComment(comment); 52 | articleService.updateCommentCount(comment.getArticleId()); 53 | map.put("status", "success"); 54 | map.put("msg", "回复成功!"); 55 | } catch (RuntimeException e){ 56 | map.put("status", "error"); 57 | map.put("msg", "回复失败!"); 58 | }finally { 59 | String result = JSON.toJSONString(new JSONObject(map)); 60 | return result; 61 | } 62 | } 63 | 64 | @RequestMapping("/delete/{commentId}") 65 | public String delete(@PathVariable("commentId") Integer commentId, 66 | HttpSession session){ 67 | Comment comment = commentService.findCommentById(commentId); 68 | Integer articleId = comment.getArticleId(); 69 | User user = (User) session.getAttribute("user"); 70 | if (user == null){ 71 | return "redirect:/home/login"; 72 | } else if (user.getUserId() != comment.getCommentAuthorId()){ 73 | return "redirect:/home/article/" + articleId; 74 | } 75 | commentService.deleteComment(commentId); 76 | 77 | return "redirect:/home/article/" + articleId; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/dto/ArticleParam.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author zhuqiu 9 | * @date 2020/2/10 10 | */ 11 | 12 | @Data 13 | public class ArticleParam implements Serializable { 14 | 15 | private static final long serialVersionUID = -2398835510883686500L; 16 | private Integer articleId; 17 | 18 | private String articleTitle; 19 | 20 | private String articleContent; 21 | 22 | private Integer articleParentCategoryId; 23 | 24 | private Integer articleChildCategoryId; 25 | 26 | private Integer articleStatus; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/dto/CategoryTree.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * @author zhuqiu 10 | * @date 2020/2/25 11 | */ 12 | 13 | @Data 14 | public class CategoryTree implements Serializable { 15 | 16 | private static final long serialVersionUID = 4843146284812472476L; 17 | private String parentName; 18 | 19 | private Integer parentId; 20 | 21 | private Integer allCount; 22 | 23 | private List childList; 24 | 25 | public class Child implements Serializable { 26 | 27 | private static final long serialVersionUID = -6291811947502338198L; 28 | private String childName; 29 | 30 | private Integer childId; 31 | 32 | private Integer articleCount; 33 | 34 | public String getChildName() { 35 | return childName; 36 | } 37 | 38 | public void setChildName(String childName) { 39 | this.childName = childName; 40 | } 41 | 42 | public Integer getChildId() { 43 | return childId; 44 | } 45 | 46 | public void setChildId(Integer childId) { 47 | this.childId = childId; 48 | } 49 | 50 | public Integer getArticleCount() { 51 | return articleCount; 52 | } 53 | 54 | public void setArticleCount(Integer articleCount) { 55 | this.articleCount = articleCount; 56 | } 57 | 58 | public Child(String childName, Integer childId, Integer articleCount) { 59 | this.childName = childName; 60 | this.childId = childId; 61 | this.articleCount = articleCount; 62 | } 63 | 64 | public Child() { 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/dto/JsonResult.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * @author zhuqiu 11 | * @date 2020/2/11 12 | */ 13 | 14 | @Data 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | public class JsonResult implements Serializable { 18 | 19 | 20 | private static final long serialVersionUID = -9075611397573426736L; 21 | /** 22 | * 错误码 23 | */ 24 | private Integer code; 25 | 26 | /** 27 | * 提示信息 28 | */ 29 | private String msg; 30 | 31 | /** 32 | * 返回的具体内容 33 | */ 34 | private T data; 35 | 36 | public JsonResult fail() { 37 | return new JsonResult(1, "操作失败", null); 38 | } 39 | 40 | public JsonResult fail(String msg) { 41 | return new JsonResult(1, msg, null); 42 | } 43 | 44 | public JsonResult ok() { 45 | return new JsonResult(0, "操作成功", null); 46 | } 47 | 48 | 49 | public JsonResult ok(T data) { 50 | return new JsonResult(0, "操作成功", data); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/dto/PasswordParam.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author zhuqiu 9 | * @date 2020/2/23 10 | */ 11 | @Data 12 | public class PasswordParam implements Serializable { 13 | 14 | private static final long serialVersionUID = 7422885692762142885L; 15 | private Integer userId; 16 | 17 | private String oldPass; 18 | 19 | private String newPass; 20 | 21 | private String rePass; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/dto/UploadFileVO.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.dto; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author zhuqiu 7 | * @date 2020/2/11 8 | */ 9 | 10 | @Data 11 | public class UploadFileVO { 12 | 13 | private String src; 14 | 15 | private String title; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/enums/Status.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.enums; 2 | 3 | /** 4 | * @author zhuqiu 5 | * @date 2020/2/20 6 | */ 7 | 8 | public enum Status { 9 | 10 | 11 | DRAFT(0, "草稿"), 12 | PUBLISH(1, "已发布"), 13 | TOP(2, "置顶"), 14 | Notice(3, "公告"); 15 | 16 | 17 | 18 | private Integer code; 19 | 20 | private String status; 21 | 22 | private Status(Integer code, String status) { 23 | this.code = code; 24 | this.status = status; 25 | } 26 | 27 | public Integer getCode() { 28 | return code; 29 | } 30 | 31 | public void setCode(Integer code) { 32 | this.code = code; 33 | } 34 | 35 | public String getStatus() { 36 | return status; 37 | } 38 | 39 | public void setStatus(String status) { 40 | this.status = status; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/interceptor/HomeInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.interceptor; 2 | 3 | import org.springframework.web.servlet.HandlerInterceptor; 4 | import org.springframework.web.servlet.ModelAndView; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | /** 10 | * @author zhuqiu 11 | * @date 2020/2/26 12 | */ 13 | public class HomeInterceptor implements HandlerInterceptor { 14 | 15 | @Override 16 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 17 | System.out.println("SecurityInterceptor————PreHandle"); 18 | if (request.getSession().getAttribute("user") == null){ 19 | response.sendRedirect("/home/login"); 20 | return false; 21 | } 22 | return true; 23 | } 24 | 25 | @Override 26 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 27 | 28 | } 29 | 30 | @Override 31 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/interceptor/SecurityInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.interceptor; 2 | 3 | import org.springframework.web.servlet.HandlerInterceptor; 4 | import org.springframework.web.servlet.ModelAndView; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | /** 10 | * @author zhuqiu 11 | * @date 2020/2/13 12 | */ 13 | public class SecurityInterceptor implements HandlerInterceptor { 14 | 15 | @Override 16 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 17 | System.out.println("SecurityInterceptor————PreHandle"); 18 | if (request.getSession().getAttribute("admin") == null){ 19 | response.sendRedirect("/back/login"); 20 | return false; 21 | } 22 | return true; 23 | } 24 | 25 | @Override 26 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 27 | 28 | } 29 | 30 | @Override 31 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/mapper/ArticleCategoryRefMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.mapper; 2 | 3 | 4 | 5 | import com.zhuqiu.pojo.ArticleCategoryRef; 6 | import com.zhuqiu.pojo.Category; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 文章分类关联表Mapper 14 | * @author zhuqiu 15 | * @date 2020/2/2 16 | */ 17 | @Repository 18 | @Mapper 19 | public interface ArticleCategoryRefMapper { 20 | 21 | /** 22 | * 添加文章和分类关联记录 23 | * @param record 关联对象 24 | * @return 影响行数 25 | */ 26 | int insertRecord(ArticleCategoryRef record); 27 | 28 | /** 29 | * 根据分类ID删除记录 30 | * @param categoryId 分类ID 31 | * @return 影响行数 32 | */ 33 | int deleteByCategoryId(Integer categoryId); 34 | 35 | /** 36 | * 根据文章ID删除记录 37 | * @param articleId 文章ID 38 | * @return 影响行数 39 | */ 40 | int deleteByArticleId(Integer articleId); 41 | 42 | /** 43 | * 根据分类ID统计文章数 44 | * @param categoryId 分类ID 45 | * @return 文章数量 46 | */ 47 | Integer countArticleByCategoryId(Integer categoryId); 48 | 49 | 50 | /** 51 | * 根据文章ID查询分类ID 52 | * 53 | * @param articleId 文章ID 54 | * @return 分类ID列表 55 | */ 56 | List listCategoryIdByArticleId(Integer articleId); 57 | 58 | /** 59 | * 根据分类ID查询文章ID 60 | * 61 | * @param categoryId 分类ID 62 | * @return 文章ID列表 63 | */ 64 | List listArticleIdByCategoryId(Integer categoryId); 65 | 66 | /** 67 | * 根据文章ID获得分类列表 68 | * 69 | * @param articleId 文章ID 70 | * @return 分类列表 71 | */ 72 | List listCategoryByArticleId(Integer articleId); 73 | 74 | } -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/mapper/ArticleFunctionMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.mapper; 2 | 3 | import com.zhuqiu.pojo.Article; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 文章的推荐、分页、评论、收藏、赞、浏览量更新 12 | * 13 | * @author zhuqiu 14 | * @date 2020/2/1 15 | */ 16 | 17 | @Repository 18 | @Mapper 19 | public interface ArticleFunctionMapper { 20 | 21 | /** 22 | * 获得访问最多的文章(猜你喜欢) 23 | * 24 | * @param limit 查询数量 25 | * @return 文章列表 26 | */ 27 | List
listArticleByViewCount(@Param(value = "limit") Integer limit); 28 | 29 | /** 30 | * 列出收藏数量前几的文章 31 | * @param limit 查询数量 32 | * @return 文章列表 33 | */ 34 | List
listArticleByFavoriteCount(@Param(value = "limit") Integer limit); 35 | 36 | /** 37 | * 列出点赞数量前几的文章 38 | * @param limit 查询数量 39 | * @return 文章列表 40 | */ 41 | List
listArticleByLikeCount(@Param(value = "limit") Integer limit); 42 | 43 | /** 44 | * 热评文章 45 | * @param limit 查询数量 46 | * @return 文章列表 47 | */ 48 | List
listArticleByCommentCount(@Param(value = "limit") Integer limit); 49 | 50 | /** 51 | * 最新发布文章 52 | * @param limit 查询数量 53 | * @return 文章列表 54 | */ 55 | List
listArticleByCreateTime(@Param(value = "limit") Integer limit); 56 | 57 | /** 58 | * 分页操作 59 | * 60 | * @param pageIndex 从第几页开始 61 | * @param pageSize 数量 62 | * @return 文章列表 63 | */ 64 | @Deprecated 65 | List
pageArticle(@Param(value = "pageIndex") Integer pageIndex, 66 | @Param(value = "pageSize") Integer pageSize); 67 | 68 | /** 69 | * 获得上一篇文章 70 | * 71 | * @param articleId 文章ID 72 | * @return 文章 73 | */ 74 | Article getAfterArticle(Integer articleId); 75 | 76 | /** 77 | * 获得下一篇文章 78 | * 79 | * @param articleId 文章ID 80 | * @return 文章 81 | */ 82 | Article getPreArticle(Integer articleId); 83 | 84 | /** 85 | * 获得随机文章 86 | * 87 | * @param limit 查询数量 88 | * @return 文章列表 89 | */ 90 | List
listRandomArticle(@Param(value = "limit") Integer limit); 91 | 92 | 93 | /** 94 | * 获得最近更新的记录 95 | * 96 | * @return 文章 97 | */ 98 | List
getLastUpdateArticle(@Param(value = "limit") Integer limit); 99 | 100 | /** 101 | * 获得最近更新的记录 102 | * 103 | * @return 文章 104 | */ 105 | List
getLastCreateArticle(@Param(value = "limit") Integer limit); 106 | 107 | 108 | //同步更新文章信息 109 | 110 | /** 111 | * 更新文章的评论数 112 | * @param articleId 113 | * @return 影响行数 114 | */ 115 | int updateCommentCount(Integer articleId); 116 | 117 | /** 118 | * 更新文章的收藏数 119 | * @param articleId 120 | * @return 影响行数 121 | */ 122 | int updateFavoriteCount(Integer articleId); 123 | 124 | /** 125 | * 更新文章的浏览量 126 | * @param articleId 127 | * @return 影响行数 128 | */ 129 | int updateViewCount(Integer articleId); 130 | 131 | /** 132 | * 更新文章的赞数 133 | * @param articleId 134 | * @return 影响行数 135 | */ 136 | int updateLikeCount(Integer articleId); 137 | 138 | } 139 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/mapper/ArticleMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.mapper; 2 | 3 | import com.zhuqiu.pojo.Article; 4 | import com.zhuqiu.pojo.User; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.HashMap; 10 | import java.util.List; 11 | 12 | /** 13 | * 文章信息 14 | * 15 | * @author zhuqiu 16 | * @date 2020/2/1 17 | */ 18 | 19 | @Repository 20 | @Mapper 21 | public interface ArticleMapper { 22 | 23 | //基本功能 24 | 25 | /** 26 | * 根据Id查找文章 27 | * @param articleId 28 | * @return 一篇文章 29 | */ 30 | Article findArticleById(Integer articleId); 31 | 32 | /** 33 | * 根据id查找文章(无正文—) 34 | * @param articleId 35 | * @return 一篇文章 36 | */ 37 | Article findArticleNotWithContent(Integer articleId); 38 | 39 | /** 40 | * 按标题查询文章(模糊查询) 41 | * @param articleTitle 42 | * @return 43 | */ 44 | List
findArticleByTitle(String articleTitle); 45 | 46 | /** 47 | * 根据分类ID查询文章 48 | * 49 | * @param categoryId 分类ID 50 | * @param limit 查询数量 51 | * @return 文章列表 52 | */ 53 | List
findArticleByCategoryId(@Param("categoryId") Integer categoryId, 54 | @Param("limit") Integer limit); 55 | 56 | /** 57 | * 根据多个分类ID查询文章 58 | * 59 | * @param categoryIds 分类ID集合 60 | * @param limit 查询数量 61 | * @return 文章列表 62 | */ 63 | List
findArticleByCategoryIds(@Param("categoryIds") List categoryIds, 64 | @Param("limit") Integer limit); 65 | 66 | /** 67 | * 根据id查找用户收藏文章 68 | * @param userId 69 | * @return 文章列表 70 | */ 71 | List
listFavoriteArticle(Integer userId); 72 | 73 | /** 74 | * 根据id查找用户发布文章列表 75 | * @param userId 76 | * @return 文章列表 77 | */ 78 | List
listUserArticle(Integer userId); 79 | 80 | /** 81 | * 查询所有文章 82 | * @param criteria 搜索条件列表 83 | * @return 文章列表 84 | */ 85 | List
findAllArticle(HashMap criteria); 86 | 87 | /** 88 | * 查询所有文章(不带正文) 89 | * @param criteria 搜索条件列表 90 | * @return 文章列表 91 | */ 92 | List
findAllArticleNotWithContent(HashMap criteria); 93 | 94 | /** 95 | * 新增一篇文章 96 | * @param article 97 | * @return 自增Id的值 98 | */ 99 | int insertArticle(Article article); 100 | 101 | /** 102 | * 更新文章信息 103 | * @param article 104 | * @return 影响行数 105 | */ 106 | int updateArticle(Article article); 107 | 108 | /** 109 | * 按Id删除文章 110 | * @param articleId 111 | * @return 影响行数 112 | */ 113 | int deleteArticleById(Integer articleId); 114 | 115 | /** 116 | * 批量删除文章 117 | * 118 | * @param ids 文章Id列表 119 | * @return 影响行数 120 | */ 121 | int deleteBatch(@Param("ids") List ids); 122 | 123 | 124 | //计算论坛总数 125 | 126 | /** 127 | * 计算文章总数 128 | * @return 文章总数 129 | */ 130 | Integer countArticle(); 131 | 132 | /** 133 | * 获得总文章浏览数 134 | * @return 总浏览数 135 | */ 136 | Integer countAllArticleView(); 137 | 138 | /** 139 | * 计算总文章评论数 140 | * @return 总评论数 141 | */ 142 | Integer countAllArticleComment(); 143 | 144 | 145 | //单篇信息 146 | 147 | /** 148 | * 获得文章浏览数 149 | * @param articleId 150 | * @return 浏览数 151 | */ 152 | Integer countArticleViewById(Integer articleId); 153 | 154 | /** 155 | * 更新文章评论数 156 | * @param articleId 157 | * @return 影响行数 158 | */ 159 | int updateCommentCount(Integer articleId); 160 | 161 | 162 | /** 163 | * 获得文章赞数 164 | * @param articleId 165 | * @return 赞数 166 | */ 167 | Integer countArticleLikeById(Integer articleId); 168 | 169 | /** 170 | * 更新文章收藏数 171 | * @param articleId 172 | * @return 影响行数 173 | */ 174 | int updateFavoriteCount(Integer articleId); 175 | 176 | 177 | } 178 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/mapper/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.mapper; 2 | 3 | import com.zhuqiu.pojo.Category; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 文章分类信息 11 | * @author zhuqiu 12 | * @date 2020/2/1 13 | */ 14 | 15 | @Repository 16 | @Mapper 17 | public interface CategoryMapper { 18 | 19 | /** 20 | * 根据分类Id查找 21 | * @param categoryId 22 | * @return 类别 23 | */ 24 | Category findCategoryById(Integer categoryId); 25 | 26 | /** 27 | * 查询所有类别 28 | * @return 类别列表 29 | */ 30 | List findAllCategory(); 31 | 32 | /** 33 | * 新增一个类别 34 | * @param category 35 | * @return 影响行数 36 | */ 37 | int insertCategory(Category category); 38 | 39 | /** 40 | * 按Id删除类别 41 | * @param categoryId 42 | * @return 影响行数 43 | */ 44 | int deleteCategoryById(Integer categoryId); 45 | 46 | /** 47 | * 更新类别信息 48 | * @param category 49 | * @return 影响行数 50 | */ 51 | int updateCategory(Category category); 52 | 53 | /** 54 | * 查询分类总数 55 | * @return 分类总数 56 | */ 57 | Integer countCategory(); 58 | 59 | /** 60 | * 根据类名查找分类 61 | * @param categoryName 62 | * @return 分类列表 63 | */ 64 | List listCategoryByName(String categoryName); 65 | 66 | /** 67 | * 根据父分类找子分类 68 | * 69 | * @param categoryId 分类ID 70 | * @return 子分类列表 71 | */ 72 | List listChildCategory(Integer categoryId); 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/mapper/CommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.mapper; 2 | 3 | import com.zhuqiu.pojo.Comment; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 评论信息 12 | * @author zhuqiu 13 | * @date 2020/2/2 14 | */ 15 | 16 | @Repository 17 | @Mapper 18 | public interface CommentMapper { 19 | 20 | /** 21 | * 根据id查询评论 22 | * @param commentId 23 | * @return 评论 24 | */ 25 | Comment findCommentById(Integer commentId); 26 | 27 | /** 28 | * 列出所以评论 29 | * @return 评论列表 30 | */ 31 | List findAllComment(); 32 | 33 | /** 34 | * 列出文章的所有评论 35 | * @param articleId 36 | * @return 评论列表 37 | */ 38 | List listCommentByArticle(Integer articleId); 39 | 40 | /** 41 | * 列出用户的所有评论 42 | * @param userId 43 | * @return 评论列表 44 | */ 45 | List listCommentByUser(Integer userId); 46 | 47 | /** 48 | * 根据ID删除 49 | * 50 | * @param commentId 评论ID 51 | * @return 影响行数 52 | */ 53 | int deleteCommentById(Integer commentId); 54 | 55 | /** 56 | * 添加 57 | * 58 | * @param comment 评论 59 | * @return 影响行数 60 | */ 61 | int insertComment(Comment comment); 62 | 63 | /** 64 | * 更新 65 | * 66 | * @param comment 评论 67 | * @return 影响行数 68 | */ 69 | int updateComment(Comment comment); 70 | 71 | /** 72 | * 计算总评论数 73 | * @return 74 | */ 75 | Integer countComment(); 76 | 77 | 78 | 79 | /** 80 | * 获得评论的子评论 81 | * 82 | * @param commentId 父评论ID 83 | * @return 列表 84 | */ 85 | List listChildComment(Integer commentId); 86 | 87 | /** 88 | * 获得最近评论 89 | * 90 | * @param limit 查询数量 91 | * @return 列表 92 | */ 93 | List listRecentComment(@Param(value = "limit") Integer limit); 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/mapper/UserFavoriteRefMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.mapper; 2 | 3 | import com.zhuqiu.pojo.UserFavoriteRef; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 用户收藏文章相关关联表 11 | * @author zhuqiu 12 | * @date 2020/2/2 13 | */ 14 | 15 | @Repository 16 | @Mapper 17 | public interface UserFavoriteRefMapper { 18 | 19 | /** 20 | * 根据用户id查找记录 21 | * @param userId 22 | * @return 文章id列表 23 | */ 24 | List findFavoriteByUserId(Integer userId); 25 | 26 | /** 27 | * 根据文章id查找记录 28 | * @param articleId 29 | * @return 用户id列表 30 | */ 31 | List findFavoriteByArticleId(Integer articleId); 32 | 33 | /** 34 | * 新增一条收藏记录 35 | * @param record 36 | * @return 影响行数 37 | */ 38 | int insertRecord(UserFavoriteRef record); 39 | 40 | /** 41 | * 根据id计算用户收藏数量 42 | * @param userId 43 | * @return 收藏数量 44 | */ 45 | Integer countUserFavorite(Integer userId); 46 | 47 | 48 | 49 | /** 50 | * 根据id计算文章被收藏数量 51 | * @param articleId 52 | * @return 收藏数量 53 | */ 54 | Integer countArticleFavorite(Integer articleId); 55 | 56 | 57 | 58 | /** 59 | * 按用户id删除记录 60 | * @param userId 61 | * @return 影响行数 62 | */ 63 | int deleteByUserId(Integer userId); 64 | 65 | /** 66 | * 按文章id删除记录 67 | * @param articleId 68 | * @return 影响行数 69 | */ 70 | int deleteByArticleId(Integer articleId); 71 | 72 | /** 73 | * 用户取消收藏 74 | * @param record 75 | * @return 影响行数 76 | */ 77 | int deleteRecord(UserFavoriteRef record); 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.mapper; 2 | 3 | import com.zhuqiu.pojo.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 用户信息 11 | * @author zhuqiu 12 | * @date 2020/2/1 13 | */ 14 | 15 | @Repository 16 | @Mapper 17 | public interface UserMapper { 18 | 19 | /** 20 | * 用于管理员登录后台 21 | * @param userName 22 | * @return 23 | */ 24 | User findAdminByName(String userName); 25 | 26 | /** 27 | * 按用户Id查询单个用户 28 | * @param userId 29 | * @return 一个用户 30 | */ 31 | User findUserById(Integer userId); 32 | 33 | /** 34 | * 查询所有用户 35 | * @return 用户列表 36 | */ 37 | List findAllUser(); 38 | 39 | /** 40 | * 更新用户信息 41 | * @param user 42 | * @return 影响行数 43 | */ 44 | int updateUser(User user); 45 | 46 | /** 47 | * 按Id删除用户 48 | * @param userId 49 | * @return 影响行数 50 | */ 51 | int deleteUserById(Integer userId); 52 | 53 | /** 54 | * 新增一个用户 55 | * @param user 56 | * @return 影响行数 57 | */ 58 | int insertUser(User user); 59 | 60 | /** 61 | * 按Name查询用户(模糊查找) 62 | * @param userNickname 63 | * @return 用户列表用户 64 | */ 65 | List findUserByNickName(String userNickname); 66 | 67 | /** 68 | * 按用户名查询用户(用于登录) 69 | * @param userName 70 | * @return User 71 | */ 72 | User findUserByName(String userName); 73 | 74 | /** 75 | * 计算用户总数 76 | * @return 用户总数 77 | */ 78 | Integer countUser(); 79 | 80 | 81 | //用户发文、评论、收藏信息 82 | 83 | 84 | /** 85 | * 根据id计算用户发布文章数量 86 | * @param userId 87 | * @return 文章数量 88 | */ 89 | Integer countUserArticle(Integer userId); 90 | 91 | 92 | /** 93 | * 根据id计算用户评论数量 94 | * @param userId 95 | * @return 评论数量 96 | */ 97 | Integer countUserComment(Integer userId); 98 | 99 | /** 100 | * 根据id计算用户收藏数量 101 | * @param userId 102 | * @return 收藏数量 103 | */ 104 | Integer countUserFavorite(Integer userId); 105 | 106 | 107 | /** 108 | * 根据id查找收藏文章的用户 109 | * @param articleId 110 | * @return 用户列表 111 | */ 112 | List listFavoriteUser(Integer articleId); 113 | 114 | 115 | } 116 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/pojo/Article.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.pojo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | import java.util.List; 8 | 9 | /** 10 | * 文章正文 11 | * @author zhuqiu 12 | * @date 2020/2/1 13 | */ 14 | 15 | @Data 16 | public class Article implements Serializable { 17 | 18 | private static final long serialVersionUID = -4781100837885075841L; 19 | private Integer articleId; 20 | 21 | private Integer articleUserId; 22 | 23 | private String articleTitle; 24 | 25 | private String articleContent; 26 | 27 | // 浏览量 28 | private Integer articleViewCount; 29 | 30 | // 点赞数 31 | private Integer articleLikeCount; 32 | 33 | //评论数 34 | private Integer articleCommentCount; 35 | 36 | // 收藏数 37 | private Integer articleFavoriteCount; 38 | 39 | 40 | private Date articleCreateTime; 41 | 42 | private Date articleUpdateTime; 43 | 44 | private Integer articleStatus; 45 | 46 | 47 | 48 | /** 49 | * 以下为非数据库字段 50 | */ 51 | 52 | private User user; 53 | 54 | 55 | // private String category; 56 | 57 | private List categoryList; 58 | 59 | // private List tagList; 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/pojo/ArticleCategoryRef.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 文章-分类 索引 11 | * @author zhuqiu 12 | * @date 2020/2/1 13 | */ 14 | 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class ArticleCategoryRef implements Serializable { 19 | 20 | private static final long serialVersionUID = 6139039369014886203L; 21 | private Integer articleId; 22 | 23 | private Integer categoryId; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/pojo/Category.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * @author zhuqiu 11 | * @date 2020/2/1 12 | */ 13 | 14 | @Data 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | public class Category implements Serializable { 18 | 19 | private static final long serialVersionUID = -7475565351945650420L; 20 | private Integer categoryId; 21 | 22 | private String categoryName; 23 | 24 | private Integer superCategoryId; 25 | 26 | /** 27 | * 以下为非数据库字段 28 | */ 29 | 30 | private Integer articleCount; 31 | 32 | public Category(Integer categoryId, String categoryName) { 33 | this.categoryId = categoryId; 34 | this.categoryName = categoryName; 35 | } 36 | 37 | public Category(String categoryName) { 38 | this.categoryName = categoryName; 39 | } 40 | 41 | public Category(Integer categoryId) { 42 | this.categoryId = categoryId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/pojo/Comment.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.pojo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * 评论(回复—) 10 | * @author zhuqiu 11 | * @date 2020/2/1 12 | */ 13 | 14 | @Data 15 | public class Comment implements Serializable { 16 | 17 | private static final long serialVersionUID = -5329217357208401878L; 18 | private Integer commentId; 19 | 20 | private String commentContent; 21 | 22 | // 上级评论Id 23 | private Integer superId; 24 | 25 | // 上级评论者Name 26 | private String superAuthorName; 27 | 28 | private Integer articleId; 29 | 30 | private String articleTitle; 31 | 32 | private Integer commentAuthorId; 33 | 34 | private String commentAuthorName; 35 | 36 | private String commentAuthorAvatar; 37 | 38 | private Date commentCreateTime; 39 | 40 | /** 41 | * 一下为非数据库字段 42 | */ 43 | 44 | private Article article; 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/pojo/User.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | /** 11 | * 用户 12 | * @author zhuqiu 13 | * @date 2020/2/1 14 | */ 15 | 16 | @Data 17 | public class User implements Serializable { 18 | 19 | private static final long serialVersionUID = 6450048280593614339L; 20 | private Integer userId; 21 | 22 | private String userName; 23 | 24 | private String userPass; 25 | 26 | private String userNickname; 27 | 28 | private String userProfile; 29 | 30 | private Date userRegisterTime; 31 | 32 | private String userAvatar; 33 | 34 | /** 35 | * 以下为非数据库字段 36 | */ 37 | 38 | private Integer userFavoriteCount; 39 | 40 | private Integer userArticleCount; 41 | 42 | private Integer userCommentCount; 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/pojo/UserFavoriteRef.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 用户-收藏 索引 11 | * @author zhuqiu 12 | * @date 2020/2/1 13 | */ 14 | 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class UserFavoriteRef implements Serializable { 19 | 20 | private static final long serialVersionUID = -3254628479368944264L; 21 | private Integer userId; 22 | 23 | private Integer articleId; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/service/ArticleFunctionService.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.zhuqiu.pojo.Article; 5 | 6 | import java.util.HashMap; 7 | import java.util.List; 8 | 9 | /** 10 | * @author zhuqiu 11 | * @date 2020/2/4 12 | */ 13 | public interface ArticleFunctionService { 14 | 15 | /** 16 | * 分页显示 17 | * 18 | * @param pageIndex 第几页开始 19 | * @param pageSize 一页显示多少 20 | * @param criteria 查询条件 21 | * @return 文章列表 22 | */ 23 | PageInfo
pageArticle(Integer pageIndex, 24 | Integer pageSize, 25 | HashMap criteria); 26 | 27 | /** 28 | * 获得访问最多的文章(猜你喜欢) 29 | * 30 | * @param limit 查询数量 31 | * @return 文章列表 32 | */ 33 | List
listArticleByViewCount(Integer limit); 34 | 35 | /** 36 | * 列出收藏数量前几的文章 37 | * @param limit 查询数量 38 | * @return 文章列表 39 | */ 40 | List
listArticleByFavoriteCount(Integer limit); 41 | 42 | /** 43 | * 列出点赞数量前几的文章 44 | * @param limit 查询数量 45 | * @return 文章列表 46 | */ 47 | List
listArticleByLikeCount(Integer limit); 48 | 49 | /** 50 | * 热评文章 51 | * @param limit 查询数量 52 | * @return 文章列表 53 | */ 54 | List
listArticleByCommentCount(Integer limit); 55 | 56 | 57 | /** 58 | * 获得上一篇文章 59 | * 60 | * @param articleId 文章ID 61 | * @return 文章 62 | */ 63 | Article getAfterArticle(Integer articleId); 64 | 65 | /** 66 | * 获得下一篇文章 67 | * 68 | * @param articleId 文章ID 69 | * @return 文章 70 | */ 71 | Article getPreArticle(Integer articleId); 72 | 73 | /** 74 | * 获得随机文章 75 | * 76 | * @param limit 查询数量 77 | * @return 列表 78 | */ 79 | List
listRandomArticle(Integer limit); 80 | 81 | /** 82 | * 获得最后更新的记录 83 | * 84 | * @return 文章 85 | */ 86 | List
getLastUpdateArticle(Integer limit); 87 | 88 | /** 89 | * 获得最近发布的文章 90 | * 91 | * @return 文章 92 | */ 93 | List
getLastCreateArticle(Integer limit); 94 | 95 | 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/service/ArticleService.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.service; 2 | 3 | import com.zhuqiu.pojo.Article; 4 | 5 | import java.util.HashMap; 6 | import java.util.List; 7 | 8 | /** 9 | * @author zhuqiu 10 | * @date 2020/2/4 11 | */ 12 | public interface ArticleService { 13 | 14 | /** 15 | * 获取文章总数 16 | * 17 | * @return 数量 18 | */ 19 | Integer countArticle(); 20 | 21 | /** 22 | * 获取评论总数 23 | * 24 | * @return 数量 25 | */ 26 | Integer countAllArticleComment(); 27 | 28 | /** 29 | * 获得浏览量总数 30 | * 31 | * @return 数量 32 | */ 33 | Integer countAllArticleView(); 34 | 35 | 36 | /** 37 | * 统计有这个分类的文章数 38 | * 39 | * @param categoryId 分类ID 40 | * @return 数量 41 | */ 42 | Integer countArticleByCategoryId(Integer categoryId); 43 | 44 | 45 | /** 46 | * 获得所有文章不分页 47 | * 48 | * @param criteria 查询条件 49 | * @return 列表 50 | */ 51 | List
listArticle(HashMap criteria); 52 | 53 | /** 54 | * 获得所有的文章 55 | * 56 | * @return 列表 57 | */ 58 | List
listAllNotWithContent(HashMap criteria); 59 | 60 | /** 61 | * 获取所有文章,并附带用户信息 62 | * @param criteria 63 | * @return 64 | */ 65 | List
listAllWithUser(HashMap criteria); 66 | 67 | 68 | 69 | 70 | /** 71 | * 修改文章详细信息 72 | * 73 | * @param article 文章 74 | */ 75 | void updateArticleDetail(Article article); 76 | 77 | /** 78 | * 修改文章简单信息 79 | * 80 | * @param article 文章 81 | */ 82 | void updateArticle(Article article); 83 | 84 | /** 85 | * 批量删除文章 86 | * 87 | * @param ids 文章ID 88 | */ 89 | void deleteArticleBatch(List ids); 90 | 91 | /** 92 | * 删除文章 93 | * 94 | * @param articleId 文章ID 95 | */ 96 | void deleteArticle(Integer articleId); 97 | 98 | 99 | /** 100 | * 文章基本 101 | * 102 | * @param articleId 文章ID 103 | * @return 文章 104 | */ 105 | Article findArticleById(Integer articleId); 106 | 107 | /** 108 | * 文章详细信息 109 | * 110 | * @param articleId 文章ID 111 | * @return 文章 112 | */ 113 | Article findArticleNotWithContentById(Integer articleId); 114 | 115 | /** 116 | * 文章详情页面显示 117 | * 118 | * @param articleTitle 文章标题 119 | * @return 文章 120 | */ 121 | List
findArticleByTitle(String articleTitle); 122 | 123 | /** 124 | * 文章基本信息 125 | * 126 | * @param articleTitle 文章标题 127 | * @return 文章 128 | */ 129 | // List
findArticleNotWithContentByTitle(String articleTitle); 130 | 131 | 132 | 133 | /** 134 | * 添加文章 135 | * 136 | * @param article 文章 137 | */ 138 | void insertArticle(Article article); 139 | 140 | 141 | /** 142 | * 更新文章的评论数 143 | * 144 | * @param articleId 文章ID 145 | */ 146 | void updateCommentCount(Integer articleId); 147 | 148 | /** 149 | * 更新文章的浏览数 150 | * 151 | * @param articleId 文章ID 152 | */ 153 | // void updateViewCount(Integer articleId); 154 | 155 | /** 156 | * 更新文章的收藏数 157 | * 158 | * @param articleId 文章ID 159 | */ 160 | void updateFavoriteCount(Integer articleId); 161 | 162 | /** 163 | * 更新文章的点赞数 164 | * 165 | * @param articleId 文章ID 166 | */ 167 | // void updateLikeCount(Integer articleId); 168 | 169 | /** 170 | * 获得类别相关文章 171 | * 172 | * @param categoryId 分类ID 173 | * @param limit 查询数量 174 | * @return 列表 175 | */ 176 | List
listArticleByCategoryId(Integer categoryId, Integer limit); 177 | 178 | /** 179 | * 获得相关文章 180 | * 181 | * @param categoryIds 分类ID集合 182 | * @param limit 数量 183 | * @return 列表 184 | */ 185 | List
listArticleByCategoryIds(List categoryIds, Integer limit); 186 | 187 | 188 | /** 189 | * 根据文章ID获得分类ID列表 190 | * 191 | * @param articleId 文章Id 192 | * @return 列表 193 | */ 194 | List listCategoryIdByArticleId(Integer articleId); 195 | 196 | 197 | } 198 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.service; 2 | 3 | import com.zhuqiu.pojo.Category; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author zhuqiu 9 | * @date 2020/2/4 10 | */ 11 | public interface CategoryService { 12 | 13 | /** 14 | * 获得分类总数 15 | * 16 | * @return 17 | */ 18 | Integer countCategory(); 19 | 20 | 21 | /** 22 | * 获得分类列表 23 | * 24 | * @return 分类列表 25 | */ 26 | List listCategory(); 27 | 28 | /** 29 | * 获得分类列表 30 | * 31 | * @return 分类列表 32 | */ 33 | List listCategoryWithArticleCount(); 34 | 35 | /** 36 | * 删除分类 37 | * 38 | * @param categoryId ID 39 | */ 40 | 41 | void deleteCategory(Integer categoryId); 42 | 43 | /** 44 | * 根据id查询分类信息 45 | * 46 | * @param categoryId ID 47 | * @return 分类 48 | */ 49 | Category findCategoryById(Integer categoryId); 50 | 51 | /** 52 | * 添加分类 53 | * 54 | * @param category 分类 55 | * @return 分类 56 | */ 57 | Category insertCategory(Category category); 58 | 59 | /** 60 | * 更新分类 61 | * 62 | * @param category 分类 63 | */ 64 | void updateCategory(Category category); 65 | 66 | /** 67 | * 根据分类名获取分类 68 | * 69 | * @param categoryName 名称 70 | * @return 分类 71 | */ 72 | List listCategoryByName(String categoryName); 73 | 74 | /** 75 | * 根据父分类找子分类 76 | * 77 | * @param categoryId 分类ID 78 | * @return 子分类列表 79 | */ 80 | List listChildCategory(Integer categoryId); 81 | 82 | /** 83 | * 根据文章ID查询分类ID 84 | * 85 | * @param articleId 文章ID 86 | * @return 分类ID列表 87 | */ 88 | List listCategoryIdByArticleId(Integer articleId); 89 | 90 | /** 91 | * 根据文章ID获得分类列表 92 | * 93 | * @param articleId 文章ID 94 | * @return 分类列表 95 | */ 96 | List listCategoryByArticleId(Integer articleId); 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/service/CommentService.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.zhuqiu.pojo.Comment; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author zhuqiu 10 | * @date 2020/2/4 11 | */ 12 | public interface CommentService { 13 | 14 | 15 | 16 | /** 17 | * 根据文章id获取评论列表 18 | * 19 | * @param articleId 文章ID 20 | * @return 列表 21 | */ 22 | List listCommentByArticleId(Integer articleId); 23 | 24 | /** 25 | * 列出用户的所有评论 26 | * @param userId 27 | * @return 评论列表 28 | */ 29 | List listCommentByUserId(Integer userId); 30 | 31 | /** 32 | * 根据id获取评论 33 | * 34 | * @param commentId 35 | * @return 36 | */ 37 | Comment findCommentById(Integer commentId); 38 | 39 | 40 | /** 41 | * 获得评论列表 42 | * 43 | * @return 列表 44 | */ 45 | List findAllComment(); 46 | 47 | 48 | /** 49 | * 删除评论 50 | * 51 | * @param commentId ID 52 | */ 53 | void deleteComment(Integer commentId); 54 | 55 | /** 56 | * 修改评论 57 | * 58 | * @param comment 评论 59 | */ 60 | void updateComment(Comment comment); 61 | 62 | /** 63 | * 添加评论 64 | * 65 | * @param comment 评论 66 | */ 67 | Comment insertComment(Comment comment); 68 | 69 | /** 70 | * 统计评论数 71 | * 72 | * @return 数量 73 | */ 74 | Integer countComment(); 75 | 76 | /** 77 | * 获得最近评论 78 | * 79 | * @param limit 查询数量 80 | * @return 列表 81 | */ 82 | List listRecentComment(Integer limit); 83 | 84 | /** 85 | * 获得评论的子评论 86 | * 87 | * @param commentId 父评论ID 88 | * @return 列表 89 | */ 90 | List listChildComment(Integer commentId); 91 | 92 | /** 93 | * 获取所有评论列表 94 | * 95 | * @param pageIndex 第几页开始 96 | * @param pageSize 一页显示数量 97 | * @return 列表 98 | */ 99 | PageInfo listCommentByPage(Integer pageIndex, 100 | Integer pageSize); 101 | 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/com/zhuqiu/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.zhuqiu.service; 2 | 3 | import com.zhuqiu.pojo.Article; 4 | import com.zhuqiu.pojo.Comment; 5 | import com.zhuqiu.pojo.User; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 11 | * @author zhuqiu 12 | * @date 2020/2/2 13 | */ 14 | 15 | public interface UserService { 16 | 17 | /** 18 | * 按用户名查询用户(用于管理员登录) 19 | * @param userName 20 | * @return User 21 | */ 22 | User findAdminByName(String userName); 23 | 24 | /** 25 | * 按用户Id查询单个用户 26 | * @param userId 27 | * @return 一个用户 28 | */ 29 | User findUserById(Integer userId); 30 | 31 | /** 32 | * 按用户名查询用户(用于登录) 33 | * @param userName 34 | * @return User 35 | */ 36 | User findUserByName(String userName); 37 | 38 | /** 39 | * 查询所有用户 40 | * @return 用户列表 41 | */ 42 | List findAllUser(); 43 | 44 | /** 45 | * 更新用户信息 46 | * @param user 47 | */ 48 | void updateUser(User user); 49 | 50 | /** 51 | * 按Id删除用户 52 | * @param userId 53 | */ 54 | void deleteUserById(Integer userId); 55 | 56 | /** 57 | * 新增一个用户 58 | * @param user 59 | */ 60 | User insertUser(User user); 61 | 62 | /** 63 | * 按Name查询用户(模糊查找) 64 | * @param userNickname 65 | * @return 用户列表用户 66 | */ 67 | List findUserByNickName(String userNickname); 68 | 69 | /** 70 | * 计算用户总数 71 | * @return 用户总数 72 | */ 73 | Integer countUser(); 74 | 75 | 76 | //用户发文、评论、收藏信息 77 | 78 | /** 79 | * 根据id计算用户发布文章数量 80 | * @param userId 81 | * @return 文章数量 82 | */ 83 | Integer countUserArticle(Integer userId); 84 | 85 | /** 86 | * 根据id查找用户发布文章列表 87 | * @param userId 88 | * @return 文章列表 89 | */ 90 | List
listUserArticle(Integer userId); 91 | 92 | 93 | /** 94 | * 根据id计算用户评论数量 95 | * @param userId 96 | * @return 评论数量 97 | */ 98 | Integer countUserComment(Integer userId); 99 | 100 | /** 101 | * 根据id查找用户评论 102 | * @param userId 103 | * @return 评论列表 104 | */ 105 | List listUserComment(Integer userId); 106 | 107 | /** 108 | * 根据id计算用户收藏数量 109 | * @param userId 110 | * @return 收藏数量 111 | */ 112 | Integer countUserFavorite(Integer userId); 113 | 114 | /** 115 | * 根据id查找用户收藏文章 116 | * @param userId 117 | * @return 文章列表 118 | */ 119 | List
listFavoriteArticle(Integer userId); 120 | 121 | /** 122 | * 添加收藏文章 123 | * @param userId 124 | * @param articleId 125 | * @return articleId 126 | */ 127 | Integer addFavorite(Integer userId, Integer articleId); 128 | 129 | /** 130 | * 删除收藏文章 131 | * @param userId 132 | * @param articleId 133 | * @return articleId 134 | */ 135 | Integer deleteFavorite(Integer userId, Integer articleId); 136 | 137 | /** 138 | * 根据userId查找收藏文章id列表 139 | * @param userId 140 | * @return 收藏文章id列表 141 | */ 142 | List listFavoriteArticleId(Integer userId); 143 | } 144 | -------------------------------------------------------------------------------- /src/main/resources/druid.properties: -------------------------------------------------------------------------------- 1 | druid.url=jdbc:mysql://localhost:3306/ks_forum?characterEncoding=utf-8&serverTimezone=UTC 2 | druid.username=root 3 | druid.password=123456 4 | druid.driverClassName=com.mysql.jdbc.Driver 5 | druid.initialSize=5 6 | druid.minIdle=3 7 | druid.maxActive=20 8 | druid.maxWait=5000 9 | -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Global logging configuration 2 | log4j.rootLogger=DEBUG, stdout 3 | # Console output... 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n 7 | -------------------------------------------------------------------------------- /src/main/resources/mapper/ArticleCategoryRefMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | article_category_ref.category_id, category_super_id, category_name 14 | 15 | 16 | 17 | 18 | insert into article_category_ref(article_id, category_id) 19 | values (#{articleId, jdbcType=INTEGER}, #{categoryId, jdbcType=INTEGER}) 20 | 21 | 22 | 23 | delete from article_category_ref 24 | where category_id = #{categoryId} 25 | 26 | 27 | 28 | delete from article_category_ref 29 | where article_id = #{articleId} 30 | 31 | 32 | 38 | 39 | 43 | 44 | 48 | 49 | 55 | 56 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CategoryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | category_id, category_super_id, category_name 14 | 15 | 16 | 17 | 18 | 24 | 25 | 30 | 31 | 32 | delete from category 33 | where category_id = #{categoryId,jdbcType=INTEGER} 34 | 35 | 36 | 37 | insert into category (category_id, category_super_id, category_name 38 | 39 | ) 40 | values 41 | ( 42 | #{categoryId,jdbcType=INTEGER}, #{superCategoryId,jdbcType=INTEGER}, #{categoryName,jdbcType=VARCHAR} 43 | ) 44 | 45 | 46 | 47 | update category 48 | set category_id = #{record.categoryId,jdbcType=INTEGER}, 49 | category_super_id = #{record.superCategoryId,jdbcType=INTEGER}, 50 | category_name = #{record.categoryName,jdbcType=VARCHAR} 51 | 52 | 53 | 54 | 57 | 58 | 62 | 63 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserFavoriteRefMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 16 | insert into user_favorite_ref 17 | (user_id, article_id) 18 | values (#{userId, jdbcType=INTEGER}, #{articleId, jdbcType=INTEGER}) 19 | 20 | 21 | 25 | 26 | 30 | 31 | 32 | delete from user_favorite_ref 33 | where user_id = #{userId} 34 | 35 | 36 | 37 | delete from user_favorite_ref 38 | where article_id = #{articleId} 39 | 40 | 41 | 42 | delete from user_favorite_ref 43 | where user_id = #{userId} 44 | and article_id = #{articleId} 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/resources/mybatis/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/redis.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/resources/redis.properties -------------------------------------------------------------------------------- /src/main/resources/spring/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/spring/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/main/resources/spring/spring-service.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/catalog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Fly Template v3.0 所有页面目录 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

17 | 基于 layui 的极简社区页面模版:Fly Template v3.0 所有页面目录 18 |

19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 |
页面目录
首页index.html
帖子相关
列表jie/index.html
详情jie/detail.html
发帖/编辑jie/add.html
用户相关
注册user/reg.html
登入user/login.html
找回密码user/forget.html
我的主页user/home.html
用户中心user/index.html
基本设置user/set.html
我的消息user/message.html
邮箱激活user/activate.html
其它
案例case/case.html
提示other/tips.html
公告other/notice.html
404other/404.html
111 |
112 | 113 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/common/column.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 17 | 18 |
19 | 20 | 发表新帖 21 |
22 |
23 | 发表新帖 24 |
25 |
26 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/common/filter.html: -------------------------------------------------------------------------------- 1 |
2 | 综合 3 | 4 | 未结 5 | 6 | 已结 7 | 8 | 精华 9 | 10 | 按最新 11 | 12 | 按热议 13 | 14 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/common/footer.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/common/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 | 17 | 18 |
    19 | 20 | 21 |
  • 22 | 23 |
  • 24 |
  • 25 | 登入 26 |
  • 27 |
  • 28 | 注册 29 |
  • 30 |
  • 31 | 32 |
  • 33 |
  • 34 | 35 |
  • 36 | 37 | 38 | 55 | 56 |
57 |
58 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/common/link.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/common/user-nav.html: -------------------------------------------------------------------------------- 1 | 27 | 28 |
29 | 30 |
31 |
32 | 33 |
34 | 35 |
36 |
-------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/html/other/notice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 故障公告页 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 |
34 | 非常抱歉,社区正在维护,稍后恢复
文档 示例 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Back/Comment/edit.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhuqiu 4 | Date: 2020/2/10 5 | Time: 22:54 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page import="java.security.MessageDigest" %> 9 | <%@ page import="java.security.NoSuchAlgorithmException" %> 10 | <%--<%@ page import="com.zhuqiu.utils" %>--%> 11 | <%@ page language="java" contentType="text/html; charset=UTF-8" 12 | pageEncoding="UTF-8" %> 13 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 14 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 15 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 16 | <%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %> 17 | 18 | 19 | - 评论列表 20 | 21 | 22 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | 首页 36 | 评论列表 37 | 编辑评论 38 | 39 |
40 | 41 |
42 | 43 |
44 | 45 |
46 | 47 |
48 |
49 |
50 | 51 |
52 | 53 |
54 |
55 | 56 |
57 |
58 | 59 | 60 |
61 |
62 | 63 |
64 | 65 | 66 |
67 | 68 | 71 | 72 | 73 | <%@ include file="../Public/framework.jsp" %> 74 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Back/Comment/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhuqiu 4 | Date: 2020/2/10 5 | Time: 22:52 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page import="java.security.MessageDigest" %> 9 | <%@ page import="java.security.NoSuchAlgorithmException" %> 10 | <%--<%@ page import="com.zhuqiu.utils" %>--%> 11 | <%@ page language="java" contentType="text/html; charset=UTF-8" 12 | pageEncoding="UTF-8" %> 13 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 14 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 15 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 16 | <%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %> 17 | 18 | 19 | - 评论列表 20 | 21 | 22 | 28 | 29 | 30 | 31 |
32 | 33 | 首页 34 | 评论列表 35 | 36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 81 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
作者评论内容回复至提交于ID
59 | 60 | ${c.commentAuthorName} 61 | 63 | 64 | @ ${c.superAuthorName} 65 | 66 | ${c.commentContent} 67 |
68 | 69 | 70 | 回复 71 | 72 | 73 | | 74 | 编辑 75 | 76 | | 77 | 删除 78 | 79 |
80 |
82 | ${c.article.articleTitle} 84 | 86 | 87 | ${c.commentId}
95 | 96 | 99 |
100 | 101 | 102 |
103 | 104 | <%@ include file="../Public/framework.jsp" %> 105 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Back/Comment/reply.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhuqiu 4 | Date: 2020/2/10 5 | Time: 22:54 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page import="java.security.MessageDigest" %> 9 | <%@ page import="java.security.NoSuchAlgorithmException" %> 10 | <%--<%@ page import="com.zhuqiu.utils" %>--%> 11 | <%@ page language="java" contentType="text/html; charset=UTF-8" 12 | pageEncoding="UTF-8" %> 13 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 14 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 15 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 16 | <%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %> 17 | 18 | 19 | - 回复评论 20 | 21 | 22 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | 首页 36 | 评论列表 37 | 回复评论 38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | <%-- --%> 49 | 50 |
51 | 52 |
53 | 54 |
55 |
56 | 57 |
58 | 59 |
60 | 61 |
62 |
63 |
64 | 65 |
66 | 67 |
68 |
69 | 70 |
71 |
72 | 73 | 74 |
75 |
76 | 77 |
78 | 79 | 80 |
81 | 82 | 85 | 86 | 87 | <%@ include file="../Public/framework.jsp" %> 88 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Back/Public/paging.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | <%--分页 start--%> 5 | 81 | <%--分页 end--%> 82 | 83 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Back/User/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: Hanabi 4 | Date: 2020/2/10 5 | Time: 13:54 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page language="java" contentType="text/html; charset=UTF-8" 9 | pageEncoding="UTF-8" %> 10 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 11 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 12 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 13 | <%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %> 14 | 15 | 16 | - 用户列表 17 | 18 | 19 | 20 | 31 | 32 | 33 | 34 |
35 | 36 | 首页 37 | 用户列表 38 | 39 |
40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 67 | 70 | 73 | 76 | 80 | 83 | 84 | 85 | 86 | 87 |
用户名昵称文章数量评论数量操作ID
64 | 65 | ${u.userName} 66 | 68 | ${u.userNickname} 69 | 71 | ${u.userArticleCount} 72 | 74 | ${u.userCommentCount} 75 | 77 | 编辑 78 | 删除 79 | 81 | ${u.userId} 82 |
88 | 89 |
90 | 91 | 94 | 95 | 96 | <%@ include file="../Public/framework.jsp" %> 97 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Home/Category/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: Hanabi 4 | Date: 2020/2/25 5 | Time: 20:53 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page language="java" contentType="text/html; charset=UTF-8" 9 | pageEncoding="UTF-8" %> 10 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 11 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 12 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 13 | <%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %> 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 | 文章分类面板 25 |
26 | 27 |
28 |
    29 | 30 | 31 |
    32 |

    33 | ${tree.parentName} 34 | ${tree.allCount} 35 |

    36 | 37 |
    38 |
    39 |
    40 |

    41 | ${child.childName} 42 | ${child.articleCount} 43 |

    44 |
    45 |
    46 |
    47 |
    48 |
    49 |
    50 | 51 |
52 |
53 |
54 |
55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | <%-- --%> 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Home/Public/framework.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: Hanabi 4 | Date: 2020/2/23 5 | Time: 22:47 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page language="java" contentType="text/html; charset=UTF-8" 9 | pageEncoding="UTF-8" %> 10 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 11 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 12 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 13 | <%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %> 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Ks社区 22 | <rapid:block name="title"></rapid:block> 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |
35 | 38 | 49 | 50 | 68 | 69 | 70 |
    71 | 72 |
  • 73 | 74 |
  • 75 |
  • 76 | 登入 77 |
  • 78 |
  • 79 | 注册 80 |
  • 81 |
82 |
83 |
84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/view/Home/User/comment.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: Hanabi 4 | Date: 2020/2/23 5 | Time: 14:17 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html; charset=UTF-8" language="java" %> 9 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 10 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 11 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 12 | <%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %> 13 | 14 | 15 |
16 |
17 |
    18 |
  • 我的回复(${user.userCommentCount}
  • 19 |
20 |
21 |
22 |
    23 | 24 | 25 |
    没有任何评论
    26 |
    27 | 28 |
  • 29 |

    30 | 32 | 在${comment.articleTitle}中回答:${comment.commentContent} 33 |

    34 |
  • 35 |
    36 | 37 |
38 | 39 |
40 |
41 |
42 |
43 |
44 |
45 | 46 | 47 | 52 | 53 | 54 | 55 | <%@ include file="../Public/user_framework.jsp" %> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | /WEB-INF/view/Home/index.jsp 10 | 11 | 12 | 13 | DispatcherServlet 14 | org.springframework.web.servlet.DispatcherServlet 15 | 16 | contextConfigLocation 17 | classpath:spring/applicationContext.xml 18 | 19 | 1 20 | 21 | 22 | DispatcherServlet 23 | / 24 | 25 | 26 | 27 | 28 | 29 | encodingFilter 30 | 31 | org.springframework.web.filter.CharacterEncodingFilter 32 | 33 | 34 | encoding 35 | utf-8 36 | 37 | 38 | forceEncoding 39 | false 40 | 41 | 42 | 43 | encodingFilter 44 | /* 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.web.context.request.RequestContextListener 51 | 52 | 53 | 54 | 55 | HiddenHttpMethodFilter 56 | org.springframework.web.filter.HiddenHttpMethodFilter 57 | 58 | 59 | HiddenHttpMethodFilter 60 | /* 61 | 62 | 63 | 64 | 65 | DruidWebStatFilter 66 | com.alibaba.druid.support.http.WebStatFilter 67 | 68 | exclusions 69 | *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* 70 | 71 | 72 | 73 | DruidWebStatFilter 74 | /* 75 | 76 | 77 | 78 | 79 | 15 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | *.jsp 103 | true 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/webapp/statics/css/full.css: -------------------------------------------------------------------------------- 1 | /*! 默认风格 */ 2 | 3 | html body{margin-top:0; margin-left: 136px;} 4 | html .fly-full{margin-top: 0;} 5 | 6 | .main{width:auto; margin:15px 24px 15px 24px;} 7 | .content{margin-right: 360px;} 8 | .jie-row li .jie-title{max-width:70%;} 9 | 10 | /* 头部 */ 11 | .header{width:136px; height:100%;} 12 | .header .main{position: static; width:auto;} 13 | .logo{top:20px; left:50%; width:86px; height:74px; margin-left:-43px; background:url(../../res/images/logo-1.png);} 14 | .nav{position:relative; left:0; top:110px; border-top:1px solid #282C35;} 15 | .nav a{display:block; height:50px; line-height:50px; padding:0; text-align:center;} 16 | .nav a:first-child{border-top:1px solid #424857;} 17 | .nav-user span{margin-top: 10px;} 18 | 19 | .icon-touxiang{font-size: 60px;} 20 | 21 | .nav-user{top: auto; bottom:20px; left:0; width:100%;} 22 | .nav-user span, 23 | .nav-user .unlogin, 24 | .out-login, 25 | .avatar, 26 | .avatar cite, 27 | .nav-user .nav{display:block; *display:block; text-align:center;} 28 | .nav-user span{top: 0;} 29 | .nav-user span a{padding:0 6px;} 30 | .nav-user .unlogin{margin-right: 0;} 31 | .out-login{margin-left:0; margin-top:20px;} 32 | .out-login a{ padding:0 5px;} 33 | .nav-user .nav{position:relative; margin-left: 0; margin-top: 15px;} 34 | 35 | .avatar img{width:60px; height:60px;} 36 | .avatar cite{margin-left: 0; margin-top:10px; } 37 | .avatar i{margin-left: 0;} 38 | 39 | .nav-message{left: auto; right: 10px;} 40 | 41 | /* 适配 */ 42 | @media screen and (max-width: 1024px) { 43 | html body{margin-left: 140px;} 44 | .main{margin: 15px 10px;} 45 | .content{margin: 0;} 46 | .edge{display:none} 47 | } 48 | 49 | @media screen and (max-width: 750px) { 50 | html body{margin-left:0;} 51 | .header{left:-140px;} 52 | .edge{display: block;} 53 | } 54 | -------------------------------------------------------------------------------- /src/main/webapp/statics/css/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/css/iconfont.eot -------------------------------------------------------------------------------- /src/main/webapp/statics/css/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/css/iconfont.ttf -------------------------------------------------------------------------------- /src/main/webapp/statics/css/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/css/iconfont.woff -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/0.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/00.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/00.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/10.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/11.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/6.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/7.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/8.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/9.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/avatar/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/avatar/default.png -------------------------------------------------------------------------------- /src/main/webapp/statics/img/case.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/case.png -------------------------------------------------------------------------------- /src/main/webapp/statics/img/fly.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/fly.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/logo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/logo-1.png -------------------------------------------------------------------------------- /src/main/webapp/statics/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/logo.png -------------------------------------------------------------------------------- /src/main/webapp/statics/img/other/1437100018023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/other/1437100018023.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/img/other/study-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/other/study-a.png -------------------------------------------------------------------------------- /src/main/webapp/statics/img/weixin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/img/weixin.jpg -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | @mixin sr-only { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | @mixin sr-only-focusable { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/font/iconfont.eot -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/font/iconfont.woff -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/font/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/font/iconfont.woff2 -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/0.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/1.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/10.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/11.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/12.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/13.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/14.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/15.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/16.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/17.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/18.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/19.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/2.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/20.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/21.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/22.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/23.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/24.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/25.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/26.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/27.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/28.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/29.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/3.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/30.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/31.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/32.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/33.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/34.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/35.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/36.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/37.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/38.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/39.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/4.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/40.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/41.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/42.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/43.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/44.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/45.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/46.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/47.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/48.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/49.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/5.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/50.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/51.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/52.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/53.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/54.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/55.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/56.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/57.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/58.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/59.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/6.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/60.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/61.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/62.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/63.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/64.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/65.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/66.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/67.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/68.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/69.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/7.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/70.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/71.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/8.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HermitZheng/KsForum/51741f5302ada3d753a022d147cbb2cb661d3214/src/main/webapp/statics/plugin/layui/images/face/9.gif -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
    ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),!i&&f.width()&&(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
    ",u=1;u<=i.length;u++){var r='
  • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
  • ":n+=r}n+="
"+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.6 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],u=t(['
    ',e.bar1?'
  • '+c[0]+"
  • ":"",e.bar2?'
  • '+c[1]+"
  • ":"",'
  • '+c[2]+"
  • ","
"].join("")),g=u.find("."+o),s=function(){var t=r.scrollTop();t>=e.showHeight?i||(g.show(),i=1):i&&(g.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&u.css(e.css),l.append(u),s(),u.find("li").on("click",function(){var i=t(this),n=i.attr("lay-type");"top"===n&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var n=this,a="function"==typeof t,o=new Date(e).getTime(),r=new Date(!t||a?(new Date).getTime():t).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var u=setTimeout(function(){n.countdown(e,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,u),l<=0&&clearTimeout(u),u},timeAgo:function(e,t){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>26784e5?(a=new Date(e),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),t||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=18e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var n=e.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(e,n,a){var o=t("body");return a=a||"click",n=i.event[e]=t.extend(!0,i.event[e],n)||{},i.event.UTIL_EVENT_CALLBACK=i.event.UTIL_EVENT_CALLBACK||{},o.off(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),i.event.UTIL_EVENT_CALLBACK[e]=function(){var i=t(this),a=i.attr(e);"function"==typeof n[a]&&n[a].call(this,i)},o.on(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),n}};!function(e,t,i){"$:nomunge";function n(){a=t[l](function(){o.each(function(){var t=e(this),i=t.width(),n=t.height(),a=e.data(this,u);(i!==a.w||n!==a.h)&&t.trigger(c,[a.w=i,a.h=n])}),n()},r[g])}var a,o=e([]),r=e.resize=e.extend(e.resize,{}),l="setTimeout",c="resize",u=c+"-special-event",g="delay",s="throttleWindow";r[g]=250,r[s]=!0,e.event.special[c]={setup:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.add(t),e.data(this,u,{w:t.width(),h:t.height()}),1===o.length&&n()},teardown:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.not(t),t.removeData(u),o.length||clearTimeout(a)},add:function(t){function n(t,n,o){var r=e(this),l=e.data(this,u)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[s]&&this[l])return!1;var a;return e.isFunction(t)?(a=t,n):(a=t.handler,void(t.handler=n))}}}(t,window),e("util",i)}); -------------------------------------------------------------------------------- /src/main/webapp/statics/plugin/layui/mobile/layer.js: -------------------------------------------------------------------------------- 1 | /*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */ 2 | ;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'

'+(e?n.title[0]:n.title)+"

":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),'
'+e+"
"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='

'+(n.content||"")+"

"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"
':"")+'
"+l+'
'+n.content+"
"+c+"
",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o map = new HashMap<>(); 51 | map.put("keywords", "测试"); 52 | List
articleList = articleService.listArticle(map); 53 | 54 | System.out.println(articleList); 55 | } 56 | 57 | @Test 58 | @Transactional //标明此方法需使用事务 59 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 60 | public void setCategory(){ 61 | Article article = articleService.findArticleById(1); 62 | Category category = new Category(1, "Java"); 63 | List categoryList = new ArrayList<>(); 64 | categoryList.add(category); 65 | article.setCategoryList(categoryList); 66 | 67 | articleService.updateArticleDetail(article); 68 | 69 | System.out.println(articleService.findArticleByTitle("测试")); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/test/java/service/CategoryTest.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | import com.zhuqiu.pojo.Article; 4 | import com.zhuqiu.pojo.Category; 5 | import com.zhuqiu.service.ArticleService; 6 | import com.zhuqiu.service.CategoryService; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.test.annotation.Rollback; 11 | import org.springframework.test.context.ContextConfiguration; 12 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 13 | import org.springframework.test.context.web.WebAppConfiguration; 14 | import org.springframework.transaction.annotation.Transactional; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | /** 20 | * @author zhuqiu 21 | * @date 2020/2/6 22 | */ 23 | 24 | @RunWith(SpringJUnit4ClassRunner.class) 25 | @ContextConfiguration(locations={"classpath:spring/applicationContext.xml"}) 26 | @WebAppConfiguration 27 | public class CategoryTest { 28 | 29 | @Autowired 30 | private ArticleService articleService; 31 | 32 | @Autowired 33 | private CategoryService categoryService; 34 | 35 | @Test 36 | @Transactional //标明此方法需使用事务 37 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 38 | public void insertCategory(){ 39 | Category category = new Category("Java"); 40 | // categoryService.insertCategory(category); 41 | 42 | List categoryList = categoryService.listCategory(); 43 | 44 | System.out.println(categoryList); 45 | } 46 | 47 | @Test 48 | @Transactional //标明此方法需使用事务 49 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 50 | public void listCategory(){ 51 | List categoryList = categoryService.listCategoryWithArticleCount(); 52 | for (Category category : categoryList) { 53 | System.out.println(category); 54 | } 55 | } 56 | 57 | @Test 58 | @Transactional //标明此方法需使用事务 59 | @Rollback(true) //标明使用完此方法后事务不回滚,true时为回滚 60 | public void insertRecord(){ 61 | Article article = new Article(); 62 | ArrayList categoryList = new ArrayList<>(); 63 | categoryList.add(new Category(2)); 64 | article.setCategoryList(categoryList); 65 | article.setArticleId(1); 66 | 67 | articleService.updateArticleDetail(article); 68 | System.out.println(categoryService.listCategoryByArticleId(article.getArticleId())); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/test/java/service/CommentTest.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | import com.zhuqiu.pojo.Comment; 4 | import com.zhuqiu.service.CommentService; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.test.annotation.Rollback; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | import org.springframework.test.context.web.WebAppConfiguration; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.util.Date; 15 | import java.util.List; 16 | 17 | /** 18 | * @author zhuqiu 19 | * @date 2020/2/6 20 | */ 21 | 22 | @RunWith(SpringJUnit4ClassRunner.class) 23 | @ContextConfiguration(locations={"classpath:spring/applicationContext.xml"}) 24 | @WebAppConfiguration 25 | public class CommentTest { 26 | 27 | @Autowired 28 | private CommentService commentService; 29 | 30 | @Test 31 | @Transactional //标明此方法需使用事务 32 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 33 | public void insertComment(){ 34 | Comment comment = new Comment(); 35 | comment.setArticleId(1); 36 | comment.setCommentAuthorId(1); 37 | comment.setCommentCreateTime(new Date()); 38 | comment.setCommentContent("第一篇文章的第一条评论测试。"); 39 | 40 | commentService.insertComment(comment); 41 | 42 | List comments = commentService.listRecentComment(1); 43 | 44 | System.out.println(comments); 45 | } 46 | 47 | @Test 48 | @Transactional //标明此方法需使用事务 49 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 50 | public void comment(){ 51 | List allComment = commentService.findAllComment(); 52 | for (Comment comment : allComment) { 53 | System.out.println(comment); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/service/RedisTest.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | /** 4 | * @author zhuqiu 5 | * @date 2020/3/20 6 | */ 7 | import com.zhuqiu.pojo.User; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.dao.DataAccessException; 12 | import org.springframework.data.redis.core.RedisOperations; 13 | import org.springframework.data.redis.core.RedisTemplate; 14 | import org.springframework.data.redis.core.SessionCallback; 15 | import org.springframework.test.annotation.Rollback; 16 | import org.springframework.test.context.ContextConfiguration; 17 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 18 | import org.springframework.test.context.web.WebAppConfiguration; 19 | import org.springframework.transaction.annotation.Transactional; 20 | 21 | @RunWith(SpringJUnit4ClassRunner.class) 22 | @ContextConfiguration(locations={"classpath:spring/applicationContext.xml"}) 23 | @WebAppConfiguration 24 | public class RedisTest { 25 | 26 | @Autowired 27 | RedisTemplate redisTemplate; 28 | 29 | // @Before 30 | // public void before(){ 31 | // ApplicationContext ctx = new ClassPathXmlApplicationContext(); 32 | // redisTemplate = ctx.getBean(RedisTemplate.class); 33 | // } 34 | 35 | @Test 36 | @Transactional //标明此方法需使用事务 37 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 38 | public void Test01() { 39 | User user = new User(); 40 | user.setUserName("redisTest"); 41 | user.setUserNickname("redis"); 42 | user.setUserPass("wofole"); 43 | user.setUserProfile("爷是redis机器人一号嘻嘻"); 44 | 45 | //存储到到内存中的不是map而是string,进行了序列化 46 | redisTemplate.opsForValue().set("user_1", user); 47 | User user1 = (User) redisTemplate.opsForValue().get("user_1"); 48 | //上面两步不能保证每次使用RedisTemplate是操作同一个对Redis的连接 49 | 50 | System.out.println(user1.toString()); 51 | } 52 | 53 | @Test 54 | @Transactional //标明此方法需使用事务 55 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 56 | public void Test02(){ 57 | User user = new User(); 58 | user.setUserName("redisTest"); 59 | user.setUserNickname("redis"); 60 | user.setUserPass("wofole"); 61 | user.setUserProfile("爷是redis机器人一号嘻嘻"); 62 | 63 | SessionCallback callback = new SessionCallback(){ 64 | public User execute(RedisOperations ops) throws DataAccessException { 65 | ops.boundValueOps("role_1").set(user); 66 | return (User) ops.boundValueOps("role_1").get(); 67 | } 68 | }; 69 | User savedRole = (User) redisTemplate.execute(callback); 70 | System.out.println(savedRole.getUserName()); 71 | } 72 | 73 | 74 | } -------------------------------------------------------------------------------- /src/test/java/service/UserServiceTest.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | import com.zhuqiu.pojo.User; 4 | import com.zhuqiu.service.UserService; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.test.annotation.Rollback; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | import org.springframework.test.context.web.WebAppConfiguration; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | /** 15 | * @author zhuqiu 16 | * @date 2020/2/5 17 | */ 18 | 19 | @RunWith(SpringJUnit4ClassRunner.class) 20 | @ContextConfiguration(locations={"classpath:spring/applicationContext.xml"}) 21 | @WebAppConfiguration 22 | public class UserServiceTest { 23 | 24 | @Autowired 25 | private UserService userService; 26 | 27 | @Test 28 | @Transactional //标明此方法需使用事务 29 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 30 | public void insertUser(){ 31 | User user = new User(); 32 | user.setUserName("test1"); 33 | user.setUserNickname("Robot1"); 34 | user.setUserPass("wofole"); 35 | user.setUserProfile("爷是测试机器人一号嘻嘻"); 36 | 37 | User user1 = userService.insertUser(user); 38 | System.out.println(user1); 39 | } 40 | 41 | @Test 42 | @Transactional //标明此方法需使用事务 43 | @Rollback(true) //标明使用完此方法后事务不回滚,true时为回滚 44 | public void findName(){ 45 | User user = userService.findUserByName("register1"); 46 | System.out.println(user==null); 47 | } 48 | 49 | @Test 50 | @Transactional //标明此方法需使用事务 51 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚 52 | public void findUser(){ 53 | // User user = userService.findUserById(1); 54 | // List userList = userService.findAllUser(); 55 | User user = userService.findUserById(1); 56 | // for (User user : userList) { 57 | // System.out.println(user); 58 | // } 59 | System.out.println(user); 60 | 61 | } 62 | 63 | @Test 64 | @Transactional //标明此方法需使用事务 65 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚` 66 | public void updateUser(){ 67 | User user = userService.findUserById(1); 68 | user.setUserNickname("ROBOT1"); 69 | 70 | userService.updateUser(user); 71 | System.out.println(userService.findUserById(1)); 72 | } 73 | 74 | @Test 75 | @Transactional //标明此方法需使用事务 76 | @Rollback(false) //标明使用完此方法后事务不回滚,true时为回滚` 77 | public void setFavorite(){ 78 | userService.addFavorite(1, 1); 79 | System.out.println(userService.countUserFavorite(1)); 80 | } 81 | } 82 | --------------------------------------------------------------------------------