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.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());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ 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:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|||||||
@@ -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
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
|
|||||||
@@ -59,4 +59,6 @@ public interface CategoryInfoMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCategoryInfoByIds(String[] ids);
|
public int deleteCategoryInfoByIds(String[] ids);
|
||||||
|
|
||||||
|
List<CategoryInfo> selectCategoryList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ 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接口
|
||||||
@@ -59,4 +60,6 @@ public interface ICategoryInfoService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCategoryInfoById(String id);
|
public int deleteCategoryInfoById(String id);
|
||||||
|
|
||||||
|
List<CategoryInfo> getCategory();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,4 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectCategoryList" resultType="com.ruoyi.common.core.domain.entity.CategoryInfo">
|
||||||
|
<include refid="selectCategoryInfoVo" /> where is_del = 0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user