咨询等功能完善
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.ruoyi.web.controller.back;
|
||||
|
||||
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.ConsultInfo;
|
||||
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.IConsultInfoService;
|
||||
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-08-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/info")
|
||||
public class ConsultInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IConsultInfoService consultInfoService;
|
||||
|
||||
/**
|
||||
* 查询咨询列列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ConsultInfo consultInfo)
|
||||
{
|
||||
startPage();
|
||||
List<ConsultInfo> list = consultInfoService.selectConsultInfoList(consultInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出咨询列列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:export')")
|
||||
@Log(title = "咨询列", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ConsultInfo consultInfo)
|
||||
{
|
||||
List<ConsultInfo> list = consultInfoService.selectConsultInfoList(consultInfo);
|
||||
ExcelUtil<ConsultInfo> util = new ExcelUtil<ConsultInfo>(ConsultInfo.class);
|
||||
util.exportExcel(response, list, "咨询列数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取咨询列详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(consultInfoService.selectConsultInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增咨询列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:add')")
|
||||
@Log(title = "咨询列", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ConsultInfo consultInfo)
|
||||
{
|
||||
return toAjax(consultInfoService.insertConsultInfo(consultInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改咨询列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:edit')")
|
||||
@Log(title = "咨询列", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ConsultInfo consultInfo)
|
||||
{
|
||||
return toAjax(consultInfoService.updateConsultInfo(consultInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除咨询列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:remove')")
|
||||
@Log(title = "咨询列", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(consultInfoService.deleteConsultInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class IndexController extends BaseController {
|
||||
return AjaxResult.success(categoryInfoService.getCategory());
|
||||
}
|
||||
|
||||
// 根据分类获取分类音乐
|
||||
// 根据分类获取分类音乐 TODO: 分类播放
|
||||
@GetMapping("/cate/music/{categoryId}")
|
||||
public TableDataInfo getCategoryMusic(@PathVariable String categoryId){
|
||||
startPage();
|
||||
@@ -68,7 +68,7 @@ public class IndexController extends BaseController {
|
||||
}
|
||||
|
||||
@GetMapping("/re/music/{reId}")
|
||||
// 获取推荐音乐
|
||||
// 获取推荐音乐 TODO: 推荐播放
|
||||
public TableDataInfo getRecommendMusicByReId(@PathVariable String reId){
|
||||
startPage();
|
||||
List<MusicInfo> list = recommendInfoService.findRecommendMusicByReId(reId);
|
||||
|
||||
@@ -34,9 +34,9 @@ public class MusicController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
// 创建歌单
|
||||
// 获取收藏音乐 TODO: 收藏播放
|
||||
@RequestMapping("/collect/music/{collectId}")
|
||||
public TableDataInfo createPlaylist(@PathVariable String collectId){
|
||||
public TableDataInfo collectPlaylist(@PathVariable String collectId){
|
||||
startPage();
|
||||
List<MusicInfo> list = musicService.findMusicByCollectId(collectId);
|
||||
//musicService.createPlaylist();
|
||||
@@ -51,7 +51,7 @@ public class MusicController extends BaseController {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
// 获取我喜欢的音乐
|
||||
// 获取我喜欢的音乐 TODO: 喜欢播放
|
||||
@RequestMapping("/like/music")
|
||||
public TableDataInfo likeMusic(){
|
||||
startPage();
|
||||
@@ -74,7 +74,7 @@ public class MusicController extends BaseController {
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
|
||||
// 查询历史
|
||||
// 查询历史 TODO: 历史播放
|
||||
@RequestMapping("/history/music")
|
||||
public TableDataInfo historyMusic(){
|
||||
startPage();
|
||||
@@ -116,4 +116,28 @@ public class MusicController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取下一首播放的音乐ID
|
||||
* @param playMode 播放模式:1-顺序播放,2-随机播放
|
||||
* @param playlistType 播放列表类型:1-历史播放,2-分类播放,3-推荐播放,4-收藏播放,5-喜欢播放
|
||||
* @param categoryId 分类ID,当playlistType=2时必填
|
||||
* @param collectId 收藏ID,当playlistType=4时必填
|
||||
* @param reId 推荐ID,当playlistType=3时必填
|
||||
* @param currentMusicId 当前播放的音乐ID,用于顺序播放时获取下一首
|
||||
* @return 下一首音乐ID
|
||||
*/
|
||||
@GetMapping("/getNextMusicId")
|
||||
public AjaxResult getNextMusicId(@RequestParam(defaultValue = "1") Integer playMode,
|
||||
@RequestParam Integer playlistType,
|
||||
@RequestParam(required = false) String categoryId,
|
||||
@RequestParam(required = false) String collectId,
|
||||
@RequestParam(required = false) String reId,
|
||||
@RequestParam(required = false) String currentMusicId){
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
String nextMusicId = musicService.getNextMusicId(userId, playMode, playlistType, categoryId, collectId, reId,currentMusicId);
|
||||
return AjaxResult.success("请求成功",nextMusicId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ spring:
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
max-file-size: 500MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
max-request-size: 1000MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
@@ -138,4 +138,5 @@ umApp:
|
||||
appAliKey: 204918113
|
||||
appAliSecret: v4UrIhhLZlo0adpmevyCfvThGFbrRer0
|
||||
androidKey: 687b2df479267e0210b79b6f
|
||||
IOSKey: 687b2e1679267e0210b79b70
|
||||
IOSKey: 687b2e1679267e0210b79b70
|
||||
|
||||
|
||||
Reference in New Issue
Block a user