diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/IndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/IndexController.java index 60bcdce..7ffd6d0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/IndexController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/IndexController.java @@ -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()); + } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/MusicController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/MusicController.java index fb95c8d..3181af3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/MusicController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/MusicController.java @@ -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(){ + + } + } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index a1774d6..1c47c23 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,16 +6,16 @@ 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: # 从数据源开关/默认关闭 enabled: false - url: - username: - password: + url: + username: + password: # 初始连接数 initialSize: 5 # 最小连接池数量 @@ -39,7 +39,7 @@ spring: testWhileIdle: true testOnBorrow: false testOnReturn: false - webStatFilter: + webStatFilter: enabled: true statViewServlet: enabled: true @@ -58,4 +58,4 @@ spring: merge-sql: true wall: config: - multi-statement-allow: true \ No newline at end of file + multi-statement-allow: true diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 2ea4c90..6ae4c7f 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -68,7 +68,7 @@ spring: # redis 配置 redis: # 地址 - host: 192.168.31.55 + host: 60.205.107.210 # 端口,默认为6379 port: 6379 # 数据库索引 @@ -133,4 +133,4 @@ xss: ali: accessKeyId: LTAI5tDWWzwqxumUXTFnkQFd - accessKeySecret: KOD3y6OxbHJ23wxAf68NFpUQXCQEPX \ No newline at end of file + accessKeySecret: KOD3y6OxbHJ23wxAf68NFpUQXCQEPX diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java index 97ba724..3671819 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java @@ -6,15 +6,15 @@ import java.util.List; /** * 【请填写功能名称】Mapper接口 - * + * * @author ruoyi * @date 2025-07-15 */ -public interface CategoryInfoMapper +public interface CategoryInfoMapper { /** * 查询【请填写功能名称】 - * + * * @param id 【请填写功能名称】主键 * @return 【请填写功能名称】 */ @@ -22,7 +22,7 @@ public interface CategoryInfoMapper /** * 查询【请填写功能名称】列表 - * + * * @param categoryInfo 【请填写功能名称】 * @return 【请填写功能名称】集合 */ @@ -30,7 +30,7 @@ public interface CategoryInfoMapper /** * 新增【请填写功能名称】 - * + * * @param categoryInfo 【请填写功能名称】 * @return 结果 */ @@ -38,7 +38,7 @@ public interface CategoryInfoMapper /** * 修改【请填写功能名称】 - * + * * @param categoryInfo 【请填写功能名称】 * @return 结果 */ @@ -46,7 +46,7 @@ public interface CategoryInfoMapper /** * 删除【请填写功能名称】 - * + * * @param id 【请填写功能名称】主键 * @return 结果 */ @@ -54,9 +54,11 @@ public interface CategoryInfoMapper /** * 批量删除【请填写功能名称】 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteCategoryInfoByIds(String[] ids); + + List selectCategoryList(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICategoryInfoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICategoryInfoService.java index 8b0ada7..77b10f4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICategoryInfoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICategoryInfoService.java @@ -3,18 +3,19 @@ package com.ruoyi.system.service; import com.ruoyi.common.core.domain.entity.CategoryInfo; import java.util.List; +import java.util.Map; /** * 【请填写功能名称】Service接口 - * + * * @author ruoyi * @date 2025-07-15 */ -public interface ICategoryInfoService +public interface ICategoryInfoService { /** * 查询【请填写功能名称】 - * + * * @param id 【请填写功能名称】主键 * @return 【请填写功能名称】 */ @@ -22,7 +23,7 @@ public interface ICategoryInfoService /** * 查询【请填写功能名称】列表 - * + * * @param categoryInfo 【请填写功能名称】 * @return 【请填写功能名称】集合 */ @@ -30,7 +31,7 @@ public interface ICategoryInfoService /** * 新增【请填写功能名称】 - * + * * @param categoryInfo 【请填写功能名称】 * @return 结果 */ @@ -38,7 +39,7 @@ public interface ICategoryInfoService /** * 修改【请填写功能名称】 - * + * * @param categoryInfo 【请填写功能名称】 * @return 结果 */ @@ -46,7 +47,7 @@ public interface ICategoryInfoService /** * 批量删除【请填写功能名称】 - * + * * @param ids 需要删除的【请填写功能名称】主键集合 * @return 结果 */ @@ -54,9 +55,11 @@ public interface ICategoryInfoService /** * 删除【请填写功能名称】信息 - * + * * @param id 【请填写功能名称】主键 * @return 结果 */ public int deleteCategoryInfoById(String id); + + List getCategory(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java index 14f9346..aa12656 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java @@ -11,19 +11,19 @@ import java.util.List; /** * 【请填写功能名称】Service业务层处理 - * + * * @author ruoyi * @date 2025-07-15 */ @Service -public class CategoryInfoServiceImpl implements ICategoryInfoService +public class CategoryInfoServiceImpl implements ICategoryInfoService { @Autowired private CategoryInfoMapper categoryInfoMapper; /** * 查询【请填写功能名称】 - * + * * @param id 【请填写功能名称】主键 * @return 【请填写功能名称】 */ @@ -35,7 +35,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService /** * 查询【请填写功能名称】列表 - * + * * @param categoryInfo 【请填写功能名称】 * @return 【请填写功能名称】 */ @@ -47,7 +47,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService /** * 新增【请填写功能名称】 - * + * * @param categoryInfo 【请填写功能名称】 * @return 结果 */ @@ -60,7 +60,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService /** * 修改【请填写功能名称】 - * + * * @param categoryInfo 【请填写功能名称】 * @return 结果 */ @@ -73,7 +73,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService /** * 批量删除【请填写功能名称】 - * + * * @param ids 需要删除的【请填写功能名称】主键 * @return 结果 */ @@ -85,7 +85,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService /** * 删除【请填写功能名称】信息 - * + * * @param id 【请填写功能名称】主键 * @return 结果 */ @@ -94,4 +94,9 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService { return categoryInfoMapper.deleteCategoryInfoById(id); } + + @Override + public List getCategory() { + return categoryInfoMapper.selectCategoryList(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml index 96d43b7..1cdc7a1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + where is_del = 0 + +