This commit is contained in:
menxipeng
2025-07-16 16:33:05 +08:00
parent 991ca432e1
commit d4178f9043
8 changed files with 78 additions and 39 deletions

View File

@@ -3,7 +3,9 @@ package com.ruoyi.web.controller.client;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IBannerInfoService;
import com.ruoyi.system.service.ICategoryInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -13,11 +15,24 @@ public class IndexController {
@Autowired
private IBannerInfoService bannerInfoService;
@Autowired
private ICategoryInfoService categoryInfoService;
/**
* @return com.ruoyi.common.core.domain.AjaxResult
* 获取banner
*/
@RequestMapping("/getBanner")
public AjaxResult getBanner(){
return AjaxResult.success(bannerInfoService.getEnableBanner());
}
// 获取分类
@GetMapping("/getCategory")
public AjaxResult getCategory(){
return AjaxResult.success(categoryInfoService.getCategory());
}
}

View File

@@ -1,6 +1,8 @@
package com.ruoyi.web.controller.client;
import com.ruoyi.system.service.IMusicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -8,4 +10,12 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class MusicController {
@Autowired
private IMusicInfoService musicService;
// 根据分类获取音乐
public void getMusicByCate(){
}
}

View File

@@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://192.168.31.55:3306/musicpro?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
url: jdbc:mysql://rm-2ze15tecas1y876i8xo.mysql.rds.aliyuncs.com:3306/musicpro?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: music
password: Q1w2e3r4
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@@ -68,7 +68,7 @@ spring:
# redis 配置
redis:
# 地址
host: 192.168.31.55
host: 60.205.107.210
# 端口默认为6379
port: 6379
# 数据库索引

View File

@@ -59,4 +59,6 @@ public interface CategoryInfoMapper
* @return 结果
*/
public int deleteCategoryInfoByIds(String[] ids);
List<CategoryInfo> selectCategoryList();
}

View File

@@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.CategoryInfo;
import java.util.List;
import java.util.Map;
/**
* 【请填写功能名称】Service接口
@@ -59,4 +60,6 @@ public interface ICategoryInfoService
* @return 结果
*/
public int deleteCategoryInfoById(String id);
List<CategoryInfo> getCategory();
}

View File

@@ -94,4 +94,9 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService
{
return categoryInfoMapper.deleteCategoryInfoById(id);
}
@Override
public List<CategoryInfo> getCategory() {
return categoryInfoMapper.selectCategoryList();
}
}

View File

@@ -81,4 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectCategoryList" resultType="com.ruoyi.common.core.domain.entity.CategoryInfo">
<include refid="selectCategoryInfoVo" /> where is_del = 0
</select>
</mapper>