Compare commits
2 Commits
98565c9150
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed305d5bee | ||
|
|
813614df58 |
@@ -44,36 +44,39 @@ public class FileController extends BaseController {
|
|||||||
// 获取文件字节
|
// 获取文件字节
|
||||||
if (objectName.equals("musicFile")) {
|
if (objectName.equals("musicFile")) {
|
||||||
LoginUser userInfo = SecurityUtils.getLoginUser();
|
LoginUser userInfo = SecurityUtils.getLoginUser();
|
||||||
if (userInfo == null){
|
// if (userInfo == null){
|
||||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
// response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||||
response.setContentType("application/json;charset=UTF-8");
|
// response.setContentType("application/json;charset=UTF-8");
|
||||||
response.getWriter().write("{\"code\":401,\"msg\":\"用户未登录\"}");
|
// response.getWriter().write("{\"code\":401,\"msg\":\"用户未登录\"}");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
SysUser sysUser = userInfo.getUser();
|
// SysUser sysUser = userInfo.getUser();
|
||||||
if (sysUser == null) {
|
//if (sysUser == null) {
|
||||||
// if (StrUtil.isBlank(musicId)) {
|
// if (StrUtil.isBlank(musicId)) {
|
||||||
// response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
// response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||||
// response.setContentType("application/json;charset=UTF-8");
|
// response.setContentType("application/json;charset=UTF-8");
|
||||||
// response.getWriter().write("{\"code\":400,\"msg\":\"音乐ID不能为空\"}");
|
// response.getWriter().write("{\"code\":400,\"msg\":\"音乐ID不能为空\"}");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
ShopUser shopUser = userInfo.getShopUser();
|
//MusicInfo musicInfo = musicInfoMapper.selectByMusicId(musicId);
|
||||||
if (shopUser == null) {
|
|
||||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
|
||||||
response.setContentType("application/json;charset=UTF-8");
|
//ShopUser shopUser = userInfo.getShopUser();
|
||||||
response.getWriter().write("{\"code\":401,\"msg\":\"用户未登录\"}");
|
// if (shopUser == null) {
|
||||||
return;
|
// response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||||
}else{
|
// response.setContentType("application/json;charset=UTF-8");
|
||||||
// 检查会员时间
|
// response.getWriter().write("{\"code\":401,\"msg\":\"用户未登录\"}");
|
||||||
if (!MusicUtil.getShopIsVip(shopUser)) {
|
// return;
|
||||||
if (shopUser.getVip() == 1){
|
// }else{
|
||||||
// 会员已过期修改为非会员
|
// // 检查会员时间
|
||||||
shopUser.setVip(2L);
|
// if (!MusicUtil.getShopIsVip(shopUser)) {
|
||||||
shopUserMapper.updateShopUser(shopUser);
|
// if (shopUser.getVip() == 1){
|
||||||
}
|
// // 会员已过期修改为非会员
|
||||||
}
|
// shopUser.setVip(2L);
|
||||||
}
|
// shopUserMapper.updateShopUser(shopUser);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
//shopUser = shopUserMapper.selectShopUserByUserId(userId);
|
//shopUser = shopUserMapper.selectShopUserByUserId(userId);
|
||||||
// MusicInfo musicInfo = musicInfoMapper.selectByMusicId(musicId);
|
// MusicInfo musicInfo = musicInfoMapper.selectByMusicId(musicId);
|
||||||
//
|
//
|
||||||
@@ -93,7 +96,7 @@ public class FileController extends BaseController {
|
|||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置响应头
|
// 设置响应头
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.MusicInfo;
|
import com.ruoyi.common.core.domain.entity.MusicInfo;
|
||||||
import com.ruoyi.common.core.domain.entity.Notifications;
|
import com.ruoyi.common.core.domain.entity.Notifications;
|
||||||
|
import com.ruoyi.common.core.domain.entity.PlaStatus;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.mapper.PlaStatusMapper;
|
||||||
import com.ruoyi.system.service.*;
|
import com.ruoyi.system.service.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -93,4 +95,13 @@ public class IndexController extends BaseController {
|
|||||||
List<Notifications> result = notificationsService.selectNotificationsByUserId(userId);
|
List<Notifications> result = notificationsService.selectNotificationsByUserId(userId);
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PlaStatusMapper plaStatusMapper;
|
||||||
|
|
||||||
|
@GetMapping("/palStatus")
|
||||||
|
public AjaxResult palStatus(){
|
||||||
|
PlaStatus plaStatus = plaStatusMapper.selectPlaStatusById(1L);
|
||||||
|
return AjaxResult.success(plaStatus.getShareStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,9 +114,7 @@ public class MusicController extends BaseController {
|
|||||||
@RequestMapping("/getMusicInfo/{musicId}")
|
@RequestMapping("/getMusicInfo/{musicId}")
|
||||||
public AjaxResult getMusicInfo(@PathVariable String musicId){
|
public AjaxResult getMusicInfo(@PathVariable String musicId){
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
if (userId == null){
|
if (userId != null){
|
||||||
return AjaxResult.error(401,"用户未登录或用户ID为空");
|
|
||||||
}
|
|
||||||
MusicInfo musicInfo = musicService.getMusicInfo(userId, musicId);
|
MusicInfo musicInfo = musicService.getMusicInfo(userId, musicId);
|
||||||
if (musicInfo != null){
|
if (musicInfo != null){
|
||||||
// 增加历史
|
// 增加历史
|
||||||
@@ -125,6 +123,11 @@ public class MusicController extends BaseController {
|
|||||||
}else {
|
}else {
|
||||||
return new AjaxResult(HttpStatus.USER_VIP_EXPIRE, "请开通会员");
|
return new AjaxResult(HttpStatus.USER_VIP_EXPIRE, "请开通会员");
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
MusicInfo musicInfo = musicService.getMusicInfo(null, musicId);
|
||||||
|
return AjaxResult.success(musicInfo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增用户混音
|
// 新增用户混音
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: pro
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】对象 pla_status
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-11-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PlaStatus extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Boolean shareStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -145,7 +145,9 @@ public class SecurityConfig
|
|||||||
"/client/index/getCategory","/client/index/re/bind/music","/client/index/re/music",
|
"/client/index/getCategory","/client/index/re/bind/music","/client/index/re/music",
|
||||||
"/client/version/getLastVersion","/client/search/list","/client/music/find","/client" +
|
"/client/version/getLastVersion","/client/search/list","/client/music/find","/client" +
|
||||||
"/index/getCategory","/client/index/cate/music/**","/client/consult/list",
|
"/index/getCategory","/client/index/cate/music/**","/client/consult/list",
|
||||||
"/client/index/re/music/**","/client/share/list").permitAll()
|
"/client/index/re/music/**","/client/share/list","/file/download/**",
|
||||||
|
"/client/music/getMusicInfo/**","/client/music/getPrevMusicId","/client/music" +
|
||||||
|
"/getNextMusicId","/client/index/palStatus").permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.PlaStatus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-11-30
|
||||||
|
*/
|
||||||
|
public interface PlaStatusMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
public PlaStatus selectPlaStatusById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param plaStatus 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】集合
|
||||||
|
*/
|
||||||
|
public List<PlaStatus> selectPlaStatusList(PlaStatus plaStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param plaStatus 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertPlaStatus(PlaStatus plaStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param plaStatus 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updatePlaStatus(PlaStatus plaStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlaStatusById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlaStatusByIds(Long[] ids);
|
||||||
|
}
|
||||||
@@ -23,8 +23,7 @@ import java.util.stream.Collectors;
|
|||||||
* @date 2025-07-15
|
* @date 2025-07-15
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MusicInfoServiceImpl implements IMusicInfoService
|
public class MusicInfoServiceImpl implements IMusicInfoService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MusicInfoMapper musicInfoMapper;
|
private MusicInfoMapper musicInfoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -38,8 +37,6 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ShopUserMapper shopUserMapper;
|
private ShopUserMapper shopUserMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询音乐信息
|
* 查询音乐信息
|
||||||
*
|
*
|
||||||
@@ -47,8 +44,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
* @return 音乐信息
|
* @return 音乐信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MusicInfo selectMusicInfoById(String id)
|
public MusicInfo selectMusicInfoById(String id) {
|
||||||
{
|
|
||||||
return musicInfoMapper.selectMusicInfoById(id);
|
return musicInfoMapper.selectMusicInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,8 +55,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
* @return 音乐信息
|
* @return 音乐信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MusicInfo> selectMusicInfoList(MusicInfo musicInfo)
|
public List<MusicInfo> selectMusicInfoList(MusicInfo musicInfo) {
|
||||||
{
|
|
||||||
return musicInfoMapper.selectMusicInfoList(musicInfo);
|
return musicInfoMapper.selectMusicInfoList(musicInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,8 +66,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertMusicInfo(MusicInfo musicInfo)
|
public int insertMusicInfo(MusicInfo musicInfo) {
|
||||||
{
|
|
||||||
|
|
||||||
musicInfo.setCreateTime(DateUtils.getNowDate());
|
musicInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
musicInfo.setMusicId(IdUtil.getSnowflakeNextId());
|
musicInfo.setMusicId(IdUtil.getSnowflakeNextId());
|
||||||
@@ -89,8 +83,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateMusicInfo(MusicInfo musicInfo)
|
public int updateMusicInfo(MusicInfo musicInfo) {
|
||||||
{
|
|
||||||
musicInfo.setUpdateTime(DateUtils.getNowDate());
|
musicInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
return musicInfoMapper.updateMusicInfo(musicInfo);
|
return musicInfoMapper.updateMusicInfo(musicInfo);
|
||||||
}
|
}
|
||||||
@@ -102,8 +95,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteMusicInfoByIds(String[] ids)
|
public int deleteMusicInfoByIds(String[] ids) {
|
||||||
{
|
|
||||||
return musicInfoMapper.deleteMusicInfoByIds(ids);
|
return musicInfoMapper.deleteMusicInfoByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,8 +106,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteMusicInfoById(String id)
|
public int deleteMusicInfoById(String id) {
|
||||||
{
|
|
||||||
return musicInfoMapper.deleteMusicInfoById(id);
|
return musicInfoMapper.deleteMusicInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,8 +117,8 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MusicInfo> selectMusicInfoByCid(String categoryId,MusicInfo musicInfo) {
|
public List<MusicInfo> selectMusicInfoByCid(String categoryId, MusicInfo musicInfo) {
|
||||||
return musicInfoMapper.selectMusicInfoByCid(categoryId,musicInfo);
|
return musicInfoMapper.selectMusicInfoByCid(categoryId, musicInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -139,11 +130,11 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
public int addLikeMusic(String musicId) {
|
public int addLikeMusic(String musicId) {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
//查找是否已经存在我喜欢的音乐
|
//查找是否已经存在我喜欢的音乐
|
||||||
UserLikeMusic userLikeMusic = musicInfoMapper.selectMusicAndUserLike(userId,musicId);
|
UserLikeMusic userLikeMusic = musicInfoMapper.selectMusicAndUserLike(userId, musicId);
|
||||||
if (userLikeMusic != null){
|
if (userLikeMusic != null) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return musicInfoMapper.insertLikeMusic(userId,musicId);
|
return musicInfoMapper.insertLikeMusic(userId, musicId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -154,15 +145,15 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
@Override
|
@Override
|
||||||
public int cancelLikeMusic(String[] musicId) {
|
public int cancelLikeMusic(String[] musicId) {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
return musicInfoMapper.delLikeMusic(userId,musicId);
|
return musicInfoMapper.delLikeMusic(userId, musicId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int addHistoryMusic(String musicId) {
|
public int addHistoryMusic(String musicId) {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
// 先删除在田间
|
// 先删除在田间
|
||||||
musicInfoMapper.delHistoryUAndM(userId,musicId);
|
musicInfoMapper.delHistoryUAndM(userId, musicId);
|
||||||
return musicInfoMapper.insertHistory(userId,musicId);
|
return musicInfoMapper.insertHistory(userId, musicId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -180,20 +171,21 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
if (userId != null) {
|
||||||
// 查询是否是用户喜欢
|
// 查询是否是用户喜欢
|
||||||
UserLikeMusic userLikeMusic = userLikeMusicMapper.selectUserLikeMusicAndUserId(userId, musicId);
|
UserLikeMusic userLikeMusic = userLikeMusicMapper.selectUserLikeMusicAndUserId(userId, musicId);
|
||||||
if (userLikeMusic != null){
|
if (userLikeMusic != null) {
|
||||||
musicInfo.setLike(true);
|
musicInfo.setLike(true);
|
||||||
}
|
}
|
||||||
// 查询是否是用户分类
|
// 查询是否是用户分类
|
||||||
UserCollect userCollect = userCollectMapper.selectUserCollectAndUserId(userId, musicId);
|
UserCollect userCollect = userCollectMapper.selectUserCollectAndUserId(userId, musicId);
|
||||||
if (userCollect != null){
|
if (userCollect != null) {
|
||||||
musicInfo.setCollect(true);
|
musicInfo.setCollect(true);
|
||||||
musicInfo.setUserCollect(userCollect);
|
musicInfo.setUserCollect(userCollect);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 判断是否是是混音
|
// 判断是否是是混音
|
||||||
if (musicInfo.getMusicType().equals(MusicType.MIXING.getMusicType())){
|
if (musicInfo.getMusicType().equals(MusicType.MIXING.getMusicType())) {
|
||||||
// 查询混音相关信息
|
// 查询混音相关信息
|
||||||
MusicSceneRelate relateInfo = relateMapper.selectByMusicId(musicId);
|
MusicSceneRelate relateInfo = relateMapper.selectByMusicId(musicId);
|
||||||
String sceneIds = relateInfo.getSceneIds();
|
String sceneIds = relateInfo.getSceneIds();
|
||||||
@@ -219,7 +211,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
//if (musicInfo != null){
|
//if (musicInfo != null){
|
||||||
long newMusicId = IdUtil.getSnowflakeNextId();
|
long newMusicId = IdUtil.getSnowflakeNextId();
|
||||||
param.setMusicId(newMusicId);
|
param.setMusicId(newMusicId);
|
||||||
if (param.getName() == null || (param.getName()).isEmpty()){
|
if (param.getName() == null || (param.getName()).isEmpty()) {
|
||||||
param.setName(userName + DateUtil.current());
|
param.setName(userName + DateUtil.current());
|
||||||
}
|
}
|
||||||
param.setMusicType(MusicType.MIXING.getMusicType());
|
param.setMusicType(MusicType.MIXING.getMusicType());
|
||||||
@@ -246,7 +238,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
String sourceMusicId = param.getSourceMusicId();
|
String sourceMusicId = param.getSourceMusicId();
|
||||||
// 查询混音音乐
|
// 查询混音音乐
|
||||||
MusicInfo musicInfo = musicInfoMapper.selectByMusicId(String.valueOf(musicId));
|
MusicInfo musicInfo = musicInfoMapper.selectByMusicId(String.valueOf(musicId));
|
||||||
if (musicInfo != null){
|
if (musicInfo != null) {
|
||||||
// 先删除在新增
|
// 先删除在新增
|
||||||
relateMapper.deleteByMusicId(musicId);
|
relateMapper.deleteByMusicId(musicId);
|
||||||
//musicSceneMapper.selectMusicSceneById()
|
//musicSceneMapper.selectMusicSceneById()
|
||||||
@@ -284,7 +276,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
public String getPrevMusicId(Long userId, Integer playMode, Integer playlistType, String categoryId, String collectId, String reId, String currentMusicId) {
|
public String getPrevMusicId(Long userId, Integer playMode, Integer playlistType, String categoryId, String collectId, String reId, String currentMusicId) {
|
||||||
List<MusicInfo> musicList = null;
|
List<MusicInfo> musicList = null;
|
||||||
|
|
||||||
// 根据播放列表类型获取对应的音乐列表
|
if (userId != null) {
|
||||||
switch (playlistType) {
|
switch (playlistType) {
|
||||||
case 1: // 历史播放
|
case 1: // 历史播放
|
||||||
musicList = musicInfoMapper.selectHistoryMusicByUser(userId);
|
musicList = musicInfoMapper.selectHistoryMusicByUser(userId);
|
||||||
@@ -293,7 +285,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
if (categoryId == null || categoryId.isEmpty()) {
|
if (categoryId == null || categoryId.isEmpty()) {
|
||||||
return null; // 分类播放必须提供分类ID
|
return null; // 分类播放必须提供分类ID
|
||||||
}
|
}
|
||||||
musicList = musicInfoMapper.selectMusicInfoByCid(categoryId,new MusicInfo());
|
musicList = musicInfoMapper.selectMusicInfoByCid(categoryId, new MusicInfo());
|
||||||
break;
|
break;
|
||||||
case 3: // 推荐播放
|
case 3: // 推荐播放
|
||||||
if (reId == null || reId.isEmpty()) {
|
if (reId == null || reId.isEmpty()) {
|
||||||
@@ -315,13 +307,16 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return musicInfoMapper.selectListRandomMusic(currentMusicId);
|
||||||
|
}
|
||||||
|
// 根据播放列表类型获取对应的音乐列表
|
||||||
|
|
||||||
// 如果列表为空,返回null
|
// 如果列表为空,返回null
|
||||||
if (musicList == null || musicList.isEmpty()) {
|
if (musicList == null || musicList.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据播放模式获取上一首音乐ID
|
// 根据播放模式获取上一首音乐ID
|
||||||
if (playMode == 1) { // 顺序播放
|
if (playMode == 1) { // 顺序播放
|
||||||
// 按照ID排序列表
|
// 按照ID排序列表
|
||||||
@@ -331,8 +326,6 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
return idA.compareTo(idB);
|
return idA.compareTo(idB);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 如果没有当前音乐ID,返回列表中的最后一首
|
// 如果没有当前音乐ID,返回列表中的最后一首
|
||||||
if (currentMusicId == null || currentMusicId.isEmpty()) {
|
if (currentMusicId == null || currentMusicId.isEmpty()) {
|
||||||
return musicList.get(musicList.size() - 1).getMusicId().toString();
|
return musicList.get(musicList.size() - 1).getMusicId().toString();
|
||||||
@@ -381,6 +374,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
public String getNextMusicId(Long userId, Integer playMode, Integer playlistType, String categoryId, String collectId, String reId, String currentMusicId) {
|
public String getNextMusicId(Long userId, Integer playMode, Integer playlistType, String categoryId, String collectId, String reId, String currentMusicId) {
|
||||||
List<MusicInfo> musicList = null;
|
List<MusicInfo> musicList = null;
|
||||||
|
|
||||||
|
if (userId != null) {
|
||||||
// 根据播放列表类型获取对应的音乐列表
|
// 根据播放列表类型获取对应的音乐列表
|
||||||
switch (playlistType) {
|
switch (playlistType) {
|
||||||
case 1: // 历史播放
|
case 1: // 历史播放
|
||||||
@@ -390,7 +384,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
if (categoryId == null || categoryId.isEmpty()) {
|
if (categoryId == null || categoryId.isEmpty()) {
|
||||||
return null; // 分类播放必须提供分类ID
|
return null; // 分类播放必须提供分类ID
|
||||||
}
|
}
|
||||||
musicList = musicInfoMapper.selectMusicInfoByCid(categoryId,new MusicInfo());
|
musicList = musicInfoMapper.selectMusicInfoByCid(categoryId, new MusicInfo());
|
||||||
break;
|
break;
|
||||||
case 3: // 推荐播放
|
case 3: // 推荐播放
|
||||||
if (reId == null || reId.isEmpty()) {
|
if (reId == null || reId.isEmpty()) {
|
||||||
@@ -412,6 +406,9 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return musicInfoMapper.selectListRandomMusic(currentMusicId);
|
||||||
|
}
|
||||||
|
|
||||||
// 如果列表为空,返回null
|
// 如果列表为空,返回null
|
||||||
if (musicList == null || musicList.isEmpty()) {
|
if (musicList == null || musicList.isEmpty()) {
|
||||||
@@ -468,7 +465,6 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询喜欢的音乐数量
|
* 根据用户ID查询喜欢的音乐数量
|
||||||
*
|
*
|
||||||
@@ -500,7 +496,6 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
@Override
|
@Override
|
||||||
public List<MusicInfo> findLikeSearch(String search) {
|
public List<MusicInfo> findLikeSearch(String search) {
|
||||||
|
|
||||||
|
|
||||||
// 根据作者名称或音乐名称模糊搜索音乐
|
// 根据作者名称或音乐名称模糊搜索音乐
|
||||||
List<MusicInfo> musicList = musicInfoMapper.selectMusicInfoBySearch(search);
|
List<MusicInfo> musicList = musicInfoMapper.selectMusicInfoBySearch(search);
|
||||||
|
|
||||||
@@ -524,9 +519,9 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO: 待完善
|
//TODO: 待完善
|
||||||
public Map<String, String> getMixMusicInfo(String musicId){
|
public Map<String, String> getMixMusicInfo(String musicId) {
|
||||||
MusicInfo musicInfo = musicInfoMapper.selectByMusicId(musicId);
|
MusicInfo musicInfo = musicInfoMapper.selectByMusicId(musicId);
|
||||||
if (musicInfo.getMusicType().equals(MusicType.MIXING.getMusicType())){
|
if (musicInfo.getMusicType().equals(MusicType.MIXING.getMusicType())) {
|
||||||
// 获取混音信息
|
// 获取混音信息
|
||||||
relateMapper.selectByMusicId(musicId);
|
relateMapper.selectByMusicId(musicId);
|
||||||
|
|
||||||
@@ -537,7 +532,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
@Override
|
@Override
|
||||||
public MusicInfo selectUserLikeMusic(String musicId, Long userId) {
|
public MusicInfo selectUserLikeMusic(String musicId, Long userId) {
|
||||||
MusicInfo musicInfo = musicInfoMapper.selectUserLikeMusic(musicId, userId);
|
MusicInfo musicInfo = musicInfoMapper.selectUserLikeMusic(musicId, userId);
|
||||||
if (musicInfo != null){
|
if (musicInfo != null) {
|
||||||
musicInfo.setLike(true);
|
musicInfo.setLike(true);
|
||||||
return musicInfo;
|
return musicInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||||||
orderInfo.setOrderName(request.getOrderName());
|
orderInfo.setOrderName(request.getOrderName());
|
||||||
orderInfo.setUserId(loginUser.getUserId());
|
orderInfo.setUserId(loginUser.getUserId());
|
||||||
Product product = productMapper.selectProductByPageType(request.getPackageType());
|
Product product = productMapper.selectProductByPageType(request.getPackageType());
|
||||||
orderInfo.setAmount(new BigDecimal("0.01"));
|
orderInfo.setAmount(product.getCurrentPrice());
|
||||||
orderInfo.setPayType(request.getPayType());
|
orderInfo.setPayType(request.getPayType());
|
||||||
orderInfo.setPackageType(request.getPackageType());
|
orderInfo.setPackageType(request.getPackageType());
|
||||||
orderInfo.setDeviceType(request.getDeviceType());
|
orderInfo.setDeviceType(request.getDeviceType());
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.PlaStatusMapper">
|
||||||
|
|
||||||
|
<resultMap type="PlaStatus" id="PlaStatusResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="shareStatus" column="share_status" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectPlaStatusVo">
|
||||||
|
select id, share_status from pla_status
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectPlaStatusList" parameterType="PlaStatus" resultMap="PlaStatusResult">
|
||||||
|
<include refid="selectPlaStatusVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="shareStatus != null "> and share_status = #{shareStatus}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPlaStatusById" parameterType="Long" resultMap="PlaStatusResult">
|
||||||
|
<include refid="selectPlaStatusVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPlaStatus" parameterType="PlaStatus" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into pla_status
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="shareStatus != null">share_status,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="shareStatus != null">#{shareStatus},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatePlaStatus" parameterType="PlaStatus">
|
||||||
|
update pla_status
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="shareStatus != null">share_status = #{shareStatus},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deletePlaStatusById" parameterType="Long">
|
||||||
|
delete from pla_status where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePlaStatusByIds" parameterType="String">
|
||||||
|
delete from pla_status where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user