217基于Springboot + vue实现的学生读书笔记共享(含论文)

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

基于基于Springboot + vue实现的学生读书笔记共享

本系统包含管理员、用户两个主要角色。

管理员角色:首页、个人中心、用户管理、笔记分享管理、个人笔记管理、管理员管理、交流互动、系统管理。

用户角色:首页、个人中心、笔记分享管理、个人笔记管理、我的收藏管理。

使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7/8.0版本均可;

5.是否Maven项目:是;

技术栈

后端:SpringBoot+Mybaits

前端:Vue + elementui

使用说明

项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入地址:
前台登录页面
http://localhost:8080/springbootf3x3h/front/index.html
用户:用户名1 密码:123456

后台登录页面
http://localhost:8080/springbootf3x3h/admin/dist/index.html
管理员账户:abo 密码:abo
 

注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。

运行截图

论文

前台界面

后台界面

相关代码

BijifenxiangController

package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.BijifenxiangEntity;
import com.entity.view.BijifenxiangView;

import com.service.BijifenxiangService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import com.service.StoreupService;
import com.entity.StoreupEntity;

/**
 * 笔记分享
 * 后端接口
 * @author 
 * @email 
 * @date 2023-02-26
 */
@RestController
@RequestMapping("/bijifenxiang")
public class BijifenxiangController {
    @Autowired
    private BijifenxiangService bijifenxiangService;

    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,BijifenxiangEntity bijifenxiang,
		HttpServletRequest request){

String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
			bijifenxiang.setYonghuming((String)request.getSession().getAttribute("username"));
		}
EntityWrapper<BijifenxiangEntity> ew = new EntityWrapper<BijifenxiangEntity>();
		PageUtils page = bijifenxiangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bijifenxiang), params), params));

        return R.ok().put("data", page);
    }
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,BijifenxiangEntity bijifenxiang, 
		HttpServletRequest request){
        EntityWrapper<BijifenxiangEntity> ew = new EntityWrapper<BijifenxiangEntity>();
		PageUtils page = bijifenxiangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bijifenxiang), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( BijifenxiangEntity bijifenxiang){
       	EntityWrapper<BijifenxiangEntity> ew = new EntityWrapper<BijifenxiangEntity>();
      	ew.allEq(MPUtil.allEQMapPre( bijifenxiang, "bijifenxiang")); 
        return R.ok().put("data", bijifenxiangService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(BijifenxiangEntity bijifenxiang){
        EntityWrapper< BijifenxiangEntity> ew = new EntityWrapper< BijifenxiangEntity>();
 		ew.allEq(MPUtil.allEQMapPre( bijifenxiang, "bijifenxiang")); 
		BijifenxiangView bijifenxiangView =  bijifenxiangService.selectView(ew);
		return R.ok("查询笔记分享成功").put("data", bijifenxiangView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        BijifenxiangEntity bijifenxiang = bijifenxiangService.selectById(id);
        return R.ok().put("data", bijifenxiang);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        BijifenxiangEntity bijifenxiang = bijifenxiangService.selectById(id);
        return R.ok().put("data", bijifenxiang);
    }

	    /**
     * 赞或踩
     */
    @RequestMapping("/thumbsup/{id}")
    public R thumbsup(@PathVariable("id") String id,String type){
        BijifenxiangEntity bijifenxiang = bijifenxiangService.selectById(id);
        if(type.equals("1")) {
        	bijifenxiang.setThumbsupnum(bijifenxiang.getThumbsupnum()+1);
        } else {
        	bijifenxiang.setCrazilynum(bijifenxiang.getCrazilynum()+1);
        }
        bijifenxiangService.updateById(bijifenxiang);
        return R.ok();
    }
    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody BijifenxiangEntity bijifenxiang, HttpServletRequest request){
    	bijifenxiang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(bijifenxiang);

 bijifenxiangService.insert(bijifenxiang);
        return R.ok();
    }
 /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody BijifenxiangEntity bijifenxiang, HttpServletRequest request){
    	bijifenxiang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(bijifenxiang);
 bijifenxiangService.insert(bijifenxiang);
        return R.ok();
    }
    /**
     * 修改
     */
    @RequestMapping("/update")
    //@Transactional
    public R update(@RequestBody BijifenxiangEntity bijifenxiang, HttpServletRequest request){
        //ValidatorUtils.validateEntity(bijifenxiang);
        bijifenxiangService.updateById(bijifenxiang);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        bijifenxiangService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<BijifenxiangEntity> wrapper = new EntityWrapper<BijifenxiangEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}

String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
			wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
		}
