数据库连接换成华为云

master
rong.liu 2 years ago
parent 6b75a6e611
commit 7f97d853b9
  1. 18
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  2. 4
      src/main/resources/application-dev.yml

@ -90,23 +90,7 @@ public class SysColumnController {
@ApiOperation(value = "栏目排序(依据id更改)", response = SysColumn.class)
public R sortByColumn(@RequestBody List<SortColumnRespVO> sortColumnRespVOList) {
for (SortColumnRespVO sort : sortColumnRespVOList) {
SysColumn sysColumn = new SysColumn();
BeanUtils.copyProperties(sort, sysColumn);
service.updateById(sysColumn);
//依据当前循环获取的栏目id,查询到引用当前栏目的文章对其进行修改栏目id
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column_id", sysColumn.getId());
List<SysContent> contentList = contentService.list(queryWrapper);
if (contentList.size() > 0) {
for (SysContent content : contentList) {
UpdateWrapper<SysContent> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("column_id", sysColumn.getId());
contentService.update(content, updateWrapper);
}
}
}
return R.success();
}
}

@ -6,9 +6,9 @@ spring:
datasource:
master:
username: root
password: 123456
password: HuoRan@2021
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
url: jdbc:mysql://139.9.47.170:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
cache:
type: redis
redis:

Loading…
Cancel
Save