——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明







基于javaweb的SpringBoot精美网上音乐平台(前后端分离+java+vue+springboot+ssm+mysql+maven)
一、项目简述
本系统功能包括: 音乐播放 用户登录注册 用户信息编辑、头像修改 歌曲、歌单搜索 歌单打分 歌单、歌曲评论 歌单列表、歌手列表分页显示 歌词同步显不 音乐收藏、下载、拖动控制、音粉制 后台对用户、歌曲、歌手、歌单信息的管理
二、项目运行
环境配置: Jdk1.8 + Mysql + HBuilderX (Webstorm也 行)+ Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts都支 持)。
项目技术: Springboot + Maven + Mybatis + Vue, B/S 模式+ Maven等等
——————————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
|
@RequestMapping(value = "/songList/title/detail", method = RequestMethod.GET) public Object songListOfTitle(HttpServletRequest req) { String title = req.getParameter("title").trim(); return songListService.songListOfTitle(title); }
@RequestMapping(value = "/songList/likeTitle/detail", method = RequestMethod.GET) public Object songListOfLikeTitle(HttpServletRequest req) { String title = req.getParameter("title").trim(); return songListService.likeTitle('%' + title + '%'); }
@RequestMapping(value = "/songList/style/detail", method = RequestMethod.GET) public Object songListOfStyle(HttpServletRequest req) { String style = req.getParameter("style").trim(); return songListService.likeStyle('%' + style + '%'); }
@RequestMapping(value = "/songList/delete", method = RequestMethod.GET) public Object deleteSongList(HttpServletRequest req) { String id = req.getParameter("id"); return songListService.deleteSongList(Integer.parseInt(id)); }
@ResponseBody @RequestMapping(value = "/songList/update", method = RequestMethod.POST) public Object updateSongListMsg(HttpServletRequest req) { JSONObject jsonObject = new JSONObject(); String id = req.getParameter("id").trim(); String title = req.getParameter("title").trim(); String pic = req.getParameter("pic").trim(); String introduction = req.getParameter("introduction").trim(); String style = req.getParameter("style").trim();
SongList songList = new SongList();
|
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 51 52
| @RequestMapping(value = "/songList/style/detail", method = RequestMethod.GET) public Object songListOfStyle(HttpServletRequest req) { String style = req.getParameter("style").trim(); return songListService.likeStyle('%' + style + '%'); }
@RequestMapping(value = "/songList/delete", method = RequestMethod.GET) public Object deleteSongList(HttpServletRequest req) { String id = req.getParameter("id"); return songListService.deleteSongList(Integer.parseInt(id)); }
@ResponseBody @RequestMapping(value = "/songList/update", method = RequestMethod.POST) public Object updateSongListMsg(HttpServletRequest req) { JSONObject jsonObject = new JSONObject(); String id = req.getParameter("id").trim(); String title = req.getParameter("title").trim(); String pic = req.getParameter("pic").trim(); String introduction = req.getParameter("introduction").trim(); String style = req.getParameter("style").trim();
SongList songList = new SongList(); songList.setId(Integer.parseInt(id)); songList.setTitle(title); songList.setPic(pic); songList.setIntroduction(introduction); songList.setStyle(style);
boolean res = songListService.updateSongListMsg(songList); if (res) { jsonObject.put("code", 1); jsonObject.put("msg", "修改成功"); return jsonObject; } else { jsonObject.put("code", 0); jsonObject.put("msg", "修改失败"); return jsonObject; } }
@ResponseBody @RequestMapping(value = "/songList/img/update", method = RequestMethod.POST) public Object updateSongListPic(@RequestParam("file") MultipartFile avatorFile, @RequestParam("id") int id) { JSONObject jsonObject = new JSONObject();
if (avatorFile.isEmpty()) { jsonObject.put("code", 0);
|
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
| }
@ResponseBody @RequestMapping(value = "/user/login/status", method = RequestMethod.POST) public Object loginStatus(HttpServletRequest req, HttpSession session) {
JSONObject jsonObject = new JSONObject(); String username = req.getParameter("username"); String password = req.getParameter("password");
boolean res = consumerService.veritypasswd(username, password);
if (res) { jsonObject.put("code", 1); jsonObject.put("msg", "登录成功"); jsonObject.put("userMsg", consumerService.loginStatus(username)); session.setAttribute("username", username); return jsonObject; } else { jsonObject.put("code", 0); jsonObject.put("msg", "用户名或密码错误"); return jsonObject; }
}
@RequestMapping(value = "/user", method = RequestMethod.GET) public Object allUser() { return consumerService.allUser(); }
@RequestMapping(value = "/user/detail", method = RequestMethod.GET) public Object userOfId(HttpServletRequest req) { String id = req.getParameter("id"); return consumerService.userOfId(Integer.parseInt(id)); }
@RequestMapping(value = "/user/delete", method = RequestMethod.GET) public Object deleteUser(HttpServletRequest req) { String id = req.getParameter("id");
|
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
| return jsonObject; }else { jsonObject.put("code", 0); jsonObject.put("msg", "评论失败"); return jsonObject; } }
@RequestMapping(value = "/comment", method = RequestMethod.GET) public Object allComment(){ return commentService.allComment(); }
@RequestMapping(value = "/comment/song/detail", method = RequestMethod.GET) public Object commentOfSongId(HttpServletRequest req){ String songId = req.getParameter("songId"); return commentService.commentOfSongId(Integer.parseInt(songId)); }
@RequestMapping(value = "/comment/songList/detail", method = RequestMethod.GET) public Object commentOfSongListId(HttpServletRequest req){ String songListId = req.getParameter("songListId"); return commentService.commentOfSongListId(Integer.parseInt(songListId)); }
@ResponseBody @RequestMapping(value = "/comment/like", method = RequestMethod.POST) public Object commentOfLike(HttpServletRequest req){
JSONObject jsonObject = new JSONObject(); String id = req.getParameter("id").trim(); String up = req.getParameter("up").trim();
Comment comment = new Comment(); comment.setId(Integer.parseInt(id)); comment.setUp(Integer.parseInt(up)); boolean res = commentService.updateCommentMsg(comment); if (res){ jsonObject.put("code", 1); jsonObject.put("msg", "点赞成功"); return jsonObject; }else { jsonObject.put("code", 0); jsonObject.put("msg", "点赞失败"); return jsonObject;
|
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
| @RequestMapping(value = "/comment/like", method = RequestMethod.POST) public Object commentOfLike(HttpServletRequest req){
JSONObject jsonObject = new JSONObject(); String id = req.getParameter("id").trim(); String up = req.getParameter("up").trim();
Comment comment = new Comment(); comment.setId(Integer.parseInt(id)); comment.setUp(Integer.parseInt(up)); boolean res = commentService.updateCommentMsg(comment); if (res){ jsonObject.put("code", 1); jsonObject.put("msg", "点赞成功"); return jsonObject; }else { jsonObject.put("code", 0); jsonObject.put("msg", "点赞失败"); return jsonObject; } }
@RequestMapping(value = "/comment/delete", method = RequestMethod.GET) public Object deleteComment(HttpServletRequest req){ String id = req.getParameter("id"); return commentService.deleteComment(Integer.parseInt(id)); }
@ResponseBody @RequestMapping(value = "/comment/update", method = RequestMethod.POST) public Object updateCommentMsg(HttpServletRequest req){ JSONObject jsonObject = new JSONObject(); String id = req.getParameter("id").trim(); String user_id = req.getParameter("userId").trim(); String song_id = req.getParameter("songId").trim(); String song_list_id = req.getParameter("songListId").trim(); String content = req.getParameter("content").trim(); String type = req.getParameter("type").trim(); String up = req.getParameter("up").trim();
|
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 51
| public class CollectController {
@Autowired private CollectServiceImpl collectService;
@ResponseBody @RequestMapping(value = "/collection/add", method = RequestMethod.POST) public Object addCollection(HttpServletRequest req){
JSONObject jsonObject = new JSONObject(); String user_id = req.getParameter("userId"); String type = req.getParameter("type"); String song_id=req.getParameter("songId"); String song_list_id=req.getParameter("songListId"); if (song_id == ""){ jsonObject.put("code", 0); jsonObject.put("msg", "收藏歌曲为空"); return jsonObject; } else if (collectService.existSongId(Integer.parseInt(user_id), Integer.parseInt(song_id))) { jsonObject.put("code", 2); jsonObject.put("msg", "已收藏"); return jsonObject; } Collect collect = new Collect(); collect.setUserId(Integer.parseInt(user_id)); collect.setType(new Byte(type)); if (new Byte(type) == 0) { collect.setSongId(Integer.parseInt(song_id)); } else if (new Byte(type) == 1) { collect.setSongListId(Integer.parseInt(song_list_id)); } collect.setCreateTime(new Date()); boolean res = collectService.addCollection(collect); if (res){ jsonObject.put("code", 1); jsonObject.put("msg", "收藏成功"); return jsonObject; }else { jsonObject.put("code", 0); jsonObject.put("msg", "收藏失败"); return jsonObject; } }
@RequestMapping(value = "/collection", method = RequestMethod.GET) public Object allCollection(){ return collectService.allCollect(); }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=201222062008200ws
https://javayms.pages.dev?id=201222062008200ws