int count = bijifenxiangService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
}

GerenbijiController

package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.GerenbijiEntity;
import com.entity.view.GerenbijiView;

import com.service.GerenbijiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import com.service.StoreupService;
import com.entity.StoreupEntity;

/**
 * 个人笔记
 * 后端接口
 * @author 
 * @email 
 * @date 2023-02-26
 */
@RestController
@RequestMapping("/gerenbiji")
public class GerenbijiController {
    @Autowired
    private GerenbijiService gerenbijiService;

    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,GerenbijiEntity gerenbiji,
		HttpServletRequest request){

String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
			gerenbiji.setYonghuming((String)request.getSession().getAttribute("username"));
		}
EntityWrapper<GerenbijiEntity> ew = new EntityWrapper<GerenbijiEntity>();
		PageUtils page = gerenbijiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gerenbiji), params), params));

        return R.ok().put("data", page);
    }
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,GerenbijiEntity gerenbiji, 
		HttpServletRequest request){
        EntityWrapper<GerenbijiEntity> ew = new EntityWrapper<GerenbijiEntity>();
		PageUtils page = gerenbijiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gerenbiji), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( GerenbijiEntity gerenbiji){
       	EntityWrapper<GerenbijiEntity> ew = new EntityWrapper<GerenbijiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( gerenbiji, "gerenbiji")); 
        return R.ok().put("data", gerenbijiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(GerenbijiEntity gerenbiji){
        EntityWrapper< GerenbijiEntity> ew = new EntityWrapper< GerenbijiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( gerenbiji, "gerenbiji")); 
		GerenbijiView gerenbijiView =  gerenbijiService.selectView(ew);
		return R.ok("查询个人笔记成功").put("data", gerenbijiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        GerenbijiEntity gerenbiji = gerenbijiService.selectById(id);
        return R.ok().put("data", gerenbiji);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        GerenbijiEntity gerenbiji = gerenbijiService.selectById(id);
        return R.ok().put("data", gerenbiji);
    }

	    /**
     * 赞或踩
     */
    @RequestMapping("/thumbsup/{id}")
    public R thumbsup(@PathVariable("id") String id,String type){
        GerenbijiEntity gerenbiji = gerenbijiService.selectById(id);
        if(type.equals("1")) {
        	gerenbiji.setThumbsupnum(gerenbiji.getThumbsupnum()+1);
        } else {
        	gerenbiji.setCrazilynum(gerenbiji.getCrazilynum()+1);
        }
        gerenbijiService.updateById(gerenbiji);
        return R.ok();
    }
    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody GerenbijiEntity gerenbiji, HttpServletRequest request){
    	gerenbiji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(gerenbiji);

 gerenbijiService.insert(gerenbiji);
        return R.ok();
    }
 /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody GerenbijiEntity gerenbiji, HttpServletRequest request){
    	gerenbiji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(gerenbiji);
 gerenbijiService.insert(gerenbiji);
        return R.ok();
    }
    /**
     * 修改
     */
    @RequestMapping("/update")
    //@Transactional
    public R update(@RequestBody GerenbijiEntity gerenbiji, HttpServletRequest request){
        //ValidatorUtils.validateEntity(gerenbiji);
        gerenbijiService.updateById(gerenbiji);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        gerenbijiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<GerenbijiEntity> wrapper = new EntityWrapper<GerenbijiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}

String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
			wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
		}
int count = gerenbijiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
}

如果也想学习本系统,下面领取。关注并回复:217springboot

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜未央5788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值