基于java+Springboot操作系统教学交流平台详细设计实现_基于spring boot和java的手语教学web平台的设计与实现

发布类型管理:

发布详情管理:

评论回复管理:


用户信息管理:

 个人中心管理:

主要代码类实现:

/**
 * 用户控制器
 * @author lyy
 *
 */
@RestController
@RequestMapping("/admin/user")
public class UserAdminController {

  @Resource
  private UserService userService;

  @Value("${MD5Salt}")
  private String salt; // md5加密盐

  /**
   * 根据ID查找用户
   * @param userId
   * @return
   */
  @RequestMapping("/findById")
  public Map<String, Object> findById(Integer userId) {
    Map<String, Object> resultMap = new HashMap<String, Object>();
    User user = userService.findById(userId);
    resultMap.put("errorNo", 0);
    resultMap.put("data", user);
    return resultMap;
  }

  /**
   * 分页查询用户
   * @param user
   * @param page
   * @return
   */
  @RequestMapping("/list")
  public Map<String, Object> list(User user,
      @RequestParam(value = "latelyLoginTimes", required = false) String latelyLoginTimes,
      @RequestParam(value = "page", required = false) Integer page,
      @RequestParam(value = "pageSize", required = false) Integer pageSize) {
    String s_bregistrationDate = null; // 开始时间
    String s_eregistrationDate = null; // 结束时间
    if (StringUtil.isNotEmpty(latelyLoginTimes)) {
      String[] strs = latelyLoginTimes.split(" - "); // 拆分时间段
      s_bregistrationDate = strs[0];
      s_eregistrationDate = strs[1];
    }
    List<User> userList = userService.list(user, s_bregistrationDate, s_eregistrationDate, page - 1, pageSize);
    Long total = userService.getCount(user, s_bregistrationDate, s_eregistrationDate);
    Map<String, Object> resultMap = new HashMap<String, Object>();
    resultMap.put("errorNo", 0);
    resultMap.put("data", userList);
    resultMap.put("total", total);
    return resultMap;
  }

  /**
   * 取消关注
   * @param request
   * @param userId
   * @return
   */
  @RequestMapping("/removeFocusUser")
  public ModelAndView removeFocusUser(HttpServletRequest request, String userId) {
    ModelAndView mav = new ModelAndView();
    User user = (User) request.getSession().getAttribute("user");// 当前登录用户

    String userIds = user.getUserIds();
    List<String> tempList = Arrays.asList(userIds.split(","));
    List<String> lineIdList = new ArrayList<>(tempList);
    lineIdList.remove(userId);
    String ret = StringUtils.join(lineIdList, ",");

    user.setUserIds(ret);

    userService.save(user);
    mav.setViewName("redirect:/viewFocusUser");
    return mav;
  }

  /**
   * 关注用户
   * @param request
   * @param userId
   * @return
   */
  @RequestMapping("/addFocusUser")
  public ModelAndView addFocusUser(HttpServletRequest request, String userId) {
    ModelAndView mav = new ModelAndView();
    User user = (User) request.getSession().getAttribute("user");// 当前登录用户

    String userIds = user.getUserIds();
    List<String> tempList = Arrays.asList(userIds.split(","));
    List<String> lineIdList = new ArrayList<>(tempList);
    lineIdList.add(userId);
    String ret = StringUtils.join(lineIdList, ",");

    user.setUserIds(ret);

    userService.save(user);
    mav.setViewName("redirect:/viewFocusUser");
    return mav;
  }

  @RequestMapping("/addFocusUser/{userId}")
  public ModelAndView addFocusUser(@PathVariable(value = "userId", required = false) Integer userId,
      HttpSession session) {
    ModelAndView mav = new ModelAndView();
    User user = (User) session.getAttribute("user");// 当前登录用户

    String userIds = user.getUserIds();
    List<String> tempList = new ArrayList<>();
    if (userIds != null) {
      tempList = Arrays.asList(userIds.split(","));
    }
    List<String> lineIdList = new ArrayList<>(tempList);
    lineIdList.add(userId.toString());
    String ret = StringUtils.join(lineIdList, ",");

    user.setUserIds(ret);

    userService.save(user);
    mav.setViewName("redirect:/viewFocusUser");
    return mav;
  }

  /**
   * 取消收藏
   * @param request
   * @return
   */
  @RequestMapping("/removeCollection")
  public ModelAndView removeCollection(HttpServletRequest request, String artId) {
    ModelAndView mav = new ModelAndView();
    User user = (User) request.getSession().getAttribute("user");// 当前登录用户

    String artIds = user.getArticleIds();
    List<String> tempList = Arrays.asList(artIds.split(","));
    List<String> lineIdList = new ArrayList<>(tempList);
    lineIdList.remove(artId);
    String ret = StringUtils.join(lineIdList, ",");

    user.setArticleIds(ret);

    userService.save(user);
    mav.setViewName("redirect:/viewCollection");
    return mav;
  }

