[Open Source] Music preference recommendation system based on Vue and SpringBoot

Insert image description here

Project number: S 012, get the source code at the end of the article. \color{red}{Project number: S012, get the source code at the end of the article. }Item name: S012, End of sentence: Genka.


1. Abstract

1.1 Project introduction

Music preference recommendation system based onVue+SpringBoot+MySQL, including music file module , my favorite configuration module, daily recommendation module and notification announcement module, and also includes the system’s own user management, department management, role management, menu management, log management, data dictionary management, Basic modules such as file management and chart display, music preference recommendation system, role-based access control, for ordinary users and music administrators, permissions can be precise to the button level, you can customize roles and assign permissions, the system is suitable for precise design permission restriction requirements.

With the rapid development of the Internet, it is more convenient for people to download network resources, and different types of music are widely disseminated on the Internet. At the same time, it has become difficult for people to find their favorite songs on the Internet. The old music recommendation system recommends music on a daily basis and cannot efficiently recommend music to users based on their preferences. This article mainly studies the online music preference recommendation system. It uses Vue to develop the front-end part, uses Spring Boot to develop the back-end part, and uses MySQL as the database. This system uses strings to simulate music data, and uses algorithms to recommend corresponding types of music data based on the user's music preference configuration in different time periods, achieving the preference recommendation function of online music.

1.2 Project screen recording

Source code download


2. System design

2.1 Function module design

2.1.1 Music file module

The music archive module manages music-related information, including music name, light music value, rock music value, pop music value, jazz value, classical music value, creator, creation time, etc. Music files can be processed through this module Add, edit, update, delete, and query operations.

2.1.2 My preferences module

The My Preferences module is used for users to configure their own reservation preferences to achieve more accurate music recommendations. The My Favorites module is divided into three time periods: morning, middle and evening. The fields include user ID, user name, morning favorites, afternoon favorites, evening favorites, notes, creator, creation time, etc. Users can configure their own music preferences in this module .

2.1.3 Daily recommendation module

The daily recommendation module is the core of the online music preference recommendation system. The system will be configured according to the user's preferences and recommend the user's corresponding music in different time periods. The daily recommendation data is generated by the system in real time and does not store the data persistently. There are no database tables.

2.1.4 Notification and announcement module

The notification and announcement module is designed in the online music preference recommendation system to push some notifications to users, such as system outage maintenance, recommendation algorithm announcement, system usage instructions and other information, which can make it easier for users to use the system. The fields of notification announcements include notification ID, notification title, notification content, attachments, publisher, release time, remarks, release status, etc. System administrators can publish notification announcements, and ordinary users can browse and query notification announcement information.

2.2 Use case diagram design

The user role use case diagram is shown in the figure below.
Insert image description here

The use case diagram for the administrator role is shown in the figure below.

Insert image description here

2.3 Entity class design

Insert image description here
Insert image description here

2.4 Database design

Insert image description here
Insert image description here

3. System display

3.1 Log in and register

Insert image description here
Insert image description here
Insert image description here

3.2 Music file module

Insert image description here
Insert image description here
Insert image description here
Insert image description here

3.3 Music daily recommendation module

Insert image description here
Insert image description here
Insert image description here

3.4 Notification and announcement module

Insert image description here
Insert image description here

3.5 System basic modules

Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here


4. Sample code

4.1 Modify a single song favorite configuration

@RequestMapping(value = "/setMySetting", method = RequestMethod.POST)
@ApiOperation(value = "修改单条歌曲喜爱配置")
public Result<MusicSetting> setMySetting(@RequestParam String like1,@RequestParam String like2,@RequestParam String like3){
    
    
    User currUser = securityUtil.getCurrUser();
    MusicSetting setting = iMusicSettingService.getById(currUser.getId());
    if(setting == null) {
    
    
        return ResultUtil.error("配置不存在");
    }
    setting.setLike1(like1);
    setting.setLike2(like2);
    setting.setLike3(like3);
    iMusicSettingService.saveOrUpdate(setting);
    return ResultUtil.success();
}

4.2 Music recommendation

@RequestMapping(value = "/getList", method = RequestMethod.GET)
@ApiOperation(value = "推荐10首歌")
public Result<List<Music>> getList(@RequestParam int h){
    
    
    User currUser = securityUtil.getCurrUser();
    MusicSetting setting = iMusicSettingService.getById(currUser.getId());
    if(setting == null) {
    
    
        return ResultUtil.error("你的配置不存在");
    }
    int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
    String likeStr = "";
    if(h > 0) {
    
    
        hour = h;
    }
    if(hour > 5 && hour < 11) {
    
    
        // 6点到11点
        likeStr = setting.getLike1();
    } else if(hour > 10 && hour < 18) {
    
    
        // 11点到18点
        likeStr = setting.getLike2();
    } else {
    
    
        likeStr = setting.getLike3();
    }
    QueryWrapper<Music> qw = new QueryWrapper<>();
    if(Objects.equals("轻音乐",likeStr)) {
    
    
        qw.orderByDesc("value1");
    } else if(Objects.equals("摇滚音乐",likeStr)) {
    
    
        qw.orderByDesc("value2");
    } else if(Objects.equals("流行音乐",likeStr)) {
    
    
        qw.orderByDesc("value3");
    } else if(Objects.equals("爵士乐",likeStr)) {
    
    
        qw.orderByDesc("value4");
    } else if(Objects.equals("古典乐",likeStr)) {
    
    
        qw.orderByDesc("value5");
    }
    qw.last("limit 10");
    return new ResultUtil<List<Music>>().setData(iMusicService.list(qw));
}

4.3 Notification query

@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "查询通知")
public Result<IPage<Message>> getByPage(@ModelAttribute Message message ,@ModelAttribute PageVo page){
    
    
    QueryWrapper<Message> qw = new QueryWrapper<>();
    if(!ZwzNullUtils.isNull(message.getTitle())) {
    
    
        qw.like("title",message.getTitle());
    }
    if(!ZwzNullUtils.isNull(message.getContent())) {
    
    
        qw.like("content",message.getContent());
    }
    if(!ZwzNullUtils.isNull(message.getUserName())) {
    
    
        qw.like("user_name",message.getUserName());
    }
    IPage<Message> data = iMessageService.page(PageUtil.initMpPage(page),qw);
    return new ResultUtil<IPage<Message>>().setData(data);
}

5. Disclaimer

  • This project is for personal study only. For commercial authorization, please contact the blogger, otherwise you will be responsible for the consequences.
  • The blogger owns all content and independent intellectual property rights of the application system built by this software, and has the final right of interpretation.
  • If you have any questions, please leave a message in the warehouse Issue. We will reply as soon as possible after seeing it. Relevant opinions will be considered as appropriate, but there is no promise or guarantee that they will be adopted.

Users who download this system code or use this system must agree to the following content, otherwise please do not download!

  1. You use/develop this software voluntarily, understand the risks of using this software, and agree to bear the risks of using this software.
  2. Any information content of the website built using this software and any resulting copyright disputes, legal disputes and consequences have nothing to do with the blogger, and the blogger does not bear any responsibility for this.
  3. Under no circumstances will the blogger be liable for any loss that is difficult to reasonably predict (including but not limited to loss of commercial profits, business interruption, and loss of business information) resulting from the use or inability to use this software.
  4. You must understand the risks of using this software. The blogger does not promise to provide one-on-one technical support or use guarantee, nor does it assume any responsibility for unforeseen problems caused by this software.

Insert image description here

Guess you like

Origin blog.csdn.net/yangyin1998/article/details/134779523