完善c端接口
This commit is contained in:
@@ -0,0 +1,98 @@
|
|||||||
|
package com.ruoyi.web.controller.client;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.MusicCollect;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.service.IMusicCollectService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/collect")
|
||||||
|
public class MusicCollectController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IMusicCollectService musicCollectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:collect:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<MusicCollect> list = musicCollectService.selectMusicCollectList(musicCollect);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出【请填写功能名称】列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:collect:export')")
|
||||||
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
List<MusicCollect> list = musicCollectService.selectMusicCollectList(musicCollect);
|
||||||
|
ExcelUtil<MusicCollect> util = new ExcelUtil<MusicCollect>(MusicCollect.class);
|
||||||
|
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取【请填写功能名称】详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:collect:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(musicCollectService.selectMusicCollectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:collect:add')")
|
||||||
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
return toAjax(musicCollectService.insertMusicCollect(musicCollect));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:collect:edit')")
|
||||||
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
return toAjax(musicCollectService.updateMusicCollect(musicCollect));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:collect:remove')")
|
||||||
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(musicCollectService.deleteMusicCollectByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,24 @@
|
|||||||
package com.ruoyi.web.controller.client;
|
package com.ruoyi.web.controller.client;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.CategoryInfo;
|
import com.ruoyi.common.core.domain.entity.CategoryInfo;
|
||||||
|
import com.ruoyi.common.core.domain.entity.MusicInfo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.system.service.IMusicInfoService;
|
import com.ruoyi.system.service.IMusicInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RequestMapping("/client/music")
|
@RequestMapping("/client/music")
|
||||||
@RestController
|
@RestController
|
||||||
public class MusicController {
|
public class MusicController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMusicInfoService musicService;
|
private IMusicInfoService musicService;
|
||||||
@@ -21,4 +29,56 @@ public class MusicController {
|
|||||||
musicService.findMusicByCate(categoryInfo);
|
musicService.findMusicByCate(categoryInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 创建歌单
|
||||||
|
@RequestMapping("/collect/music/{collectId}")
|
||||||
|
public TableDataInfo createPlaylist(@PathVariable String collectId){
|
||||||
|
startPage();
|
||||||
|
List<MusicInfo> list = musicService.findMusicByCollectId(collectId);
|
||||||
|
//musicService.createPlaylist();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 添加我喜欢的音乐
|
||||||
|
@RequestMapping("/like/music/{musicId}")
|
||||||
|
public AjaxResult addLikeMusic(@PathVariable String musicId){
|
||||||
|
musicService.addLikeMusic(musicId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取我喜欢的音乐
|
||||||
|
@RequestMapping("/like/music")
|
||||||
|
public TableDataInfo likeMusic(){
|
||||||
|
startPage();
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
List<MusicInfo> list = musicService.findLikeMusicByUser(userId);
|
||||||
|
//musicService.createPlaylist();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
// 删除我喜欢的音乐 cancel/like
|
||||||
|
@RequestMapping("/cancel/like/{musicId}")
|
||||||
|
public AjaxResult cancelLikeMusic(@PathVariable String musicId){
|
||||||
|
musicService.cancelLikeMusic(musicId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
// // 新增历史
|
||||||
|
// @RequestMapping("/history/add/{musicId}")
|
||||||
|
// public AjaxResult addHistory(@PathVariable String musicId){
|
||||||
|
// musicService.addHistoryMusic(musicId);
|
||||||
|
// return AjaxResult.success();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 查询历史
|
||||||
|
@RequestMapping("/history/music")
|
||||||
|
public TableDataInfo historyMusic(){
|
||||||
|
startPage();
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
List<MusicInfo> list = musicService.findHistoryMusicByUser(userId);
|
||||||
|
//musicService.createPlaylist();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.web.controller.client;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.ShareInfo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.service.IShareInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/client/share")
|
||||||
|
public class ShareInfoController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IShareInfoService shareInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(ShareInfo shareInfo)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<ShareInfo> list = shareInfoService.findShareInfoListPage(shareInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出【请填写功能名称】列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, ShareInfo shareInfo)
|
||||||
|
{
|
||||||
|
List<ShareInfo> list = shareInfoService.selectShareInfoList(shareInfo);
|
||||||
|
ExcelUtil<ShareInfo> util = new ExcelUtil<ShareInfo>(ShareInfo.class);
|
||||||
|
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取【请填写功能名称】详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:info:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(shareInfoService.selectShareInfoById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public AjaxResult add(@RequestBody ShareInfo shareInfo)
|
||||||
|
{
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
shareInfo.setUserId(userId);
|
||||||
|
return toAjax(shareInfoService.insertShareInfo(shareInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:info:edit')")
|
||||||
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody ShareInfo shareInfo)
|
||||||
|
{
|
||||||
|
return toAjax(shareInfoService.updateShareInfo(shareInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:info:remove')")
|
||||||
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(shareInfoService.deleteShareInfoByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,20 @@
|
|||||||
package com.ruoyi.web.controller.back;
|
package com.ruoyi.web.controller.client;
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
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.MusicCollect;
|
||||||
import com.ruoyi.common.core.domain.entity.UserCollect;
|
import com.ruoyi.common.core.domain.entity.UserCollect;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.service.IMusicCollectService;
|
||||||
import com.ruoyi.system.service.IUserCollectService;
|
import com.ruoyi.system.service.IUserCollectService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import oshi.util.platform.mac.SysctlUtil;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -22,20 +26,23 @@ import java.util.List;
|
|||||||
* @date 2025-07-15
|
* @date 2025-07-15
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/back/collect")
|
@RequestMapping("/client/collect")
|
||||||
public class UserCollectController extends BaseController
|
public class UserCollectController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private IUserCollectService userCollectService;
|
private IUserCollectService userCollectService;
|
||||||
|
@Autowired
|
||||||
|
private IMusicCollectService musicCollectService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户收藏音乐列表
|
* 查询用户收藏音乐列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:collect:list')")
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(UserCollect userCollect)
|
public TableDataInfo list(UserCollect userCollect)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
userCollect.setUserId(userId);
|
||||||
List<UserCollect> list = userCollectService.selectUserCollectList(userCollect);
|
List<UserCollect> list = userCollectService.selectUserCollectList(userCollect);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
@@ -66,14 +73,49 @@ public class UserCollectController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增用户收藏音乐
|
* 新增用户收藏音乐
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:collect:add')")
|
@PostMapping("/create")
|
||||||
@Log(title = "用户收藏音乐", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody UserCollect userCollect)
|
public AjaxResult add(@RequestBody UserCollect userCollect)
|
||||||
{
|
{
|
||||||
return toAjax(userCollectService.insertUserCollect(userCollect));
|
userCollectService.insertUserCollect(userCollect);
|
||||||
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户收藏音乐
|
||||||
|
*/
|
||||||
|
@PostMapping("/bind")
|
||||||
|
public AjaxResult bind(@RequestBody MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
musicCollectService.insertMusicCollect(musicCollect);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除歌单
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
int del = userCollectService.deleteUserCollectByIds(ids);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消收藏歌单
|
||||||
|
*/
|
||||||
|
@PostMapping("/cancel/bind")
|
||||||
|
public AjaxResult cancel(@RequestBody MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
userCollectService.cancelBindMusic(musicCollect);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户收藏音乐
|
* 修改用户收藏音乐
|
||||||
*/
|
*/
|
||||||
@@ -85,14 +127,5 @@ public class UserCollectController extends BaseController
|
|||||||
return toAjax(userCollectService.updateUserCollect(userCollect));
|
return toAjax(userCollectService.updateUserCollect(userCollect));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除用户收藏音乐
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:collect:remove')")
|
|
||||||
@Log(title = "用户收藏音乐", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{ids}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
|
||||||
{
|
|
||||||
return toAjax(userCollectService.deleteUserCollectByIds(ids));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.web.controller.back;
|
package com.ruoyi.web.controller.client;
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||||||
import com.ruoyi.common.core.domain.entity.UserHistory;
|
import com.ruoyi.common.core.domain.entity.UserHistory;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.service.IUserHistoryService;
|
import com.ruoyi.system.service.IUserHistoryService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -22,7 +23,7 @@ import java.util.List;
|
|||||||
* @date 2025-07-15
|
* @date 2025-07-15
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/back/history")
|
@RequestMapping("/client/history")
|
||||||
public class UserHistoryController extends BaseController
|
public class UserHistoryController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -31,7 +32,6 @@ public class UserHistoryController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询用户播放历史列表
|
* 查询用户播放历史列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:history:list')")
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(UserHistory userHistory)
|
public TableDataInfo list(UserHistory userHistory)
|
||||||
{
|
{
|
||||||
@@ -63,17 +63,6 @@ public class UserHistoryController extends BaseController
|
|||||||
return success(userHistoryService.selectUserHistoryById(id));
|
return success(userHistoryService.selectUserHistoryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增用户播放历史
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:history:add')")
|
|
||||||
@Log(title = "用户播放历史", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody UserHistory userHistory)
|
|
||||||
{
|
|
||||||
return toAjax(userHistoryService.insertUserHistory(userHistory));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户播放历史
|
* 修改用户播放历史
|
||||||
*/
|
*/
|
||||||
@@ -85,11 +74,32 @@ public class UserHistoryController extends BaseController
|
|||||||
return toAjax(userHistoryService.updateUserHistory(userHistory));
|
return toAjax(userHistoryService.updateUserHistory(userHistory));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户播放历史
|
||||||
|
*/
|
||||||
|
@GetMapping("/add/{musicId}")
|
||||||
|
public AjaxResult add(@PathVariable String musicId)
|
||||||
|
{
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
UserHistory userHistory = new UserHistory();
|
||||||
|
userHistory.setMusicId(Long.parseLong(musicId));
|
||||||
|
userHistory.setUserId(userId);
|
||||||
|
return toAjax(userHistoryService.insertUserHistory(userHistory));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户播放历史
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/del/history/{musicId}")
|
||||||
|
public AjaxResult removeHistory(@PathVariable String[] musicId)
|
||||||
|
{
|
||||||
|
userHistoryService.deleteUserHistoryByMusicId(musicId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除用户播放历史
|
* 删除用户播放历史
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:history:remove')")
|
|
||||||
@Log(title = "用户播放历史", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable String[] ids)
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】对象 music_collect
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-18
|
||||||
|
*/
|
||||||
|
public class MusicCollect extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 音乐ID */
|
||||||
|
@Excel(name = "音乐ID")
|
||||||
|
private Long musicId;
|
||||||
|
|
||||||
|
/** 收藏id */
|
||||||
|
@Excel(name = "收藏id")
|
||||||
|
private Long collectId;
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMusicId(Long musicId)
|
||||||
|
{
|
||||||
|
this.musicId = musicId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMusicId()
|
||||||
|
{
|
||||||
|
return musicId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollectId(Long collectId)
|
||||||
|
{
|
||||||
|
this.collectId = collectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCollectId()
|
||||||
|
{
|
||||||
|
return collectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("musicId", getMusicId())
|
||||||
|
.append("collectId", getCollectId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】对象 share_info
|
||||||
|
*
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ShareInfo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 用户id */
|
||||||
|
@Excel(name = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 分享描述 */
|
||||||
|
@Excel(name = "分享描述")
|
||||||
|
private String shareDecs;
|
||||||
|
|
||||||
|
/** 分享音乐 */
|
||||||
|
@Excel(name = "分享音乐")
|
||||||
|
private Long musicId;
|
||||||
|
|
||||||
|
/** 分享地址 */
|
||||||
|
@Excel(name = "分享地址")
|
||||||
|
private String shareAddr;
|
||||||
|
|
||||||
|
/** 分享平台 */
|
||||||
|
@Excel(name = "分享平台")
|
||||||
|
private String sharePlat;
|
||||||
|
|
||||||
|
/** 1 删除 */
|
||||||
|
@Excel(name = "1 删除")
|
||||||
|
private Long isDel;
|
||||||
|
|
||||||
|
/** 1 审核 */
|
||||||
|
@Excel(name = "1 审核")
|
||||||
|
private Long review;
|
||||||
|
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
private String headImg;
|
||||||
|
|
||||||
|
private String musicName;
|
||||||
|
|
||||||
|
private String musicImgAddr;
|
||||||
|
|
||||||
|
private String musicAuthor;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -79,4 +79,10 @@ public class ShopUser {
|
|||||||
/** 1 删除 */
|
/** 1 删除 */
|
||||||
@Excel(name = "1 删除")
|
@Excel(name = "1 删除")
|
||||||
private Long isDel;
|
private Long isDel;
|
||||||
|
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
private String headImg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,8 @@ public class ShopUserResq {
|
|||||||
private String uMtoken;
|
private String uMtoken;
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
private String deviceId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
@@ -11,6 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2025-07-15
|
* @date 2025-07-15
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class UserCollect extends BaseEntity
|
public class UserCollect extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -24,7 +26,7 @@ public class UserCollect extends BaseEntity
|
|||||||
|
|
||||||
/** 音乐id */
|
/** 音乐id */
|
||||||
@Excel(name = "音乐id")
|
@Excel(name = "音乐id")
|
||||||
private Long musicId;
|
private Long collectId;
|
||||||
|
|
||||||
/** 收藏名称 */
|
/** 收藏名称 */
|
||||||
@Excel(name = "收藏名称")
|
@Excel(name = "收藏名称")
|
||||||
@@ -34,66 +36,5 @@ public class UserCollect extends BaseEntity
|
|||||||
@Excel(name = "歌单类型 音乐类型 ordinary 混音mixing")
|
@Excel(name = "歌单类型 音乐类型 ordinary 混音mixing")
|
||||||
private String collectType;
|
private String collectType;
|
||||||
|
|
||||||
public void setId(Long id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Long userId)
|
|
||||||
{
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getUserId()
|
|
||||||
{
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMusicId(Long musicId)
|
|
||||||
{
|
|
||||||
this.musicId = musicId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getMusicId()
|
|
||||||
{
|
|
||||||
return musicId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCollectName(String collectName)
|
|
||||||
{
|
|
||||||
this.collectName = collectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCollectName()
|
|
||||||
{
|
|
||||||
return collectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCollectType(String collectType)
|
|
||||||
{
|
|
||||||
this.collectType = collectType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCollectType()
|
|
||||||
{
|
|
||||||
return collectType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("id", getId())
|
|
||||||
.append("userId", getUserId())
|
|
||||||
.append("musicId", getMusicId())
|
|
||||||
.append("collectName", getCollectName())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("updateTime", getUpdateTime())
|
|
||||||
.append("collectType", getCollectType())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,12 @@ public class LoginUser implements UserDetails
|
|||||||
|
|
||||||
public Long getUserId()
|
public Long getUserId()
|
||||||
{
|
{
|
||||||
return userId;
|
if (userId != null){
|
||||||
|
return userId;
|
||||||
|
}else if(shopUser != null){
|
||||||
|
return shopUser.getUserId();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserId(Long userId)
|
public void setUserId(Long userId)
|
||||||
|
|||||||
@@ -63,12 +63,12 @@ public class AliConfig {
|
|||||||
|
|
||||||
//String templateParam = "{\"name\":\"" + shopUser.getUsername() + "\",\"number\":\""+ shopUser.getPhone() +"\"}";
|
//String templateParam = "{\"name\":\"" + shopUser.getUsername() + "\",\"number\":\""+ shopUser.getPhone() +"\"}";
|
||||||
|
|
||||||
String templateParam = "您的验证码为:"+ shopUser.getCode() +",请勿泄露于他人!";
|
String templateParam = "{'code':"+ code + "}";
|
||||||
|
|
||||||
// 构造API请求对象,请替换请求参数值
|
// 构造API请求对象,请替换请求参数值
|
||||||
SendSmsRequest sendSmsRequest = new SendSmsRequest()
|
SendSmsRequest sendSmsRequest = new SendSmsRequest()
|
||||||
.setPhoneNumbers(shopUser.getPhone())
|
.setPhoneNumbers(shopUser.getPhone())
|
||||||
.setSignName("阿里云短信测试")
|
.setSignName("北京盛兴平商贸")
|
||||||
.setTemplateCode("SMS_323405385")
|
.setTemplateCode("SMS_323405385")
|
||||||
.setTemplateParam(templateParam); // TemplateParam为序列化后的JSON字符串。
|
.setTemplateParam(templateParam); // TemplateParam为序列化后的JSON字符串。
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ import org.apache.http.client.methods.HttpPost;
|
|||||||
import org.apache.http.entity.StringEntity;
|
import org.apache.http.entity.StringEntity;
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
import org.apache.http.impl.client.HttpClients;
|
import org.apache.http.impl.client.HttpClients;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import javax.crypto.Mac;
|
import javax.crypto.Mac;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
@@ -25,10 +25,10 @@ import java.util.Map;
|
|||||||
@Component
|
@Component
|
||||||
public class UmengConfig {
|
public class UmengConfig {
|
||||||
|
|
||||||
public CloseableHttpResponse send(String token){
|
public static CloseableHttpResponse send(String token){
|
||||||
String umAppkey = "xxxx";
|
String umAppkey = "5df88f83570df3b8d40012337";
|
||||||
String appKey = "5df88f83570df3b8d40012337";
|
String appKey = "LTAI5tDWWzwqxumUXTFnkQFd";
|
||||||
String appSecret = "xxxx";
|
String appSecret = "KOD3y6OxbHJ23wxAf68NFpUQXCQEPX";
|
||||||
// 下面的url要和阿里云云市场购买的商品对应
|
// 下面的url要和阿里云云市场购买的商品对应
|
||||||
String url = "https://verify5.market.alicloudapi.com/api/v1/mobile/info?appkey=" + umAppkey;
|
String url = "https://verify5.market.alicloudapi.com/api/v1/mobile/info?appkey=" + umAppkey;
|
||||||
HttpPost httpPost = new HttpPost(url);
|
HttpPost httpPost = new HttpPost(url);
|
||||||
@@ -85,8 +85,11 @@ public class UmengConfig {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws InvalidKeyException, NoSuchAlgorithmException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
CloseableHttpResponse sss = send("1234");
|
||||||
|
String reponseContent = EntityUtils.toString(sss.getEntity());
|
||||||
|
System.out.println(reponseContent);
|
||||||
|
System.out.println(sss.getStatusLine().getReasonPhrase());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getSignString(HttpPost httpPost) {
|
private static String getSignString(HttpPost httpPost) {
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.MusicCollect;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-18
|
||||||
|
*/
|
||||||
|
public interface MusicCollectMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
public MusicCollect selectMusicCollectById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】集合
|
||||||
|
*/
|
||||||
|
public List<MusicCollect> selectMusicCollectList(MusicCollect musicCollect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMusicCollect(MusicCollect musicCollect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMusicCollect(MusicCollect musicCollect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMusicCollectById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMusicCollectByIds(String[] ids);
|
||||||
|
|
||||||
|
int delBindMusic(MusicCollect musicCollect);
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
|||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.CategoryInfo;
|
import com.ruoyi.common.core.domain.entity.CategoryInfo;
|
||||||
import com.ruoyi.common.core.domain.entity.MusicInfo;
|
import com.ruoyi.common.core.domain.entity.MusicInfo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -68,4 +69,16 @@ public interface MusicInfoMapper
|
|||||||
List<MusicInfo> selectMusicInfoByIds(List<Long> musicIdList);
|
List<MusicInfo> selectMusicInfoByIds(List<Long> musicIdList);
|
||||||
|
|
||||||
List<MusicInfo> selectRecommendMusic();
|
List<MusicInfo> selectRecommendMusic();
|
||||||
|
|
||||||
|
List<MusicInfo> selectMusicByCollectId(String collectId);
|
||||||
|
|
||||||
|
int insertLikeMusic(@Param("userId") Long userId,@Param("musicId") String musicId);
|
||||||
|
|
||||||
|
List<MusicInfo> selectLikeMusicByUser(Long userId);
|
||||||
|
|
||||||
|
int delLikeMusic(@Param("userId") Long userId,@Param("musicId") String musicId);
|
||||||
|
|
||||||
|
int insertHistory(@Param("userId") Long userId,@Param("musicId") String musicId);
|
||||||
|
|
||||||
|
List<MusicInfo> selectHistoryMusicByUser(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.ShareInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
public interface ShareInfoMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
public ShareInfo selectShareInfoById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】集合
|
||||||
|
*/
|
||||||
|
public List<ShareInfo> selectShareInfoList(ShareInfo shareInfo);
|
||||||
|
|
||||||
|
|
||||||
|
public List<ShareInfo> selectShareInfoListPage(ShareInfo shareInfo);
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertShareInfo(ShareInfo shareInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateShareInfo(ShareInfo shareInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteShareInfoById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteShareInfoByIds(String[] ids);
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.UserHistory;
|
import com.ruoyi.common.core.domain.entity.UserHistory;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -59,4 +60,6 @@ public interface UserHistoryMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserHistoryByIds(String[] ids);
|
public int deleteUserHistoryByIds(String[] ids);
|
||||||
|
|
||||||
|
int deleteUserHistoryByMusicId(@Param("musicIds") String[] musicIds,@Param("userId") Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.MusicCollect;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-18
|
||||||
|
*/
|
||||||
|
public interface IMusicCollectService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
public MusicCollect selectMusicCollectById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】集合
|
||||||
|
*/
|
||||||
|
public List<MusicCollect> selectMusicCollectList(MusicCollect musicCollect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMusicCollect(MusicCollect musicCollect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMusicCollect(MusicCollect musicCollect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMusicCollectByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】信息
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMusicCollectById(String id);
|
||||||
|
}
|
||||||
@@ -65,4 +65,16 @@ public interface IMusicInfoService
|
|||||||
List<MusicInfo> findMusicByCate(CategoryInfo categoryInfo);
|
List<MusicInfo> findMusicByCate(CategoryInfo categoryInfo);
|
||||||
|
|
||||||
List<MusicInfo> selectMusicInfoByCid(String categoryId);
|
List<MusicInfo> selectMusicInfoByCid(String categoryId);
|
||||||
|
|
||||||
|
List<MusicInfo> findMusicByCollectId(String collectId);
|
||||||
|
|
||||||
|
int addLikeMusic(String musicId);
|
||||||
|
|
||||||
|
List<MusicInfo> findLikeMusicByUser(Long userId);
|
||||||
|
|
||||||
|
int cancelLikeMusic(String musicId);
|
||||||
|
|
||||||
|
int addHistoryMusic(String musicId);
|
||||||
|
|
||||||
|
List<MusicInfo> findHistoryMusicByUser(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.ShareInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
public interface IShareInfoService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
public ShareInfo selectShareInfoById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】集合
|
||||||
|
*/
|
||||||
|
public List<ShareInfo> selectShareInfoList(ShareInfo shareInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertShareInfo(ShareInfo shareInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateShareInfo(ShareInfo shareInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteShareInfoByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】信息
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteShareInfoById(String id);
|
||||||
|
|
||||||
|
List<ShareInfo> findShareInfoListPage(ShareInfo shareInfo);
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.system.service;
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.MusicCollect;
|
||||||
import com.ruoyi.common.core.domain.entity.UserCollect;
|
import com.ruoyi.common.core.domain.entity.UserCollect;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -59,4 +60,6 @@ public interface IUserCollectService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserCollectById(Long id);
|
public int deleteUserCollectById(Long id);
|
||||||
|
|
||||||
|
int cancelBindMusic(MusicCollect musicCollect);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,4 +59,8 @@ public interface IUserHistoryService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserHistoryById(String id);
|
public int deleteUserHistoryById(String id);
|
||||||
|
|
||||||
|
int insertHistory(Long userId, String musicId);
|
||||||
|
|
||||||
|
int deleteUserHistoryByMusicId(String[] musicId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class CShopUserServiceImpl implements ShopUserService {
|
|||||||
}
|
}
|
||||||
case "2":
|
case "2":
|
||||||
// 验证码
|
// 验证码
|
||||||
String code = redisCache.getCacheObject(shopUser.getPhone());
|
String code = redisCache.getCacheObject("sms_code:"+shopUser.getPhone());
|
||||||
String reqCode = shopUser.getCode();
|
String reqCode = shopUser.getCode();
|
||||||
if (code.equals(reqCode)){
|
if (code.equals(reqCode)){
|
||||||
// 登录
|
// 登录
|
||||||
@@ -68,6 +68,9 @@ public class CShopUserServiceImpl implements ShopUserService {
|
|||||||
member.setPhone(shopUser.getPhone());
|
member.setPhone(shopUser.getPhone());
|
||||||
member.setPassword(IdUtil.fastUUID());
|
member.setPassword(IdUtil.fastUUID());
|
||||||
member.setUsername(shopUser.getUsername());
|
member.setUsername(shopUser.getUsername());
|
||||||
|
member.setDeviceId(shopUser.getDeviceId());
|
||||||
|
member.setDeviceType(shopUser.getDeviceType());
|
||||||
|
member.setHeadImg("/file/download/user/head.jpg");
|
||||||
int insertCount = shopUserMapper.insert(member);
|
int insertCount = shopUserMapper.insert(member);
|
||||||
if (insertCount > 0){
|
if (insertCount > 0){
|
||||||
return member;
|
return member;
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.MusicCollect;
|
||||||
|
import com.ruoyi.system.mapper.MusicCollectMapper;
|
||||||
|
import com.ruoyi.system.service.IMusicCollectService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MusicCollectServiceImpl implements IMusicCollectService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private MusicCollectMapper musicCollectMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public MusicCollect selectMusicCollectById(String id)
|
||||||
|
{
|
||||||
|
return musicCollectMapper.selectMusicCollectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MusicCollect> selectMusicCollectList(MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
return musicCollectMapper.selectMusicCollectList(musicCollect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertMusicCollect(MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
return musicCollectMapper.insertMusicCollect(musicCollect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param musicCollect 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateMusicCollect(MusicCollect musicCollect)
|
||||||
|
{
|
||||||
|
return musicCollectMapper.updateMusicCollect(musicCollect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMusicCollectByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return musicCollectMapper.deleteMusicCollectByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】信息
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMusicCollectById(String id)
|
||||||
|
{
|
||||||
|
return musicCollectMapper.deleteMusicCollectById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ import com.ruoyi.common.utils.SecurityUtils;
|
|||||||
import com.ruoyi.system.config.AliConfig;
|
import com.ruoyi.system.config.AliConfig;
|
||||||
import com.ruoyi.system.mapper.MusicInfoMapper;
|
import com.ruoyi.system.mapper.MusicInfoMapper;
|
||||||
import com.ruoyi.system.service.IMusicInfoService;
|
import com.ruoyi.system.service.IMusicInfoService;
|
||||||
|
import com.ruoyi.system.service.IUserHistoryService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@@ -29,6 +30,7 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MusicInfoMapper musicInfoMapper;
|
private MusicInfoMapper musicInfoMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询音乐信息
|
* 查询音乐信息
|
||||||
*
|
*
|
||||||
@@ -126,5 +128,36 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
|||||||
return musicInfoMapper.selectMusicInfoByCid(categoryId);
|
return musicInfoMapper.selectMusicInfoByCid(categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MusicInfo> findMusicByCollectId(String collectId) {
|
||||||
|
return musicInfoMapper.selectMusicByCollectId(collectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int addLikeMusic(String musicId) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
return musicInfoMapper.insertLikeMusic(userId,musicId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MusicInfo> findLikeMusicByUser(Long userId) {
|
||||||
|
return musicInfoMapper.selectLikeMusicByUser(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int cancelLikeMusic(String musicId) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
return musicInfoMapper.delLikeMusic(userId,musicId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int addHistoryMusic(String musicId) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
return musicInfoMapper.insertHistory(userId,musicId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MusicInfo> findHistoryMusicByUser(Long userId) {
|
||||||
|
return musicInfoMapper.selectHistoryMusicByUser(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.ShareInfo;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.system.mapper.ShareInfoMapper;
|
||||||
|
import com.ruoyi.system.service.IShareInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ShareInfoServiceImpl implements IShareInfoService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ShareInfoMapper shareInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ShareInfo selectShareInfoById(String id)
|
||||||
|
{
|
||||||
|
return shareInfoMapper.selectShareInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ShareInfo> selectShareInfoList(ShareInfo shareInfo)
|
||||||
|
{
|
||||||
|
return shareInfoMapper.selectShareInfoList(shareInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertShareInfo(ShareInfo shareInfo)
|
||||||
|
{
|
||||||
|
shareInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return shareInfoMapper.insertShareInfo(shareInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param shareInfo 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateShareInfo(ShareInfo shareInfo)
|
||||||
|
{
|
||||||
|
shareInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return shareInfoMapper.updateShareInfo(shareInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteShareInfoByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return shareInfoMapper.deleteShareInfoByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】信息
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteShareInfoById(String id)
|
||||||
|
{
|
||||||
|
return shareInfoMapper.deleteShareInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShareInfo> findShareInfoListPage(ShareInfo shareInfo) {
|
||||||
|
return shareInfoMapper.selectShareInfoListPage(shareInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ruoyi.common.core.domain.entity.MusicCollect;
|
||||||
import com.ruoyi.common.core.domain.entity.UserCollect;
|
import com.ruoyi.common.core.domain.entity.UserCollect;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.mapper.MusicCollectMapper;
|
||||||
import com.ruoyi.system.mapper.UserCollectMapper;
|
import com.ruoyi.system.mapper.UserCollectMapper;
|
||||||
import com.ruoyi.system.service.IUserCollectService;
|
import com.ruoyi.system.service.IUserCollectService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -20,6 +24,8 @@ public class UserCollectServiceImpl implements IUserCollectService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserCollectMapper userCollectMapper;
|
private UserCollectMapper userCollectMapper;
|
||||||
|
@Autowired
|
||||||
|
private MusicCollectMapper musicCollectMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户收藏音乐
|
* 查询用户收藏音乐
|
||||||
@@ -54,6 +60,9 @@ public class UserCollectServiceImpl implements IUserCollectService
|
|||||||
@Override
|
@Override
|
||||||
public int insertUserCollect(UserCollect userCollect)
|
public int insertUserCollect(UserCollect userCollect)
|
||||||
{
|
{
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
userCollect.setCollectId(IdUtil.getSnowflakeNextId());
|
||||||
|
userCollect.setUserId(userId);
|
||||||
userCollect.setCreateTime(DateUtils.getNowDate());
|
userCollect.setCreateTime(DateUtils.getNowDate());
|
||||||
return userCollectMapper.insertUserCollect(userCollect);
|
return userCollectMapper.insertUserCollect(userCollect);
|
||||||
}
|
}
|
||||||
@@ -94,4 +103,9 @@ public class UserCollectServiceImpl implements IUserCollectService
|
|||||||
{
|
{
|
||||||
return userCollectMapper.deleteUserCollectById(id);
|
return userCollectMapper.deleteUserCollectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int cancelBindMusic(MusicCollect musicCollect) {
|
||||||
|
return musicCollectMapper.delBindMusic(musicCollect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.UserHistory;
|
import com.ruoyi.common.core.domain.entity.UserHistory;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.system.mapper.UserHistoryMapper;
|
import com.ruoyi.system.mapper.UserHistoryMapper;
|
||||||
import com.ruoyi.system.service.IUserHistoryService;
|
import com.ruoyi.system.service.IUserHistoryService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -91,4 +92,15 @@ public class UserHistoryServiceImpl implements IUserHistoryService
|
|||||||
{
|
{
|
||||||
return userHistoryMapper.deleteUserHistoryById(id);
|
return userHistoryMapper.deleteUserHistoryById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertHistory(Long userId, String musicId) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteUserHistoryByMusicId(String[] musicIds) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
return userHistoryMapper.deleteUserHistoryByMusicId(musicIds,userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?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.MusicCollectMapper">
|
||||||
|
|
||||||
|
<resultMap type="MusicCollect" id="MusicCollectResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="musicId" column="music_id" />
|
||||||
|
<result property="collectId" column="collect_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectMusicCollectVo">
|
||||||
|
select id, music_id, collect_id from music_collect
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMusicCollectList" parameterType="MusicCollect" resultMap="MusicCollectResult">
|
||||||
|
<include refid="selectMusicCollectVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="musicId != null "> and music_id = #{musicId}</if>
|
||||||
|
<if test="collectId != null "> and collect_id = #{collectId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMusicCollectById" parameterType="String" resultMap="MusicCollectResult">
|
||||||
|
<include refid="selectMusicCollectVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMusicCollect" parameterType="MusicCollect" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into music_collect
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="musicId != null">music_id,</if>
|
||||||
|
<if test="collectId != null">collect_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="musicId != null">#{musicId},</if>
|
||||||
|
<if test="collectId != null">#{collectId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateMusicCollect" parameterType="MusicCollect">
|
||||||
|
update music_collect
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="musicId != null">music_id = #{musicId},</if>
|
||||||
|
<if test="collectId != null">collect_id = #{collectId},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMusicCollectById" parameterType="String">
|
||||||
|
delete from music_collect where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMusicCollectByIds" parameterType="String">
|
||||||
|
delete from music_collect where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="delBindMusic">
|
||||||
|
delete from music_collect where music_id= #{musicId} and collect_id=#{collectId}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@@ -135,4 +135,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectRecommendMusic" resultMap="MusicInfoResult">
|
<select id="selectRecommendMusic" resultMap="MusicInfoResult">
|
||||||
SELECT mi.* FROM music_recommend mr LEFT JOIN music_info mi on mr.music_id = mi.music_id and mi.is_del=0
|
SELECT mi.* FROM music_recommend mr LEFT JOIN music_info mi on mr.music_id = mi.music_id and mi.is_del=0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMusicByCollectId" resultMap="MusicInfoResult">
|
||||||
|
SELECT * FROM music_collect mc left join music_info mi on mi.music_id=mc.music_id WHERE mi.is_del=0 and mc.collect_id =#{collectId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertLikeMusic">
|
||||||
|
INSERT INTO user_like_music(music_id, user_id) values (#{musicId},#{userId})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectLikeMusicByUser" resultMap="MusicInfoResult">
|
||||||
|
SELECT * FROM user_like_music ulm LEFT JOIN music_info mi on ulm.music_id=mi.music_id WHERE ulm.user_id=#{userId} and mi.is_del=0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="delLikeMusic">
|
||||||
|
DELETE FROM user_like_music where music_id=#{musicId} and user_id=#{userId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="insertHistory">
|
||||||
|
INSERT INTO user_history(user_id, music_id) value (#{userId},#{musicId})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectHistoryMusicByUser" resultMap="MusicInfoResult">
|
||||||
|
SELECT * FROM user_history ulm LEFT JOIN music_info mi on ulm.music_id=mi.music_id WHERE ulm.user_id=#{userId} and mi.is_del=0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<?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.ShareInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="ShareInfo" id="ShareInfoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="shareDecs" column="share_decs" />
|
||||||
|
<result property="musicId" column="music_id" />
|
||||||
|
<result property="shareAddr" column="share_addr" />
|
||||||
|
<result property="sharePlat" column="share_plat" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="isDel" column="is_del" />
|
||||||
|
<result property="review" column="review" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectShareInfoVo">
|
||||||
|
select id, user_id, share_decs, music_id, share_addr, share_plat, create_time, update_time, is_del, review from share_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectShareInfoList" parameterType="ShareInfo" resultMap="ShareInfoResult">
|
||||||
|
<include refid="selectShareInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
<if test="shareDecs != null and shareDecs != ''"> and share_decs = #{shareDecs}</if>
|
||||||
|
<if test="musicId != null "> and music_id = #{musicId}</if>
|
||||||
|
<if test="shareAddr != null and shareAddr != ''"> and share_addr = #{shareAddr}</if>
|
||||||
|
<if test="sharePlat != null and sharePlat != ''"> and share_plat = #{sharePlat}</if>
|
||||||
|
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||||
|
<if test="review != null "> and review = #{review}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectShareInfoById" parameterType="String" resultMap="ShareInfoResult">
|
||||||
|
<include refid="selectShareInfoVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertShareInfo" parameterType="ShareInfo" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into share_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="shareDecs != null">share_decs,</if>
|
||||||
|
<if test="musicId != null">music_id,</if>
|
||||||
|
<if test="shareAddr != null">share_addr,</if>
|
||||||
|
<if test="sharePlat != null">share_plat,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="isDel != null">is_del,</if>
|
||||||
|
<if test="review != null">review,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="shareDecs != null">#{shareDecs},</if>
|
||||||
|
<if test="musicId != null">#{musicId},</if>
|
||||||
|
<if test="shareAddr != null">#{shareAddr},</if>
|
||||||
|
<if test="sharePlat != null">#{sharePlat},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="isDel != null">#{isDel},</if>
|
||||||
|
<if test="review != null">#{review},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateShareInfo" parameterType="ShareInfo">
|
||||||
|
update share_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
|
<if test="shareDecs != null">share_decs = #{shareDecs},</if>
|
||||||
|
<if test="musicId != null">music_id = #{musicId},</if>
|
||||||
|
<if test="shareAddr != null">share_addr = #{shareAddr},</if>
|
||||||
|
<if test="sharePlat != null">share_plat = #{sharePlat},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="isDel != null">is_del = #{isDel},</if>
|
||||||
|
<if test="review != null">review = #{review},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteShareInfoById" parameterType="String">
|
||||||
|
delete from share_info where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteShareInfoByIds" parameterType="String">
|
||||||
|
delete from share_info where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectShareInfoListPage" resultType="com.ruoyi.common.core.domain.entity.ShareInfo">
|
||||||
|
SELECT
|
||||||
|
su.username as username,
|
||||||
|
su.nickname as nickname,
|
||||||
|
su.head_img as headImg,
|
||||||
|
si.share_decs as shareDecs,
|
||||||
|
mi.name as `musicName`,
|
||||||
|
mi.img_addr as musicImgAddr,
|
||||||
|
mi.music_addr as musicAddr,
|
||||||
|
mi.author as musicAuthor
|
||||||
|
FROM share_info si
|
||||||
|
left join shop_user su on si.user_id = su.user_id
|
||||||
|
LEFT JOIN music_info mi on si.music_id = mi.music_id
|
||||||
|
WHERE mi.is_del=0
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -2,17 +2,6 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.ruoyi.system.mapper.ShopUserMapper">
|
<mapper namespace="com.ruoyi.system.mapper.ShopUserMapper">
|
||||||
|
|
||||||
<select id="selectShopUserByPhone" resultType="com.ruoyi.common.core.domain.entity.ShopUser">
|
|
||||||
SELECT * FROM shop_user where phone = #{phone}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectShopUserByUsername" resultType="com.ruoyi.common.core.domain.entity.ShopUser">
|
|
||||||
SELECT * FROM shop_user where username = #{username}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectShopUserByUsernameAndPass" resultType="com.ruoyi.common.core.domain.entity.ShopUser">
|
|
||||||
SELECT * FROM shop_user where username = #{username} and password = #{password}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- Insert -->
|
<!-- Insert -->
|
||||||
<insert id="insert" parameterType="com.ruoyi.common.core.domain.entity.ShopUser" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert" parameterType="com.ruoyi.common.core.domain.entity.ShopUser" useGeneratedKeys="true" keyProperty="id">
|
||||||
@@ -30,6 +19,9 @@
|
|||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="vip != null">vip,</if>
|
<if test="vip != null">vip,</if>
|
||||||
<if test="online != null">online,</if>
|
<if test="online != null">online,</if>
|
||||||
|
<if test="deviceId != null">device_id,</if>
|
||||||
|
<if test="deviceType != null">device_type,</if>
|
||||||
|
<if test="headImg != null">head_img,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
@@ -44,6 +36,9 @@
|
|||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="vip != null">#{vip},</if>
|
<if test="vip != null">#{vip},</if>
|
||||||
<if test="online != null">#{online},</if>
|
<if test="online != null">#{online},</if>
|
||||||
|
<if test="deviceId != null">#{deviceId},</if>
|
||||||
|
<if test="deviceType != null">#{deviceType},</if>
|
||||||
|
<if test="headImg != null">#{headImg},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -61,13 +56,16 @@
|
|||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="vip" column="vip" />
|
<result property="vip" column="vip" />
|
||||||
<result property="online" column="online" />
|
<result property="online" column="online" />
|
||||||
|
<result property="deviceId" column="device_id" />
|
||||||
|
<result property="deviceType" column="device_type" />
|
||||||
|
<result property="headImg" column="head_img" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="isDel" column="is_del" />
|
<result property="isDel" column="is_del" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectShopUserVo">
|
<sql id="selectShopUserVo">
|
||||||
select id, user_id, username, password, phone, nickname, sex, birthday, addr, register_time, status, vip, online, create_time, update_time, is_del from shop_user
|
select id, user_id, username, password,device_type,device_id, phone, nickname, sex, birthday, addr, register_time, status, vip, online, create_time, update_time, is_del,head_img from shop_user
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectShopUserList" parameterType="ShopUser" resultMap="ShopUserResult">
|
<select id="selectShopUserList" parameterType="ShopUser" resultMap="ShopUserResult">
|
||||||
@@ -89,6 +87,20 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectShopUserByPhone" resultMap="ShopUserResult">
|
||||||
|
SELECT * FROM shop_user where phone = #{phone}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectShopUserByUsername" resultMap="ShopUserResult">
|
||||||
|
SELECT * FROM shop_user where username = #{username}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectShopUserByUsernameAndPass" resultMap="ShopUserResult">
|
||||||
|
SELECT * FROM shop_user where username = #{username} and password = #{password}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectShopUserById" parameterType="String" resultMap="ShopUserResult">
|
<select id="selectShopUserById" parameterType="String" resultMap="ShopUserResult">
|
||||||
<include refid="selectShopUserVo"/>
|
<include refid="selectShopUserVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<resultMap type="UserCollect" id="UserCollectResult">
|
<resultMap type="UserCollect" id="UserCollectResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="userId" column="user_id" />
|
<result property="userId" column="user_id" />
|
||||||
<result property="musicId" column="music_id" />
|
<result property="collectId" column="collect_id" />
|
||||||
<result property="collectName" column="collect_name" />
|
<result property="collectName" column="collect_name" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
@@ -15,14 +15,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserCollectVo">
|
<sql id="selectUserCollectVo">
|
||||||
select id, user_id, music_id, collect_name, create_time, update_time, collect_type from user_collect
|
select id, user_id, collect_id, collect_name, create_time, update_time, collect_type from user_collect
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserCollectList" parameterType="UserCollect" resultMap="UserCollectResult">
|
<select id="selectUserCollectList" parameterType="UserCollect" resultMap="UserCollectResult">
|
||||||
<include refid="selectUserCollectVo"/>
|
<include refid="selectUserCollectVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="userId != null "> and user_id = #{userId}</if>
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
<if test="musicId != null "> and music_id = #{musicId}</if>
|
<if test="collectId != null "> and collect_id = #{collectId}</if>
|
||||||
<if test="collectName != null and collectName != ''"> and collect_name like concat('%', #{collectName}, '%')</if>
|
<if test="collectName != null and collectName != ''"> and collect_name like concat('%', #{collectName}, '%')</if>
|
||||||
<if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
|
<if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
|
||||||
</where>
|
</where>
|
||||||
@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">id,</if>
|
<if test="id != null">id,</if>
|
||||||
<if test="userId != null">user_id,</if>
|
<if test="userId != null">user_id,</if>
|
||||||
<if test="musicId != null">music_id,</if>
|
<if test="collectId != null">collect_id,</if>
|
||||||
<if test="collectName != null">collect_name,</if>
|
<if test="collectName != null">collect_name,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">#{id},</if>
|
<if test="id != null">#{id},</if>
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
<if test="musicId != null">#{musicId},</if>
|
<if test="collectId != null">#{collectId},</if>
|
||||||
<if test="collectName != null">#{collectName},</if>
|
<if test="collectName != null">#{collectName},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
@@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
update user_collect
|
update user_collect
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="userId != null">user_id = #{userId},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
<if test="musicId != null">music_id = #{musicId},</if>
|
<if test="collectId != null">collect_id = #{collectId},</if>
|
||||||
<if test="collectName != null">collect_name = #{collectName},</if>
|
<if test="collectName != null">collect_name = #{collectName},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
|||||||
@@ -58,4 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteUserHistoryByMusicId">
|
||||||
|
delete from user_history where user_history.music_id in
|
||||||
|
<foreach item="id" collection="musicIds" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
and user_id=#{userId}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user