Abstract:
With the development of network technology and computer, Internet users have increasingly high requirements for the network. Usually, they listen to the Internet with a lot of download software to download down to manage, and occupy space, such as the popular songs, it is very inconvenient to download and listen to and delete. The implementation of network music library has changed this situation. It itself is a digital music interaction, users through it is convenient and fast, safe to achieve the largest music search search songs, and can listen to their favorite songs to join the collection, for the user to establish a free, independent, safe world LAN. Music comes into being under the premise of such demand. It brings great fun to People’s Daily life and allows people to have leisure after busy and tired work. Based on this situation, after fully analyzing the market prospect of the industry and investigating user needs, the music is designed.
Pop music is called “popular”, one of the reasons, is she has the spread of timeliness, the vast majority of the popular songs disappeared from people’s mind can overnight success, but too soon, before trying to snap up record may soon be on the shelf, people pursuit is always different “new” stars. However, the emergence of the Internet, on the one hand, enhances the timeliness because of the speed of transmission, and on the other hand, it makes use of its infinite network mind to make these pop music have a certain degree of durability. If these two aspects are exactly what people need, they should all be attributed to music. As the network carrier of music, music has exerted unprecedented influence on the development of pop music in terms of creation, transmission and appreciation:
1) The development of computer network technology enables people to access more popular music through music.
2) The surge in the number of Internet users makes more people have access to pop music through music.
3) Music provides more convenience for pop music creation.
4) Music stimulated the spread of popular music.
5) Music has changed the way popular music is appreciated.
6) Music not only stimulates the spread of pop music, but also stimulates the frequent updating of electronic and digital products.
Main design:
Functional design:
User side: login registration function, page song list information view, search, listen to the song, song Settings, comments, and my music, etc.
Administrator side: login, graph tree view, user management, song list management, singer management, song editing, evaluation, etc.
Main technologies:
Springboot+SpringMvc+ Mybatis + Lombok + Cache + interceptor +Jquery+ HTML +VUE+Node.js etc
Function screenshots:
Client home page:
Login and registration:
Playlist information: Users can search songs according to the playlist information on the home page
Singer information: the user home page can search songs according to the singer information
My Music:
Comments like:
Administrator side:
Home page:
User management:
Singer Management:
Playlist Management:
Part code:
@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;
}
}
Copy the code
Database design:
Database using mysQL5 version, meet the three paradigm of database design. The encoding is UTF8 — UTF-8 Unicode and the collation is UTF8_general_CI
The users table:
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
;
Copy the code
Comments list:
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
;
Copy the code
Collection of tables:
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
;
Copy the code
Songs by Singers:
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
;
Copy the code
Song watches:
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 'create_time', 'update_time' 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 ;Copy the code
Moving forward to share:
Based on Java SSM Springboot +VUE epidemic prevention system system front and back end separation design and implementation
Based on Java Springboot + Mybatis film ticket website management system front + background design and implementation
Design and implementation of winery internal management system based on Java SSM Springboot + Mybatis
Design and implementation of intelligent life sharing platform based on JAVA Springboot + Mybatis
Based on Java Springboot + VUE + Redis front and back end separation furniture mall platform system design and implementation
Design and implementation of anti-epidemic material information management system based on JAVA SSM Springboot
Based on Java SSM Springboot implementation of course selection recommendation exchange platform system design and implementation
Project Summary:
In general, this project is relatively simple and excellent, suitable for beginners as a reference for course design and graduation design
In addition, you need other graduation projects or white piao Java learning materials, including “JVM, Netty, Mysql, Mybatis, Redis, Dubbo, Nginx, Design Mode” and other 10G information package, you can see my home page or private blog
Clocking Java projects updated 29/100 days
You can like, like, follow, comment on me,
Raffle in comments section
Just leave your thoughts on the Springboot music player system in the comments section, or mention any other small cases you want to learn, and I will send out two nuggets MEDALS according to the popularity of the comments (nuggets official bear).