  /**
   * 收藏
   * @param request
   * @return
   */
  @RequestMapping("/addCollection")
  public ModelAndView addCollection(HttpServletRequest request, String artId) {
    ModelAndView mav = new ModelAndView();
    User user = (User) request.getSession().getAttribute("user");// 当前登录用户
//    String artIds = user.getArticleIds();
//    List<String>  tempList= Arrays.asList(artIds.split(","));
//    List<String> lineIdList = new ArrayList<>(tempList);
//    lineIdList.add(artId);
//      String ret = StringUtils.join(lineIdList, ",");
      user.setArticleIds(artId);
    userService.save(user);

    mav.setViewName("redirect:/viewCollection");
    return mav;
  }

  @RequestMapping("/delete")
  public Map<String, Object> delete(Integer userId) {
    Map<String, Object> resultMap = new HashMap<String, Object>();
    userService.delete(userId);
    resultMap.put("errorNo", 0);
    return resultMap;
  }

主要数据库设计:

****数据库名:****teachingwebsite

****文档版本:****V1.0.0

****文档描述:****数据库表设计描述

表t_admin

编号名称数据类型长度小数位允许空值主键
1admin_idint100NY
2head_portraitvarchar2000YN
3passwordvarchar2000YN
4phonevarchar2000YN
5sexvarchar500YN
6signaturevarchar5000YN
7true_namevarchar2000YN
8user_namevarchar2000YN

表t_article

编号名称数据类型长度小数位允许空值主键
1article_idint100NY
2authorvarchar2000NN
3clickint100YN
4comment_numint100YN
5contenttext655350YN
6image_namevarchar2550YN
7is_originalint100YN
8is_topint100YN
9publish_datedatetime190YN
10titlevarchar2000NN
11classify_idint100YN
12user_idint100YN

表t_blogger

编号名称数据类型长度小数位允许空值主键
1blogger_idint100NY
2head_portraitvarchar2000YN
3mottovarchar5000YN
4nick_namevarchar2000YN
5sitevarchar2000YN
6signaturevarchar5000YN

表t_classify

编号名称数据类型长度小数位允许空值主键
1classify_idint100NY
2classify_namevarchar2000NN

表t_comment

编号名称数据类型长度小数位允许空值主键
1comment_idint100NY
2comment_datedatetime190YN
3contentvarchar5000YN
4article_idint100YN
5user_idint100YN

表t_link

编号名称数据类型长度小数位允许空值主键
1link_idint100NY
2link_emailvarchar2000YN
3link_namevarchar2000YN
4link_urlvarchar2000YN
5order_numint100YN

表t_notice

编号名称数据类型长度小数位允许空值主键
1notice_idint100NY
2gradeint100YN
3contentvarchar5000YN
4publish_datedatetime190YN

表t_reply

编号名称数据类型长度小数位允许空值主键
1reply_idint100NY
2contentvarchar5000YN
3reply_datedatetime190YN
4comment_idint100YN
5user_idint100YN

表t_timeline

编号名称数据类型长度小数位允许空值主键
1timeline_idint100NY
2contentvarchar2000YN
3publish_datedatetime190YN
4monthvarchar2000YN
5yearvarchar2000YN

设计项目总结:

经过近期对Java 面向对象程序设计、前端知识以及Java框架的掌握和学习,以及这段时间本教育教学系统的开发,让我更加了解到 Java 学习的重要性。在开发这个系统时,我不仅进行了多次的试验,而且也对系统的功能进行了测试。在论文的实现过程当中,我从Java的认识到熟练运用注入了非常多的努力,到后面可以进行相关技术的运用也感到非常的开心。在这过程当中,我发现Java其实有非常之多的功能可以进行探索。Java同时具有封装性、抽象性、多态性以及继承性。可以对代码进行重复使用以及扩充使用,大幅度提高开发软件时的整体速度和效率。我作为教育技术学的学生,学好Java语言不管对我以后的就业还是现在的知识面的扩增都有着很重要的意义。我学习程序设计的主要目的就是提高自己实际问题的程序解决方案的关键技能和技术, Java 面向对象程序设计是一科实践性相对来说非常比较强的语言了、SpringMVC框架的MVC三层架构模式、和框架中遇到的设计模式将数据访问和逻辑操作都集中到组件里面去了 , 增强了系统的复用性和扩展性。使系统的扩展性大大增强。以及前端jQuery、js、jsp、css样式的掌握让我对网页的布局、样式调整、字体等让网页效果实现的更加精准。

源码联系获取:

大家点赞、收藏、关注、评论啦 、查看👇🏻👇🏻👇🏻微信公众号获取联系方式👇🏻👇🏻👇🏻

打卡 文章 更新121/  365天

精彩专栏推荐订阅:下方专栏👇🏻👇🏻👇🏻👇🏻
Java项目精品实战案例《100套》外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传https://blog.csdn.net/weixin_39709134/category_11128297.html

源码联系获取:

大家点赞、收藏、关注、评论啦 、查看👇🏻👇🏻👇🏻微信公众号获取联系方式👇🏻👇🏻👇🏻

打卡 文章 更新121/  365天

精彩专栏推荐订阅:下方专栏👇🏻👇🏻👇🏻👇🏻
Java项目精品实战案例《100套》[外链图片转存中…(img-rKkhYDlI-1733782966745)]https://blog.csdn.net/weixin_39709134/category_11128297.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值