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.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IBannerInfoService; import com.ruoyi.system.service.IBannerInfoService;
import com.ruoyi.system.service.ICategoryInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -13,11 +15,24 @@ public class IndexController {
@Autowired @Autowired
private IBannerInfoService bannerInfoService; private IBannerInfoService bannerInfoService;
@Autowired
private ICategoryInfoService categoryInfoService;
/**
* @return com.ruoyi.common.core.domain.AjaxResult
* 获取banner
*/
@RequestMapping("/getBanner") @RequestMapping("/getBanner")
public AjaxResult getBanner(){ public AjaxResult getBanner(){
return AjaxResult.success(bannerInfoService.getEnableBanner()); 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; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -8,4 +10,12 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class MusicController { public class MusicController {
@Autowired
private IMusicInfoService musicService;
// 根据分类获取音乐
public void getMusicByCate(){
}
} }

View File

@@ -6,16 +6,16 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://192.168.31.55:3306/musicpro?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://rm-2ze15tecas1y876i8xo.mysql.rds.aliyuncs.com:3306/musicpro?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: music
password: root password: Q1w2e3r4
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: false
url: url:
username: username:
password: password:
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
@@ -39,7 +39,7 @@ spring:
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
webStatFilter: webStatFilter:
enabled: true enabled: true
statViewServlet: statViewServlet:
enabled: true enabled: true
@@ -58,4 +58,4 @@ spring:
merge-sql: true merge-sql: true
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true

View File

@@ -68,7 +68,7 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 192.168.31.55 host: 60.205.107.210
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
@@ -133,4 +133,4 @@ xss:
ali: ali:
accessKeyId: LTAI5tDWWzwqxumUXTFnkQFd accessKeyId: LTAI5tDWWzwqxumUXTFnkQFd
accessKeySecret: KOD3y6OxbHJ23wxAf68NFpUQXCQEPX accessKeySecret: KOD3y6OxbHJ23wxAf68NFpUQXCQEPX

View File

@@ -6,15 +6,15 @@ import java.util.List;
/** /**
* 【请填写功能名称】Mapper接口 * 【请填写功能名称】Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-07-15 * @date 2025-07-15
*/ */
public interface CategoryInfoMapper public interface CategoryInfoMapper
{ {
/** /**
* 查询【请填写功能名称】 * 查询【请填写功能名称】
* *
* @param id 【请填写功能名称】主键 * @param id 【请填写功能名称】主键
* @return 【请填写功能名称】 * @return 【请填写功能名称】
*/ */
@@ -22,7 +22,7 @@ public interface CategoryInfoMapper
/** /**
* 查询【请填写功能名称】列表 * 查询【请填写功能名称】列表
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 【请填写功能名称】集合 * @return 【请填写功能名称】集合
*/ */
@@ -30,7 +30,7 @@ public interface CategoryInfoMapper
/** /**
* 新增【请填写功能名称】 * 新增【请填写功能名称】
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 结果 * @return 结果
*/ */
@@ -38,7 +38,7 @@ public interface CategoryInfoMapper
/** /**
* 修改【请填写功能名称】 * 修改【请填写功能名称】
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 结果 * @return 结果
*/ */
@@ -46,7 +46,7 @@ public interface CategoryInfoMapper
/** /**
* 删除【请填写功能名称】 * 删除【请填写功能名称】
* *
* @param id 【请填写功能名称】主键 * @param id 【请填写功能名称】主键
* @return 结果 * @return 结果
*/ */
@@ -54,9 +54,11 @@ public interface CategoryInfoMapper
/** /**
* 批量删除【请填写功能名称】 * 批量删除【请填写功能名称】
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteCategoryInfoByIds(String[] ids); public int deleteCategoryInfoByIds(String[] ids);
List<CategoryInfo> selectCategoryList();
} }

View File

@@ -3,18 +3,19 @@ package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.CategoryInfo; import com.ruoyi.common.core.domain.entity.CategoryInfo;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 【请填写功能名称】Service接口 * 【请填写功能名称】Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-07-15 * @date 2025-07-15
*/ */
public interface ICategoryInfoService public interface ICategoryInfoService
{ {
/** /**
* 查询【请填写功能名称】 * 查询【请填写功能名称】
* *
* @param id 【请填写功能名称】主键 * @param id 【请填写功能名称】主键
* @return 【请填写功能名称】 * @return 【请填写功能名称】
*/ */
@@ -22,7 +23,7 @@ public interface ICategoryInfoService
/** /**
* 查询【请填写功能名称】列表 * 查询【请填写功能名称】列表
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 【请填写功能名称】集合 * @return 【请填写功能名称】集合
*/ */
@@ -30,7 +31,7 @@ public interface ICategoryInfoService
/** /**
* 新增【请填写功能名称】 * 新增【请填写功能名称】
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 结果 * @return 结果
*/ */
@@ -38,7 +39,7 @@ public interface ICategoryInfoService
/** /**
* 修改【请填写功能名称】 * 修改【请填写功能名称】
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 结果 * @return 结果
*/ */
@@ -46,7 +47,7 @@ public interface ICategoryInfoService
/** /**
* 批量删除【请填写功能名称】 * 批量删除【请填写功能名称】
* *
* @param ids 需要删除的【请填写功能名称】主键集合 * @param ids 需要删除的【请填写功能名称】主键集合
* @return 结果 * @return 结果
*/ */
@@ -54,9 +55,11 @@ public interface ICategoryInfoService
/** /**
* 删除【请填写功能名称】信息 * 删除【请填写功能名称】信息
* *
* @param id 【请填写功能名称】主键 * @param id 【请填写功能名称】主键
* @return 结果 * @return 结果
*/ */
public int deleteCategoryInfoById(String id); public int deleteCategoryInfoById(String id);
List<CategoryInfo> getCategory();
} }

View File

@@ -11,19 +11,19 @@ import java.util.List;
/** /**
* 【请填写功能名称】Service业务层处理 * 【请填写功能名称】Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-07-15 * @date 2025-07-15
*/ */
@Service @Service
public class CategoryInfoServiceImpl implements ICategoryInfoService public class CategoryInfoServiceImpl implements ICategoryInfoService
{ {
@Autowired @Autowired
private CategoryInfoMapper categoryInfoMapper; private CategoryInfoMapper categoryInfoMapper;
/** /**
* 查询【请填写功能名称】 * 查询【请填写功能名称】
* *
* @param id 【请填写功能名称】主键 * @param id 【请填写功能名称】主键
* @return 【请填写功能名称】 * @return 【请填写功能名称】
*/ */
@@ -35,7 +35,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService
/** /**
* 查询【请填写功能名称】列表 * 查询【请填写功能名称】列表
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 【请填写功能名称】 * @return 【请填写功能名称】
*/ */
@@ -47,7 +47,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService
/** /**
* 新增【请填写功能名称】 * 新增【请填写功能名称】
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 结果 * @return 结果
*/ */
@@ -60,7 +60,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService
/** /**
* 修改【请填写功能名称】 * 修改【请填写功能名称】
* *
* @param categoryInfo 【请填写功能名称】 * @param categoryInfo 【请填写功能名称】
* @return 结果 * @return 结果
*/ */
@@ -73,7 +73,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService
/** /**
* 批量删除【请填写功能名称】 * 批量删除【请填写功能名称】
* *
* @param ids 需要删除的【请填写功能名称】主键 * @param ids 需要删除的【请填写功能名称】主键
* @return 结果 * @return 结果
*/ */
@@ -85,7 +85,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService
/** /**
* 删除【请填写功能名称】信息 * 删除【请填写功能名称】信息
* *
* @param id 【请填写功能名称】主键 * @param id 【请填写功能名称】主键
* @return 结果 * @return 结果
*/ */
@@ -94,4 +94,9 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService
{ {
return categoryInfoMapper.deleteCategoryInfoById(id); return categoryInfoMapper.deleteCategoryInfoById(id);
} }
@Override
public List<CategoryInfo> getCategory() {
return categoryInfoMapper.selectCategoryList();
}
} }

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.CategoryInfoMapper"> <mapper namespace="com.ruoyi.system.mapper.CategoryInfoMapper">
<resultMap type="CategoryInfo" id="CategoryInfoResult"> <resultMap type="CategoryInfo" id="CategoryInfoResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="categoryId" column="category_id" /> <result property="categoryId" column="category_id" />
@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCategoryInfoList" parameterType="CategoryInfo" resultMap="CategoryInfoResult"> <select id="selectCategoryInfoList" parameterType="CategoryInfo" resultMap="CategoryInfoResult">
<include refid="selectCategoryInfoVo"/> <include refid="selectCategoryInfoVo"/>
<where> <where>
<if test="categoryId != null "> and category_id = #{categoryId}</if> <if test="categoryId != null "> and category_id = #{categoryId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="isDel != null "> and is_del = #{isDel}</if> <if test="isDel != null "> and is_del = #{isDel}</if>
@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modify != null and modify != ''"> and modify = #{modify}</if> <if test="modify != null and modify != ''"> and modify = #{modify}</if>
</where> </where>
</select> </select>
<select id="selectCategoryInfoById" parameterType="String" resultMap="CategoryInfoResult"> <select id="selectCategoryInfoById" parameterType="String" resultMap="CategoryInfoResult">
<include refid="selectCategoryInfoVo"/> <include refid="selectCategoryInfoVo"/>
where id = #{id} where id = #{id}
@@ -76,9 +76,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteCategoryInfoByIds" parameterType="String"> <delete id="deleteCategoryInfoByIds" parameterType="String">
delete from category_info where id in delete from category_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
</mapper>
<select id="selectCategoryList" resultType="com.ruoyi.common.core.domain.entity.CategoryInfo">
<include refid="selectCategoryInfoVo" /> where is_del = 0
</select>
</mapper>