在线音乐系统

embedded/2024/10/4 13:32:14/

文章目录

  • 在线音乐系统
    • 一、项目演示
    • 二、项目介绍
    • 三、部分功能截图
    • 四、部分代码展示
    • 五、底部获取项目(9.9¥带走)

在线音乐系统

一、项目演示

音乐网站

二、项目介绍

基于springboot+vue的前后端分离在线音乐系统
登录角色 : 用户、管理员

用户:歌单分类分页界面,歌手分类分页界面,我的音乐查看收藏歌曲,搜索音乐,可根据歌手、歌曲、歌单名进行搜索;头像修改、用户信息修改,歌曲播放,进度条拉伸,歌词加载,歌曲收藏,歌曲下载,登录、注册等

管理员:系统首页展示统计数据,用户管理,歌手管理,歌曲管理(修改音源,歌词,后台评论),上传音乐

语言:java

前端技术:vue、element-ui、echarts

后端技术:springboot、mybatisplus

数据库:MySQL

三、部分功能截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

四、部分代码展示

package com.rabbiter.music.controller;import com.alibaba.fastjson.JSONObject;
import com.rabbiter.music.pojo.Collect;
import com.rabbiter.music.service.CollectService;
import com.rabbiter.music.utils.Consts;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;/*** 收藏控制类*/
@RestController
@RequestMapping("/collect")
@Api(tags = "收藏")
public class CollectController {@Autowiredprivate CollectService CollectService;/*** 添加收藏*/@ApiOperation(value = "添加收藏")@RequestMapping(value = "/add",method = RequestMethod.POST)public Object addCollect(HttpServletRequest request){JSONObject jsonObject = new JSONObject();String userId = request.getParameter("userId");           //用户idString type = request.getParameter("type");               //收藏类型(0歌曲1歌单)String songId = request.getParameter("songId");           //歌曲idif(songId==null||songId.equals("")){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"收藏歌曲为空");return jsonObject;}if(CollectService.existSongId(Integer.parseInt(userId),Integer.parseInt(songId))){jsonObject.put(Consts.CODE,2);jsonObject.put(Consts.MSG,"已收藏");return jsonObject;}//保存到收藏的对象中Collect Collect = new Collect();Collect.setUserId(Integer.parseInt(userId));Collect.setType(new Byte(type));Collect.setSongId(Integer.parseInt(songId));boolean flag = CollectService.insert(Collect);if(flag){   //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"收藏成功");return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"收藏失败");return jsonObject;}/*** 删除收藏*/@ApiOperation(value = "取消收藏")@RequestMapping(value = "/delete",method = RequestMethod.GET)public Object deleteCollect(HttpServletRequest request){String userId = request.getParameter("userId");           //用户idString songId = request.getParameter("songId");           //歌曲idboolean flag = CollectService.deleteByUserIdSongId(Integer.parseInt(userId),Integer.parseInt(songId));return flag;}/*** 查询所有收藏*/@ApiOperation(value = "查看所有收藏")@RequestMapping(value = "/allCollect",method = RequestMethod.GET)public Object allCollect(HttpServletRequest request){return CollectService.allCollect();}/*** 查询某个用户的收藏列表*/@ApiOperation(value = "用户的收藏列表")@RequestMapping(value = "/collectOfUserId",method = RequestMethod.GET)public Object collectOfUserId(HttpServletRequest request){String userId = request.getParameter("userId");          //用户idreturn CollectService.collectOfUserId(Integer.parseInt(userId));}}
package com.rabbiter.music.controller;import com.alibaba.fastjson.JSONObject;
import com.rabbiter.music.pojo.Comment;
import com.rabbiter.music.service.CommentService;
import com.rabbiter.music.utils.Consts;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;/*** 评论控制类*/
@Api(tags = "评论")
@RestController
@RequestMapping("/comment")
public class CommentController {@Autowiredprivate CommentService commentService;/*** 添加评论*/@ApiOperation(value = "添加评论")@RequestMapping(value = "/add",method = RequestMethod.POST)public Object addComment(HttpServletRequest request){JSONObject jsonObject = new JSONObject();String userId = request.getParameter("userId");           //用户idString type = request.getParameter("type");               //评论类型(0歌曲1歌单)String songId = request.getParameter("songId");           //歌曲idString songListId = request.getParameter("songListId");   //歌单idString content = request.getParameter("content").trim();         //评论内容//保存到评论的对象中Comment comment = new Comment();comment.setUserId(Integer.parseInt(userId));comment.setType(new Byte(type));if(new Byte(type) ==0){comment.setSongId(Integer.parseInt(songId));}else{comment.setSongListId(Integer.parseInt(songListId));}comment.setContent(content);boolean flag = commentService.insert(comment);if(flag){   //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"评论成功");return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"评论失败");return jsonObject;}/*** 修改评论*/@ApiOperation(value = "修改评论")@RequestMapping(value = "/update",method = RequestMethod.POST)public Object updateComment(HttpServletRequest request){JSONObject jsonObject = new JSONObject();String id = request.getParameter("id").trim();                   //主键String userId = request.getParameter("userId").trim();           //用户idString type = request.getParameter("type").trim();               //评论类型(0歌曲1歌单)String songId = request.getParameter("songId").trim();           //歌曲idString songListId = request.getParameter("songListId").trim();   //歌单idString content = request.getParameter("content").trim();         //评论内容//保存到评论的对象中Comment comment = new Comment();comment.setId(Integer.parseInt(id));comment.setUserId(Integer.parseInt(userId));comment.setType(new Byte(type));if(songId!=null&&songId.equals("")){songId = null;}else {comment.setSongId(Integer.parseInt(songId));}if(songListId!=null&&songListId.equals("")){songListId = null;}else {comment.setSongListId(Integer.parseInt(songListId));}comment.setContent(content);boolean flag = commentService.update(comment);if(flag){   //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"修改成功");return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"修改失败");return jsonObject;}/*** 删除评论*/@ApiOperation(value = "删除评论")@RequestMapping(value = "/delete",method = RequestMethod.GET)public Object deleteComment(HttpServletRequest request){String id = request.getParameter("id").trim();          //主键boolean flag = commentService.delete(Integer.parseInt(id));return flag;}/*** 根据主键查询整个对象*/@ApiOperation(value = "根据主键查询整个对象")@RequestMapping(value = "/selectByPrimaryKey",method = RequestMethod.GET)public Object selectByPrimaryKey(HttpServletRequest request){String id = request.getParameter("id").trim();          //主键return commentService.selectByPrimaryKey(Integer.parseInt(id));}/*** 查询所有评论*/@ApiOperation(value = "查询所有评论")@RequestMapping(value = "/allComment",method = RequestMethod.GET)public Object allComment(HttpServletRequest request){return commentService.allComment();}/*** 查询某个歌曲下的所有评论*/@ApiOperation(value = "查询某个歌曲下的所有评论")@RequestMapping(value = "/commentOfSongId",method = RequestMethod.GET)public Object commentOfSongId(HttpServletRequest request){String songId = request.getParameter("songId");          //歌曲idreturn commentService.commentOfSongId(Integer.parseInt(songId));}/*** 查询某个歌单下的所有评论*/@ApiOperation(value = "查询某个歌单下的所有评论")@RequestMapping(value = "/commentOfSongListId",method = RequestMethod.GET)public Object commentOfSongListId(HttpServletRequest request){String songListId = request.getParameter("songListId");          //歌曲idreturn commentService.commentOfSongListId(Integer.parseInt(songListId));}/*** 给某个评论点赞*/@ApiOperation(value = "给某个评论点赞")@RequestMapping(value = "/like",method = RequestMethod.POST)public Object like(HttpServletRequest request){JSONObject jsonObject = new JSONObject();String id = request.getParameter("id").trim();           //主键String up = request.getParameter("up").trim();           //用户id//保存到评论的对象中Comment comment = new Comment();comment.setId(Integer.parseInt(id));comment.setUp(Integer.parseInt(up));boolean flag = commentService.update(comment);if(flag){   //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"点赞成功");return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"点赞失败");return jsonObject;}}
package com.rabbiter.music.controller;import com.alibaba.fastjson.JSONObject;
import com.rabbiter.music.pojo.Consumer;
import com.rabbiter.music.service.ConsumerService;
import com.rabbiter.music.utils.Consts;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;/*** 前端用户控制类*/
@RestController
@RequestMapping("/consumer")
@Api(tags = "用户")
public class ConsumerController {@Autowiredprivate ConsumerService consumerService;/*** 添加前端用户*/@ApiOperation(value = "注册、添加前端用户")@RequestMapping(value = "/add",method = RequestMethod.POST)public Object addConsumer(HttpServletRequest request){JSONObject jsonObject = new JSONObject();String username = request.getParameter("username").trim();     //账号String password = request.getParameter("password").trim();     //密码String sex = request.getParameter("sex").trim();               //性别String phoneNum = request.getParameter("phoneNum").trim();     //手机号String email = request.getParameter("email").trim();           //电子邮箱String birth = request.getParameter("birth").trim();           //生日String introduction = request.getParameter("introduction").trim();//签名String location = request.getParameter("location").trim();      //地区String avator = request.getParameter("avator").trim();          //头像地址if(username==null||username.equals("")){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"用户名不能为空");return jsonObject;}Consumer consumer1 = consumerService.getByUsername(username);if(consumer1!=null){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"用户名已存在");return jsonObject;}if(password==null||password.equals("")){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"密码不能为空");return jsonObject;}//把生日转换成Date格式DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");Date birthDate = new Date();try {birthDate = dateFormat.parse(birth);} catch (ParseException e) {e.printStackTrace();}//保存到前端用户的对象中Consumer consumer = new Consumer();consumer.setUsername(username);consumer.setPassword(password);consumer.setSex(new Byte(sex));consumer.setPhoneNum(phoneNum);consumer.setEmail(email);consumer.setBirth(birthDate);consumer.setIntroduction(introduction);consumer.setLocation(location);consumer.setAvator(avator);boolean flag = consumerService.insert(consumer);if(flag){   //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"添加成功");return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"添加失败");return jsonObject;}/*** 修改前端用户*/@ApiOperation(value = "修改前端用户")@RequestMapping(value = "/update",method = RequestMethod.POST)public Object updateConsumer(HttpServletRequest request){JSONObject jsonObject = new JSONObject();String id = request.getParameter("id").trim();          //主键String username = request.getParameter("username").trim();     //账号String password = request.getParameter("password").trim();     //密码String sex = request.getParameter("sex").trim();               //性别String phoneNum = request.getParameter("phoneNum").trim();     //手机号String email = request.getParameter("email").trim();           //电子邮箱String birth = request.getParameter("birth").trim();           //生日String introduction = request.getParameter("introduction").trim();//签名String location = request.getParameter("location").trim();      //地区if(username==null||username.equals("")){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"用户名不能为空");return jsonObject;}if(password==null||password.equals("")){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"密码不能为空");return jsonObject;}//把生日转换成Date格式DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");Date birthDate = new Date();try {birthDate = dateFormat.parse(birth);} catch (ParseException e) {e.printStackTrace();}//保存到前端用户的对象中Consumer consumer = new Consumer();consumer.setId(Integer.parseInt(id));consumer.setUsername(username);consumer.setPassword(password);consumer.setSex(new Byte(sex));consumer.setPhoneNum(phoneNum);consumer.setEmail(email);consumer.setBirth(birthDate);consumer.setIntroduction(introduction);consumer.setLocation(location);boolean flag = consumerService.update(consumer);if(flag){   //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"修改成功");return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"修改失败");return jsonObject;}/*** 删除前端用户*/@ApiOperation(value = "删除前端用户")@RequestMapping(value = "/delete",method = RequestMethod.GET)public Object deleteConsumer(HttpServletRequest request){String id = request.getParameter("id").trim();          //主键boolean flag = consumerService.delete(Integer.parseInt(id));return flag;}/*** 根据主键查询整个对象*/@ApiOperation(value = "根据主键查询整个对象")@RequestMapping(value = "/selectByPrimaryKey",method = RequestMethod.GET)public Object selectByPrimaryKey(HttpServletRequest request){String id = request.getParameter("id").trim();          //主键return consumerService.selectByPrimaryKey(Integer.parseInt(id));}/*** 查询所有前端用户*/@ApiOperation(value = "查询所有前端用户")@RequestMapping(value = "/allConsumer",method = RequestMethod.GET)public Object allConsumer(HttpServletRequest request){return consumerService.allConsumer();}/*** 更新前端用户图片*/@ApiOperation(value = "更新前端用户图片")@RequestMapping(value = "/updateConsumerPic",method = RequestMethod.POST)public Object updateConsumerPic(@RequestParam("file") MultipartFile avatorFile, @RequestParam("id")int id){JSONObject jsonObject = new JSONObject();if(avatorFile.isEmpty()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"文件上传失败");return jsonObject;}//文件名=当前时间到毫秒+原来的文件名String fileName = System.currentTimeMillis()+avatorFile.getOriginalFilename();//文件路径String filePath = System.getProperty("user.dir")+System.getProperty("file.separator")+"userImages";//如果文件路径不存在,新增该路径File file1 = new File(filePath);if(!file1.exists()){file1.mkdir();}//实际的文件地址File dest = new File(filePath+System.getProperty("file.separator")+fileName);//存储到数据库里的相对文件地址String storeAvatorPath = "/userImages/"+fileName;try {avatorFile.transferTo(dest);Consumer consumer = new Consumer();consumer.setId(id);consumer.setAvator(storeAvatorPath);boolean flag = consumerService.update(consumer);if(flag){jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"上传成功");jsonObject.put("avator",storeAvatorPath);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"上传失败");return jsonObject;} catch (IOException e) {jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"上传失败"+e.getMessage());}finally {return jsonObject;}}/*** 前端用户登录*/@ApiOperation(value = "前端用户登录")@RequestMapping(value = "/login",method = RequestMethod.POST)public Object login(HttpServletRequest request){JSONObject jsonObject = new JSONObject();String username = request.getParameter("username").trim();     //账号String password = request.getParameter("password").trim();     //密码if(username==null||username.equals("")){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"用户名不能为空");return jsonObject;}if(password==null||password.equals("")){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"密码不能为空");return jsonObject;}//保存到前端用户的对象中Consumer consumer = new Consumer();consumer.setUsername(username);consumer.setPassword(password);boolean flag = consumerService.verifyPassword(username,password);if(flag){   //验证成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,"登录成功");jsonObject.put("userMsg",consumerService.getByUsername(username));return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,"用户名或密码错误");return jsonObject;}
}

五、底部获取项目(9.9¥带走)

有问题,或者需要协助调试运行项目的也可以


http://www.ppmy.cn/embedded/41379.html

相关文章

SystemC学习使用记录

一、概述 对于复杂的片上系统,在进行RTL编码前,需进行深入的系统级仿真,以确认设计的体系结构是否恰当、总线是否能满足吞吐量和实现性要求以及存储器是否浪费,所进行的这些仿真要求在芯片的仿真模型上运行大量的软件&#xff0c…

structured concurrency

1. 基于 c executions的异步实现 - 从理论到实践 - 知乎 (zhihu.com)

文献速递:深度学习医学影像心脏疾病检测与诊断--基于深度学习的低剂量SPECT心肌灌注图像去噪:定量评估与临床表现

Title 题目 Deep learning–based denoising of low‑dose SPECT myocardialperfusion images: quantitative assessment and clinical performance 基于深度学习的低剂量SPECT心肌灌注图像去噪:定量评估与临床表现 01 文献速递介绍 单光子发射计算机断层扫描&a…

【K8s】Kubectl 常用命令梳理

Kubectl常用命令梳理 下面包含大致涵盖命令只需要替换对应的Pod \ NameSpace 查看 命名空间 是 ’worktest2‘ 下 名字包括 ’todo‘的所有 Pod kubectl -n worktest2 get pod|grep todo查看 所有命名空间下 名字包括 ’todo‘的所有 Pod kubectl get pods --all-namespace…

均线金叉死叉及应用案例

5日均线和10日均线交叉 5日均线和10日均线交叉指的是5日和10日均线的相互交汇,根据5日均线运行方向的不同可以分为两种交叉。一是5日均线向上运行并交叉10日均线,二是5日均线向下运行并交叉10日均线,前面的交叉被称为金叉,后面的交叉被称为死叉。 技能解析: 5日均线和10日均…

智能BI(后端)-- 系统异步化

文章目录 系统问题分析什么是异步化?业务流程分析标准异步化的业务流程系统业务流程 线程池为什么需要线程池?线程池两种实现方式线程池的参数线程池的开发 项目异步化改造 系统问题分析 问题场景:调用的服务能力有限,或者接口的…

【八大排序算法】插入排序、希尔排序、选择排序、堆排序、冒泡排序、快速排序、归并排序、计数排序

文章目录 一、排序的相关概念二、排序类型三、排序算法实现插入排序1.直接插入排序2.希尔排序 选择排序3.简单选择排序4.堆排序 交换排序5.冒泡排序6.快速排序递归实现非递归实现 7.归并排序递归实现非递归实现 8.计数排序 四、总结 一、排序的相关概念 排序:根据数…

Gradle基础学习(七) 认识插件

Gradle构建在一个插件系统上,本身主要由基础设施组成,比如有一个先进的依赖解析引擎,而其他功能则来自插件。 插件是提供额外功能给Gradle构建系统的软件组件。 插件可以被应用到Gradle构建脚本中,以添加新的任务、配置或其他与构…