視頻演示:
<iframe id="ES644I5M-1630279686365" src="https://live.csdn.net/v/embed/176025" allowfullscreen="true" data-mediaembed="csdn"></iframe>springboot+vue音樂網站
摘要:
網路技術以及計算機的發展,網友們對網路的要求也日益長高,平常在網上聽話用一大堆下載軟體下載下來也要管理,又占空間,比如那流行歌曲,下載了聽了又要刪很不方便·而網路音樂庫的實作改變了這一狀況,它本身就是一個數字音樂互動,用戶通過它可是方便快捷、安全地實作國最大的音樂搜索查找歌曲,并能實時試聽,將自己喜愛的歌曲加入收藏,為用戶建立一個自由、自主、安全的世界局域網,音樂正是在這樣的需求前提下應運而生,給人們的日常生活帶來了極大的樂趣,讓人們在繁忙疲憊的作業之后可以進行休閑·基于此種現狀,在充分分析了該行業的市場前景,調研了用戶需求之后,設計了該音樂,
流行音樂之所以被稱為“流行”,原因之一,是她有著傳播的時效性·絕大部分流行歌曲可以一夜成名·但是從人們腦子里消失得也很快,從前極力搶購的唱片可能不久之后就被束之高閣,人們追逐的永遠是不同于以往的“新”星,但是互聯網的出現,一方而因為傳播速度提高而加劇了這種時效性,另一方而卻又利用其無限的網路胸懷使這些流行音樂具有了一定的持久性,如果這兩方面正是人們所需要的,那么,這些都應當歸功于音樂·作為音樂的網路載體,音樂在創作、傳播、欣賞方式等方而對流行音樂的發展都產生了前所未有的影響:
1)電腦網路技術的發展使人們通過音樂接觸到了更多的流行音樂,
2)網民數量的激增使更多的人們通過音樂接觸到了流行音樂,
3)音樂為流行音樂創作提供了更多的便利,
4)音樂刺激了流行音樂的傳播,
5)音樂使流行音樂的欣賞方式發生了改變,
6)音樂不但刺激了流行音樂的傳播,且也刺激了電子數碼產品的頻繁更新換代,
主要設計:
功能設計:
用戶端:登錄注冊功能、首頁歌曲歌單資訊查看、搜索、聽歌、歌曲的各項設定、評論、以及我的音樂等,
管理員端: 登錄、圖形樹狀圖資料查看、用戶管理、歌單管理、歌手管理、歌曲編輯、評價等,
主要技術:
Springboot+SpringMvc+mybatis+lombok+cache+攔截器+Jquery+html+VUE+Node.js等
功能截圖:
用戶端首頁:

登錄注冊:

歌單資訊:用戶首頁可以根據歌單資訊進行搜索歌曲

歌手資訊:用戶首頁可以根據歌手資訊進行搜索歌曲


我的音樂:
評論點贊:

管理員端:

首頁:

用戶管理:

歌手管理:

歌單管理:

