p配置
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
multi-statement-allow: true
|
||||
|
||||
@@ -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
|
||||
accessKeySecret: KOD3y6OxbHJ23wxAf68NFpUQXCQEPX
|
||||
|
||||
@@ -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<CategoryInfo> selectCategoryList();
|
||||
}
|
||||
|
||||
@@ -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<CategoryInfo> getCategory();
|
||||
}
|
||||
|
||||
@@ -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<CategoryInfo> getCategory() {
|
||||
return categoryInfoMapper.selectCategoryList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.CategoryInfoMapper">
|
||||
|
||||
|
||||
<resultMap type="CategoryInfo" id="CategoryInfoResult">
|
||||
<result property="id" column="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">
|
||||
<include refid="selectCategoryInfoVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="categoryId != null "> and category_id = #{categoryId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCategoryInfoById" parameterType="String" resultMap="CategoryInfoResult">
|
||||
<include refid="selectCategoryInfoVo"/>
|
||||
where id = #{id}
|
||||
@@ -76,9 +76,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<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=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
<select id="selectCategoryList" resultType="com.ruoyi.common.core.domain.entity.CategoryInfo">
|
||||
<include refid="selectCategoryInfoVo" /> where is_del = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user