选课推荐交流平台系统基于java|选课推荐交流平台系统基于java ssm springboot实现
目录
- 主要功能模块设计:
- 主要技术:
- 主要功能实现前端:
- 选课平台首页:
- 登录注册管理:
- 选课推荐分类:
- 课程详情信息:
- 我的个人中心:
- 主要功能实现后台:
- 系统主页设计:
- 选课类型管理:
- 选课信息详情管理:
- 通知公告信息:
- 用户信息管理:
- 评论交流回复管理:
- 部分关键代码展示:
- 登录模块:
- 配置模块:
- 主要表设计:
- 用户表:
- 选课类型表:
- 选课详情表:
- 评论交流表:
- 回复信息表:
文章图片
话不多说、直接进入主题
主要功能模块设计: 登录注册、首页信息浏览、选课分类查看、选课详情查看、评论交流、收藏、浏览量、以及后台数据管理、用户管理、选课类别管理、选课信息详情管理、评论交流和回复管理、以及公告信息管理等
主要技术: Java、springmvc、mybatis、mysql、tomcat、jquery、layui、JavaScript、html、css、jsp、log4j等一些常见的基本技术。
主要功能实现前端:
选课平台首页:
输入
http://localhost
/访问选课推荐交流平台首页、可以查看轮播图以及各类信息、点击进入详情页面文章图片
文章图片
登录注册管理:
文章图片
选课推荐分类:
点击查看分类课程推荐信息、按照类别查看课程信息、管理员可以在后台添加课程分类信息
以及根据访问量来进行点击排行、
文章图片
课程详情信息:
课程详情可以查看课程详情信息以及作者信息和浏览量等具体数据、也可以进行评论和收藏等操作
文章图片
文章图片
我的个人中心:
包括我的个人信息和收藏夹信息、
文章图片
主要功能实现后台:
系统主页设计: 主要功能模块有首页的信息统计、选课类型管理、选课详情管理、用户管理、评论和公告管理等数据维护。
文章图片
选课类型管理:
文章图片
选课信息详情管理: 列表信息查看添加修改删除以及检索等操作
文章图片
详情信息
文章图片
通知公告信息: 数据列表查看和添加修改删除等操作
文章图片
用户信息管理:
文章图片
评论交流回复管理: 评论和回复的数据管理
文章图片
部分关键代码展示:
登录模块:
package com.longwang.controller; import com.longwang.entity.Article; import com.longwang.entity.Classify; import com.longwang.entity.User; import com.longwang.service.ArticleService; import com.longwang.service.ClassifyService; import com.longwang.service.NoticeService; import com.longwang.service.UserService; import com.longwang.util.DateUtil; import com.longwang.util.StringUtil; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.io.File; import java.util.*; /** * 根路径以及其他请求处理 * * @author 李杨勇 * */@Controllerpublic class IndexController { @Value("${imageFilePath}")private String imageFilePath; // 文件路径 @Resourceprivate NoticeService noticeService; @Resourceprivate UserService userService; @Resourceprivate ArticleService articleService; @Resourceprivate ClassifyService classifyService; @RequestMapping("/")public String index(HttpSession session) { // 查询公告session.setAttribute("noticeList", noticeService.list(0, 5)); return "index"; // 跳转到index.html} @RequestMapping("/delete")public Map delete(Integer userId) {Map resultMap = new HashMap(); userService.delete(userId); resultMap.put("errorNo", 0); return resultMap; }/*** 登录页面* * @return*/@RequestMapping("/login")public String login() {return "login"; } /*** 前台登录页面* * @return*/@RequestMapping("/webLogin")public String webLogin() {return "webLogin"; } /*** 注册* * @return*/@RequestMapping("/regist")public String regist() {return "regist"; } /*** 保存注册信息* * @param user* @return*/@RequestMapping("/saveUser")public String saveUser(User user) {List randomArticle = articleService.getRandomArticle(3); String ids=""; for (int i = 0; i < randomArticle.size(); i++) {Integer articleId = randomArticle.get(i).getArticleId(); ids+=articleId+","; }ids = ids.substring(0, ids.length() -1); user.setArticleIds(ids); userService.save(user); return "webLogin"; } /*** 退出登录* * @param request* @return*/@RequestMapping("/quit")public String quit(HttpServletRequest request) {HttpSession session = request.getSession(); session.removeAttribute("user"); return "index"; } /*** 退出登录* * @param request* @return*/@RequestMapping("/quitAdmin")public String quitAdmin(HttpServletRequest request) {HttpSession session = request.getSession(); session.removeAttribute("user"); return "login"; } /*** 验证登录** @param user* @param request* @return*/@RequestMapping("/checkLogin")public ModelAndView checkLogin(User user, HttpServletRequest request) {ModelAndView mav = new ModelAndView(); HttpSession session = request.getSession(); User u = userService.findByUsernameAndPassword(user.getUsername(), user.getPassword()); if (u == null) {mav.addObject("user", user); mav.addObject("errorInfo", "用户名或者密码错误!"); mav.setViewName("webLogin"); } else {u.setLatelyLoginTime(new Date()); userService.save(u); session.setAttribute("user", u); mav.addObject("username", u.getUsername()); mav.addObject("user", u); mav.addObject("success", true); mav.setViewName("/index"); }return mav; } /*** 查看个人信息* * @return*/@RequestMapping("viewPerson")public ModelAndView viewPerson(HttpServletRequest request) {User user = (User) request.getSession().getAttribute("user"); ModelAndView mav = new ModelAndView(); User u = userService.findById(user.getUserId()); mav.addObject("user", u); mav.setViewName("/viewPerson"); return mav; } /*** 查看个人课程收藏夹* * @return*/@RequestMapping("viewCollection")public ModelAndView viewCollection(HttpServletRequest request, HttpSession session) {User user = (User) request.getSession().getAttribute("user"); ModelAndView mav = new ModelAndView(); User u = userService.findById(user.getUserId()); String artIds = u.getArticleIds(); List result = new ArrayList<>(); if (StringUtils.isNotBlank(artIds)) {result = Arrays.asList(StringUtils.split(artIds, ",")); }ListretIds = new ArrayList<>(); for (String temp : result) {retIds.add(Integer.valueOf(temp).intValue()); }List retArt = articleService.findByListId(retIds); session.setAttribute("noticeList", noticeService.list(0, 5)); mav.addObject("retArt", retArt); mav.addObject("user", u); mav.setViewName("/viewCollection"); return mav; } /*** 查看个人关注用户* * @return*/@RequestMapping("viewFocusUser")public ModelAndView viewFocusUser(HttpServletRequest request, HttpSession session) {User user = (User) request.getSession().getAttribute("user"); ModelAndView mav = new ModelAndView(); User u = userService.findById(user.getUserId()); String userIds = u.getUserIds(); List result = new ArrayList<>(); if (StringUtils.isNotBlank(userIds)) {result = Arrays.asList(StringUtils.split(userIds, ",")); }List retIds = new ArrayList<>(); for (String temp : result) {retIds.add(Integer.valueOf(temp).intValue()); }List retArt = userService.findByListId(retIds); session.setAttribute("noticeList", noticeService.list(0, 5)); mav.addObject("retArt", retArt); mav.addObject("user", u); mav.setViewName("/viewFocusUser"); return mav; } /*** 保存用户信息* * @param user* @return*/@RequestMapping("/save")public ModelAndView save(User user) {ModelAndView mav = new ModelAndView(); userService.save(user); mav.setViewName("/index"); return mav; } /*** 写笔记页面* * @param request* @return*/// @RequestMapping("notePage")// public String notePage(HttpServletRequest request, Model model) {// User user = (User) request.getSession().getAttribute("user"); // if (user == null) {// return "webLogin"; // }// List list = classifyService.findAll(); // model.addAttribute("list", list); // return "one"; // } @RequestMapping("notePage")public ModelAndView notePage(HttpServletRequest request) {ModelAndView mav = new ModelAndView(); User user = (User) request.getSession().getAttribute("user"); if (user == null) {mav.setViewName("/webLogin"); return mav; }List list = classifyService.findAll(); mav.addObject("list", list); mav.setViewName("/one"); return mav; } /*** 保存笔记* * @param article* @param request* @return*/@RequestMapping("addNote")public ModelAndView addNote(Article article, HttpServletRequest request) {ModelAndView mav = new ModelAndView(); // 获取当前用户信息User user = (User) request.getSession().getAttribute("user"); article.setUserId(user.getUserId()); article.setPublishDate(new Date()); article.setClick(0); article.setCommentNum(0); article.setContentNoTag(StringUtil.Html2Text(article.getContent())); articleService.save(article); mav.setViewName("/index"); return mav; } @RequestMapping("saveNote")public ModelAndView saveNote(Article article, HttpServletRequest request) {ModelAndView mav = new ModelAndView(); Article a = articleService.findById(article.getArticleId()); article.setPublishDate(a.getPublishDate()); // 获取当前用户信息articleService.save(article); mav.setViewName("/index"); return mav; } /*** 查看笔记* * @return*/@RequestMapping("viewNote")public String viewNote(HttpSession session) {session.setAttribute("noticeList", noticeService.list(0, 5)); return "mylist"; } @RequestMapping("/delete/{id}")public String delete(@PathVariable(value = "https://www.it610.com/article/id") String id) throws Exception {articleService.delete(Integer.parseInt(id)); return "mylist"; } /*** 查看个人笔记加载数据列表* * @param article* @param publishDates* @param page* @param pageSize* @return*/@RequestMapping("/mylist")public Map list(Article article,@RequestParam(value = "https://www.it610.com/article/publishDates", required = false) String publishDates,@RequestParam(value = "https://www.it610.com/article/page", required = false) Integer page,@RequestParam(value = "https://www.it610.com/article/pageSize", required = false) Integer pageSize, HttpServletRequest request) {Map resultMap = new HashMap(); // User user = (User) request.getSession().getAttribute("user"); // article.setUserId(user.getUserId()); String s_bPublishDate = null; // 开始时间String s_ePublishDate = null; // 结束时间if (StringUtil.isNotEmpty(publishDates)) {String[] strs = publishDates.split(" - "); // 拆分时间段s_bPublishDate = strs[0]; s_ePublishDate = strs[1]; }Long total = articleService.getCount(article, s_bPublishDate, s_ePublishDate); int totalPage = (int) (total % pageSize == 0 ? total / pageSize : total / pageSize + 1); // 总页数resultMap.put("totalPage", totalPage); resultMap.put("errorNo", 0); resultMap.put("data", articleService.list(article, s_bPublishDate, s_ePublishDate, page - 1, pageSize)); resultMap.put("total", total); return resultMap; } /*** 后台默认首页* * @return*/@RequestMapping("/index")public String root() {return "/common/index"; } /*** 博主信息页面* * @return*/@RequestMapping("/blogger")public String blogger() {return "/blogger/index"; } /*** 图片上传处理 @Title: ckeditorUpload @param file 图片文件 @return 参数说明 @return* Map 返回类型 @throws*/@ResponseBody@RequestMapping("/upload")public Map ckeditorUpload(@RequestParam("file") MultipartFile file) {Map resultMap = new HashMap(); Map resultMap1 = new HashMap(); String fileName = file.getOriginalFilename(); // 获取文件名String suffixName = fileName.substring(fileName.lastIndexOf(".")); // 获取文件的后缀String newFileName = ""; try {newFileName = DateUtil.getCurrentDateStr() + suffixName; // 新文件名FileUtils.copyInputStreamToFile(file.getInputStream(), new File(imageFilePath + newFileName)); // 上传} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace(); }resultMap.put("code", 0); resultMap1.put("filePath", newFileName); resultMap.put("data", resultMap1); return resultMap; } }
配置模块:
server: port: 80servlet:context-path: /spring: datasource: driver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/choosing_courses?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghaiusername: rootpassword: 123456jpa:hibernate:ddl-auto: updateshow-sql: truedatabase-platform: org.hibernate.dialect.MySQLDialectthymeleaf:cache: false thymeleaf:prefix: classpath:/templates/ MD5Salt: longwang imageFilePath: C:\\Users\\Administrator\\Desktop\\choosingCourses\\src\\main\\webapp\\static\\images\\downloadImagePath:C:\\Users\\Administrator\\Desktop\\choosingCourses\\src\\main\\webapplucenePath: C:\\Users\\Administrator\\Desktop\\choosingCourses\\lucene
【选课推荐交流平台系统基于java|选课推荐交流平台系统基于java ssm springboot实现】
主要表设计:
用户表:
CREATE TABLE `NewTable` (`user_id`int(11) NOT NULL AUTO_INCREMENT ,`head_portrait`varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`lately_login_time`datetime NULL DEFAULT NULL ,`nickname`varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`registration_date`datetime NULL DEFAULT NULL ,`sex`varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`open_id`varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`password`varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`username`varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`article_ids`varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`birthday`date NULL DEFAULT NULL ,`momo`varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`phone`varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,`user_ids`varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,PRIMARY KEY (`user_id`))ENGINE=InnoDBDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ciAUTO_INCREMENT=20ROW_FORMAT=COMPACT;
选课类型表:
CREATE TABLE `NewTable` (`classify_id`int(11) NOT NULL AUTO_INCREMENT ,`classify_name`varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL ,PRIMARY KEY (`classify_id`))ENGINE=InnoDBDEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ciAUTO_INCREMENT=27ROW_FORMAT=COMPACT;
选课详情表:
CREATE TABLE `NewTable` (`article_id`int(11) NOT NULL AUTO_INCREMENT ,`author`varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL ,`click`int(11) NULL DEFAULT NULL ,`comment_num`int(11) NULL DEFAULT NULL ,`content`text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL ,`image_name`varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,`is_original`int(11) NULL DEFAULT NULL ,`is_top`int(11) NULL DEFAULT NULL ,`publish_date`datetime NULL DEFAULT NULL ,`title`varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL ,`classify_id`int(11) NULL DEFAULT NULL ,`user_id`int(11) NULL DEFAULT NULL ,PRIMARY KEY (`article_id`),FOREIGN KEY (`classify_id`) REFERENCES `t_classify` (`classify_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,INDEX `FKo4fros4yfq1m9ay7sgtlcvbc4` (`classify_id`) USING BTREE )ENGINE=InnoDBDEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ciAUTO_INCREMENT=58ROW_FORMAT=COMPACT;
评论交流表:
CREATE TABLE `NewTable` (`comment_id`int(11) NOT NULL AUTO_INCREMENT ,`comment_date`datetime NULL DEFAULT NULL ,`content`varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,`article_id`int(11) NULL DEFAULT NULL ,`user_id`int(11) NULL DEFAULT NULL ,PRIMARY KEY (`comment_id`),FOREIGN KEY (`article_id`) REFERENCES `t_article` (`article_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,INDEX `FKlsvvc2ob8lxg2m9qqry15ru0y` (`article_id`) USING BTREE ,INDEX `FKtamaoacctq4qpko6bvtv0ke1p` (`user_id`) USING BTREE )ENGINE=InnoDBDEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ciAUTO_INCREMENT=15ROW_FORMAT=COMPACT;
回复信息表:
CREATE TABLE `NewTable` (`reply_id`int(11) NOT NULL AUTO_INCREMENT ,`content`varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,`reply_date`datetime NULL DEFAULT NULL ,`comment_id`int(11) NULL DEFAULT NULL ,`user_id`int(11) NULL DEFAULT NULL ,PRIMARY KEY (`reply_id`),FOREIGN KEY (`comment_id`) REFERENCES `t_comment` (`comment_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,INDEX `FKk4ydp71wampdbnguly8iks4rf` (`comment_id`) USING BTREE ,INDEX `FKslt6r79iw1p9cbxns09erjv6v` (`user_id`) USING BTREE )ENGINE=InnoDBDEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ciAUTO_INCREMENT=6ROW_FORMAT=COMPACT;
到此这篇关于选课推荐交流平台系统基于java ssm springboot实现的文章就介绍到这了,更多相关交流平台系统内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
推荐阅读
- 成交的种子咖啡冥想
- 历史教学书籍
- 【亲测好用】高逼格配色网站推荐
- 推荐系统论文进阶|CTR预估 论文精读(十一)--Deep Interest Evolution Network(DIEN)
- 往前跑,向前冲??——勇气读书会推荐图书《阿甘正传》
- 电影推荐|电影推荐|《教父》
- 三D088期
- 算法回顾(SVD在协同过滤推荐系统中的应用)
- 自媒体平台思维及标题攻略
- 推荐两种减压方式