——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven知识库管理系统(java+ssm+bootstrap+jquery+mysql+jsp)
项目介绍
文件集中上传:系统支持单文件上传以及批量上传,系统支持zip、rar格式的压缩包导入。亮点创新 多格式文件在线预览 用户可以对所有公共文件进行浏览,支持office,pdf格式以及常见图片格式,音频格式,音频播放以流媒体服务搭载实现边下边播的用户体验。 文档链接:系统支持用户对喜爱的文档进行收藏及发送到常用文档。 文档关联:手动关联:用户可以手动对文件关联相关的文件。 自动关联:系统可以自动关联类似文档 规则使用:系统对用户上传的过大文件(视频)进行压缩来加快用户在线预览打开的速度,对文档自动提取简介和关键词。对视频、office等文件提取缩略图。 系统中可增加词典,增强分词效果 智能检索:系统包含全文检索、多重条件检索、关键词检索。同时还支持对检索结果再次附加条件检索。 用户管理:普通用户可以对自己的文件夹、收藏夹管理。用户可以分享自己的文档到公共资源库中。 管理员可以对系统中的用户管理、公共文件审核,系统分类的管理,一些数据的统计和日志记录的查看 用户评论:用户可以对文档进行评论 文本处理:能够支持中文,人名、组织机构名、时间、地名、目标类型、目标名称等实体识别,能对常见文本格式抽取。 文档推荐:系统使用协同过滤算法推荐用户可能会查看的文档 知识图谱:系统中的知识以树结构存放,可以通过知识图谱快速到达你要找的知识点。对于每个节点都有详细的介绍。 智能提取:系统结合PageRank、TF-IDF等算法组织知识点在我们的库中,用户可以通过半自动化的操作,去提取归纳知识,产生新的文档。 信息统计:系统对文档的数据进行统计分析,以图表的方式呈现。 新建文档:用户可以使用在线多功能编辑器新建文档
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目:是; 查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7版本;
技术栈
spring+spring mvc+mybatis+bootstrap+jquery
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择 maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置 4. 运行项目,在浏览器中输入http://localhost:8080/lib/login 登录 5. 登录账号:11184629 密码:123456
注意事项
需要先安装openoffice,下载地址:http://www.openoffice.org/download/index.html 并在TranslateUtils中修改相关路径;
——————————CodeStart——————————
1 2 3 4 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 @ResponseBody @RequestMapping(value = "/remove-userList", method ={ RequestMethod.POST,RequestMethod.GET}) public JsonResult removeUserList (String userList) { JsonResult jsonResult = null ; try { String users[] = userList.split("A" ); List<Long>list = new ArrayList<Long>(); int i = 0 ; if ("on" .equals(users[0 ])){ i = 1 ; } for (;i<users.length;i++){ list.add( Long.parseLong(users[i])); } for (i = 0 ;i<list.size();i++){ userService.deleteUserByUserId(list.get(i)); } jsonResult = new JsonResult(true , "success" ); jsonResult.setData("success" ); }catch (Exception e) { jsonResult = new JsonResult(false , "error" ); } return jsonResult; } @ResponseBody @RequestMapping(value = "/send-msg", method ={ RequestMethod.POST,RequestMethod.GET}) public JsonResult sendMessage (Long userId,String msgTitle,String msgContent) { JsonResult jsonResult = null ; try { MessageInfo msg = new MessageInfo(); msg.setMsgTitle(msgTitle); msg.setMsgContent(msgContent); msg.setIsRead(false ); msg.setUserId(userId); msg.setMsgTime(new Date()); msgService.insertMsg(msg); jsonResult = new JsonResult(true , "success" ); jsonResult.setData("success" ); }catch (Exception e){ jsonResult = new JsonResult(true , "error" ); } return jsonResult; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 String path = Const.ROOT_PATH + "users/" + user.getUserId() + "/photo/" + userPhoto + ".png" ; try { InputStream inputStream = new FileInputStream(path); OutputStream os = response.getOutputStream(); byte [] b = new byte [2048 ]; int length; while ((length = inputStream.read(b)) > 0 ) { os.write(b, 0 , length); } os.close(); inputStream.close(); } catch (FileNotFoundException e) { LOG.error("文件没有找到" + path); } catch (IOException e) { } return null ; } } package com.lib.web.user.main;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 LOG.error("文件没有找到" + path); } catch (IOException e) { } return null ; } } package com.lib.web.user.main;
1 2 3 4 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 32 33 34 35 36 @Controller @RequestMapping("/user") public class MainController { @Autowired private FileManageService fileManageService; @Autowired private UserService userService; @Autowired private AdminCountService countService; @Autowired private CountService ctService; private final Logger LOG = LoggerFactory.getLogger(this .getClass()); @RequestMapping(value = "/count-today", method = RequestMethod.GET) public @ResponseBody JsonResult<Long> getTodaysUpload () { Long count = countService.getTodaysUpload(); JsonResult<Long> jr = new JsonResult<Long>(true , count); return jr; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 return "admin/file-manage" ; } } package com.lib.interceptor;public class AdminInterceptor implements HandlerInterceptor { @Autowired private UserService userService; @Override public void afterCompletion (HttpServletRequest request, HttpServletResponse response, Object object, Exception exception) throws Exception { }
1 2 3 4 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 32 33 34 35 36 37 38 39 40 41 42 43 44 /** * 注册校验 * * @param user * @param repassword * @param request * @param response * @return * @throws IOException */ @RequestMapping(value = "/check", method = { RequestMethod.GET, RequestMethod.POST }) public String checkRegister(UserInfo user, String repassword, HttpServletRequest request, HttpServletResponse response) throws IOException { String result = null; if (user.getUserEmail() != null) { String regex = "^[\\w-]+(\\.[\\w-]+)*\\@([\\.\\w-]+)+$"; boolean flg = Pattern.matches(regex, user.getUserEmail()); if (flg) { if (userService.checkByEmail(user.getUserEmail())) { result = "<font class ='am-btn-success' > 该邮箱未被注册</font > "; } else { result = "<font class ='am-btn-danger' > 该邮箱已被注册</font > "; } } else { result = "<font class ='am-btn-danger' > 邮箱格式不正确</font > "; } } if (user.getUserPassword() != null || user.getUserPassword() != null && repassword != null) { String regex = "^\\w{5,12}$"; boolean flg = Pattern.matches(regex, user.getUserPassword()); if (flg) { result = "<font class ='am-btn-success' > 正常</font > "; } else { result = "<font class ='am-btn-danger' > 密码必须5-12个字符组成 </font > "; } } if (user.getUserPassword() != null && repassword != null) { String strConfirm = new String(user.getUserPassword()); String strPwd = new String(repassword); if (strConfirm.equals(strPwd)) { result = "<font class ='am-btn-success' > 密码一致</font > "; } else { result = "<font class ='am-btn-danger' > 两次密码输入不一致,请重新输入</font > ";
——————————PayStart——————————
项目链接: https://javayms.github.io?id=201422292105200eu https://javayms.pages.dev?id=201422292105200eu