Springboot+vue project music website and sharing platform

Get the source code at the end of the article

Development language: Java

Development tools: IDEA/Eclipse

Database: MYSQL5.7

Application service:Tomcat7/Tomcat8

Use framework: springboot+vue

JDK version: jdk1.8

The main users of music websites and sharing platforms are divided into administrators and users. The functions include administrators: home page, personal center, user management, music information management, music cover management, online music management, message board management, system management, User: Homepage, Personal Center, Music Cover Management, My Collection Management, Front Desk Homepage; Homepage, Music Information, Music Cover, Online Song Listening, Message Feedback, Personal Center, Background Management, Customer Service and other functions. 

System function analysis

This music website and sharing platform mainly includes two major functional modules, namely the user functional module and the administrator functional module.

(1) Administrator module: The core user in the system is the administrator. After the administrator logs in, he manages the background system through the administrator function. The main functions are: home page, personal center, user management, music information management, music cover management, online music management, message board management, system management and other functions. The administrator use case diagram is shown in the figure

(2) User: home page, personal center, music cover management, my collection management and other functions, the user is shown in the figure 

 (3) Front page home page: home page, music information, music cover, online music listening, message feedback, personal center, background management, customer service and other functions, the front page home page is shown in the figure

System structure design

The whole system is composed of multiple functional modules. All the functional modules should be listed one by one, and then the function design will be carried out one by one, so that each module has a corresponding function design, and then the overall system design will be carried out. .

The structure diagram of this music website and sharing platform is shown in the figure 

System detailed design

Front page home function module

Music website and sharing platform, you can view the home page, music information, music cover, online music listening, message feedback, personal center, background management, customer service and other content on the system home page, as shown in the figure

Login, user registration, on the user registration page, you can fill in the user name, password, name, age, mobile phone, email, ID card and other information to register, as shown in the figure 

 music information

 music cover

To listen to songs online, click My Favorites by filling in the number, song name, label, original song, composition, lyrics, music, video and other information on the Online Listening Song page, as shown in Figure 5-3. On the music cover page, click me to collect information by filling in the number, song name, original song, label, audio, picture, reason for cover, user name, etc., as shown in the figure 

 Administrator function module

The administrator logs in by filling in the username, password, and role entered during registration, as shown in the figure

Administrators can log in to the music website and sharing platform to view the home page, personal center, user management, music information management, music cover management, online music management, message board management, system management and other information.

Personal information can be modified or added by filling in the user name and other contents in the personal information page, as shown in Figure 1. You can also add, modify or delete user management as needed, as shown in Figure 2

Music information management, in the music information management page, you can fill in the title, information type, picture, summary and other information, and you can modify or delete the existing music information management as needed, as shown in the figure

Music cover management, you can fill in the number, song name, original song, label, audio, picture, cover reason, user name and other information in the music cover management page, and you can modify or delete the existing music cover management as needed. operation, as shown in the figure 

 Online listening to songs management, on the online listening to songs management page, you can view the number, song name, label, original singing, composition, lyrics, music, video, pictures, etc., and add and modify the existing online listening to songs management as needed Or delete and other detailed operations, as shown in the figure

 

Message board management, in the message board management page, you can view the user name, message content, reply content, etc., and add, modify or delete the existing message board management as needed, as shown in the figure 

Customer service management, on the customer service management page, you can view new messages, status, etc., and add, modify or delete existing customer service management as needed, as shown in the figure 

User function module

Users can log in to the music website and sharing platform to view the home page, personal center, music cover management, my collection management, etc. 

Personal information, on the personal information page, you can view the user name, password, name, age, gender, mobile phone, email, ID card and other information content, and modify or delete the existing personal information as needed, and other detailed operations, as shown in the figure

Music cover management, in the music cover management page, you can view and delete by filling in the number, song name, original song, label, audio, picture, cover reason, user name, etc., as shown in the figure

My collection management, you can view the collection ID, table name, collection name, collection picture, etc. on the My collection management page, and you can view the existing my collection management and other detailed operations as needed, as shown in the figure 

Part of the code:  

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.YinlefanchangEntity;
import com.entity.view.YinlefanchangView;

import com.service.YinlefanchangService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 音乐翻唱
 * 后端接口
 * @author 
 * @email 
 * @date 2021-01-11 11:34:28
 */
@RestController
@RequestMapping("/yinlefanchang")
public class YinlefanchangController {
    @Autowired
    private YinlefanchangService yinlefanchangService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,YinlefanchangEntity yinlefanchang, HttpServletRequest request){
		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yonghu")) {
			yinlefanchang.setYonghuming((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<YinlefanchangEntity> ew = new EntityWrapper<YinlefanchangEntity>();
		PageUtils page = yinlefanchangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yinlefanchang), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,YinlefanchangEntity yinlefanchang, HttpServletRequest request){
        EntityWrapper<YinlefanchangEntity> ew = new EntityWrapper<YinlefanchangEntity>();
		PageUtils page = yinlefanchangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yinlefanchang), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( YinlefanchangEntity yinlefanchang){
       	EntityWrapper<YinlefanchangEntity> ew = new EntityWrapper<YinlefanchangEntity>();
      	ew.allEq(MPUtil.allEQMapPre( yinlefanchang, "yinlefanchang")); 
        return R.ok().put("data", yinlefanchangService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(YinlefanchangEntity yinlefanchang){
        EntityWrapper< YinlefanchangEntity> ew = new EntityWrapper< YinlefanchangEntity>();
 		ew.allEq(MPUtil.allEQMapPre( yinlefanchang, "yinlefanchang")); 
		YinlefanchangView yinlefanchangView =  yinlefanchangService.selectView(ew);
		return R.ok("查询音乐翻唱成功").put("data", yinlefanchangView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        YinlefanchangEntity yinlefanchang = yinlefanchangService.selectById(id);
        return R.ok().put("data", yinlefanchang);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        YinlefanchangEntity yinlefanchang = yinlefanchangService.selectById(id);
        return R.ok().put("data", yinlefanchang);
    }
    


    /**
     * 赞或踩
     */
    @RequestMapping("/thumbsup/{id}")
    public R vote(@PathVariable("id") String id,String type){
        YinlefanchangEntity yinlefanchang = yinlefanchangService.selectById(id);
        if(type.equals("1")) {
        	yinlefanchang.setThumbsupnum(yinlefanchang.getThumbsupnum()+1);
        } else {
        	yinlefanchang.setCrazilynum(yinlefanchang.getCrazilynum()+1);
        }
        yinlefanchangService.updateById(yinlefanchang);
        return R.ok("投票成功");
    }

    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody YinlefanchangEntity yinlefanchang, HttpServletRequest request){
    	yinlefanchang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yinlefanchang);
        yinlefanchangService.insert(yinlefanchang);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody YinlefanchangEntity yinlefanchang, HttpServletRequest request){
    	yinlefanchang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yinlefanchang);
        yinlefanchangService.insert(yinlefanchang);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody YinlefanchangEntity yinlefanchang, HttpServletRequest request){
        //ValidatorUtils.validateEntity(yinlefanchang);
        yinlefanchangService.updateById(yinlefanchang);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        yinlefanchangService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<YinlefanchangEntity> wrapper = new EntityWrapper<YinlefanchangEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yonghu")) {
			wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
		}

		int count = yinlefanchangService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

Guess you like

Origin blog.csdn.net/m0_49113107/article/details/123849015