部分代碼:
@RestController
@Controller
public class ConsumerController {
@Autowired
private ConsumerServiceImpl consumerService;
@Configuration
public class MyPicConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
String os = System.getProperty("os.name");
if (os.toLowerCase().startsWith("win")) { // windos系統
registry.addResourceHandler("/img/avatorImages/**")
.addResourceLocations("file:" + Constants.RESOURCE_WIN_PATH + "\\img\\avatorImages\\");
} else { // MAC、Linux系統
registry.addResourceHandler("/img/avatorImages/**")
.addResourceLocations("file:" + Constants.RESOURCE_MAC_PATH + "/img/avatorImages/");
}
}
}
// 添加用戶
@ResponseBody
@RequestMapping(value = "/user/add", method = RequestMethod.POST)
public Object addUser(HttpServletRequest req){
JSONObject jsonObject = new JSONObject();
String username = req.getParameter("username").trim();
String password = req.getParameter("password").trim();
String sex = req.getParameter("sex").trim();
String phone_num = req.getParameter("phone_num").trim();
String email = req.getParameter("email").trim();
String birth = req.getParameter("birth").trim();
String introduction = req.getParameter("introduction").trim();
String location = req.getParameter("location").trim();
String avator = req.getParameter("avator").trim();
if (username.equals("") || username == null){
jsonObject.put("code", 0);
jsonObject.put("msg", "用戶名或密碼錯誤");
return jsonObject;
}
Consumer consumer = new Consumer();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date myBirth = new Date();
try {
myBirth = dateFormat.parse(birth);
} catch (Exception e){
e.printStackTrace();
}
consumer.setUsername(username);
consumer.setPassword(password);
consumer.setSex(new Byte(sex));
if (phone_num == "") {
consumer.setPhoneNum(null);
} else{
consumer.setPhoneNum(phone_num);
}
if (email == "") {
consumer.setEmail(null);
} else{
consumer.setEmail(email);
}
consumer.setBirth(myBirth);
consumer.setIntroduction(introduction);
consumer.setLocation(location);
consumer.setAvator(avator);
consumer.setCreateTime(new Date());
consumer.setUpdateTime(new Date());
boolean res = consumerService.addUser(consumer);
if (res) {
jsonObject.put("code", 1);
jsonObject.put("msg", "注冊成功");
return jsonObject;
} else {
jsonObject.put("code", 0);
jsonObject.put("msg", "注冊失敗");
return jsonObject;
}
}
// 判斷是否登錄成功
@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");
// System.out.println(username+" "+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();
}
// 回傳指定ID的用戶
@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");
return consumerService.deleteUser(Integer.parseInt(id));
}
// 更新用戶資訊
@ResponseBody
@RequestMapping(value = "/user/update", method = RequestMethod.POST)
public Object updateUserMsg(HttpServletRequest req){
JSONObject jsonObject = new JSONObject();
String id = req.getParameter("id").trim();
String username = req.getParameter("username").trim();
String password = req.getParameter("password").trim();
String sex = req.getParameter("sex").trim();
String phone_num = req.getParameter("phone_num").trim();
String email = req.getParameter("email").trim();
String birth = req.getParameter("birth").trim();
String introduction = req.getParameter("introduction").trim();
String location = req.getParameter("location").trim();
// String avator = req.getParameter("avator").trim();
// System.out.println(username+" "+password+" "+sex+" "+phone_num+" "+email+" "+birth+" "+introduction+" "+location);
if (username.equals("") || username == null){
jsonObject.put("code", 0);
jsonObject.put("msg", "用戶名或密碼錯誤");
return jsonObject;
}
Consumer consumer = new Consumer();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date myBirth = new Date();
try {
myBirth = dateFormat.parse(birth);
}catch (Exception e){
e.printStackTrace();
}
consumer.setId(Integer.parseInt(id));
consumer.setUsername(username);
consumer.setPassword(password);
consumer.setSex(new Byte(sex));
consumer.setPhoneNum(phone_num);
consumer.setEmail(email);
consumer.setBirth(myBirth);
consumer.setIntroduction(introduction);
consumer.setLocation(location);
// consumer.setAvator(avator);
consumer.setUpdateTime(new Date());
boolean res = consumerService.updateUserMsg(consumer);
if (res){
jsonObject.put("code", 1);
jsonObject.put("msg", "修改成功");
return jsonObject;
}else {
jsonObject.put("code", 0);
jsonObject.put("msg", "修改失敗");
return jsonObject;
}
}
// 更新用戶頭像
@ResponseBody
@RequestMapping(value = "/user/avatar/update", method = RequestMethod.POST)
public Object updateUserPic(@RequestParam("file") MultipartFile avatorFile, @RequestParam("id")int id){
JSONObject jsonObject = new JSONObject();
if (avatorFile.isEmpty()) {
jsonObject.put("code", 0);
jsonObject.put("msg", "檔案上傳失敗!");
return jsonObject;
}
String fileName = System.currentTimeMillis()+avatorFile.getOriginalFilename();
String filePath = System.getProperty("user.dir") + System.getProperty("file.separator") + "img" + System.getProperty("file.separator") + "avatorImages" ;
File file1 = new File(filePath);
if (!file1.exists()){
file1.mkdir();
}
File dest = new File(filePath + System.getProperty("file.separator") + fileName);
String storeAvatorPath = "/img/avatorImages/"+fileName;
try {
avatorFile.transferTo(dest);
Consumer consumer = new Consumer();
consumer.setId(id);
consumer.setAvator(storeAvatorPath);
boolean res = consumerService.updateUserAvator(consumer);
if (res){
jsonObject.put("code", 1);
jsonObject.put("avator", storeAvatorPath);
jsonObject.put("msg", "上傳成功");
return jsonObject;
}else {
jsonObject.put("code", 0);
jsonObject.put("msg", "上傳失敗");
return jsonObject;
}
}catch (IOException e){
jsonObject.put("code", 0);
jsonObject.put("msg", "上傳失敗"+e.getMessage());
return jsonObject;
}finally {
return jsonObject;
}
}
資料庫設計:
資料庫采用mysql5版本、滿足資料庫設計三范式,編碼采用utf8 -- UTF-8 Unicode、排序規則采用utf8_general_ci
用戶表:
CREATE TABLE `consumer` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`sex` tinyint(4) NULL DEFAULT NULL ,
`phone_num` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`email` char(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`birth` datetime NULL DEFAULT NULL ,
`introduction` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`location` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`avator` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`create_time` datetime NOT NULL ,
`update_time` datetime NOT NULL ,
PRIMARY KEY (`id`),
UNIQUE INDEX `username_UNIQUE` (`username`) USING BTREE ,
UNIQUE INDEX `phone_num_UNIQUE` (`phone_num`) USING BTREE ,
UNIQUE INDEX `email_UNIQUE` (`email`) USING BTREE
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=30
ROW_FORMAT=COMPACT
;
評論表:
CREATE TABLE `comment` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`user_id` int(10) UNSIGNED NOT NULL ,
`song_id` int(10) UNSIGNED NULL DEFAULT NULL ,
`song_list_id` int(10) UNSIGNED NULL DEFAULT NULL ,
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`create_time` datetime NULL DEFAULT NULL ,
`type` tinyint(4) NOT NULL ,
`up` int(10) UNSIGNED NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=59
ROW_FORMAT=COMPACT
;
收藏表:
CREATE TABLE `collect` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`user_id` int(10) UNSIGNED NOT NULL ,
`type` tinyint(4) NOT NULL ,
`song_id` int(10) UNSIGNED NULL DEFAULT NULL ,
`song_list_id` int(10) UNSIGNED NULL DEFAULT NULL ,
`create_time` datetime NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=54
ROW_FORMAT=COMPACT
;
歌手歌曲表:
CREATE TABLE `singer` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`sex` tinyint(4) NULL DEFAULT NULL ,
`pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`birth` datetime NULL DEFAULT NULL ,
`location` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`introduction` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=46
ROW_FORMAT=COMPACT
;
歌手表:
CREATE TABLE `song` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`singer_id` int(10) UNSIGNED NOT NULL ,
`name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`introduction` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`create_time` datetime NOT NULL COMMENT '發行時間' ,
`update_time` datetime NOT NULL ,
`pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`lyric` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=115
ROW_FORMAT=COMPACT
;
往前精彩分享:
基于java ssm springboot+VUE疫情防疫系統系統前后端分離設計和實作
基于java springboot+mybatis電影售票網站管理系統前臺+后臺設計和實作
基于java ssm springboot+mybatis酒莊內部管理系統設計和實作
基于JAVA springboot+mybatis智慧生活分享平臺設計和實作
基于Java springboot+vue+redis前后端分離家具商城平臺系統設計和實作
基于JAVA SSM springboot實作的抗疫物質資訊管理系統設計和實作
基于java ssm springboot實作選課推薦交流平臺系統設計和實作
基于JAVA springboot+mybatis 電商書城平臺系統設計和實作
基于java springboot+mybatis愛游旅行平臺前臺+后臺設計實作
基于java SSM springboot景區行李寄存管理系統設計和實作
基于java springboot的圖書管理系統設計和實作
基于jsp+mysql+mybatis+Spring boot簡單學生成績資訊管理系統
基于java ssm springboot女士電商平臺系統設計和實作
基于Java+jsp+servlet的養老院管理系統設計和實作
基于jsp+mysql的JSP在線水果銷售商城系統設計實作
基于JavaWeb SSM mybatis 學生資訊管理系統設計和實作
基于javaweb(springboot+mybatis)網上酒類商城專案設計和實作
基于jsp+mysql+Spring的SSM在線蛋糕商城銷售網站專案設計和實作
基于java SSM的房屋租賃系統設計和實作
基于javaweb SSM郵件收發資訊系統設計和實作以及檔案
基于JavaWEB SSM SpringBoot婚紗影樓攝影預約網站設計和實作
基于jsp+mysql+Spring的SpringBoot招聘網站專案設計和實作
基于java web jsp+servlet學生宿舍管理系統
基于jsp+mysql+Spring+mybatis的SSM汽車保險理賠管理系統設計和實作
專案總結:
總體來說這個專案功能相對還是比較簡單優秀的、適合初學者作為課程設計和畢業設計參考
另外需要其他畢設專案或者白嫖java學習資料包括《JVM、Netty、Mysql、Mybatis、Redis、Dubbo、Nginx、設計模式》等10G資料禮包、可以看我主頁或私信博主都行
打卡Java專案更新 29 / 100天
大家可以點贊、收藏、關注、評論我啦 、

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/296576.html
標籤:java

