【修复】教程修改分类不生效问题
This commit is contained in:
@@ -56,7 +56,7 @@ public class BizTutorialController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Result<String> update(@RequestBody Tutorial tutorial) {
|
public Result<String> update(@RequestBody Tutorial tutorial) {
|
||||||
return Result.isBool(tutorialService.updateById(tutorial));
|
return Result.isBool(tutorialService.update(tutorial));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class TutorialServiceImpl extends ServiceImpl<TutorialMapper, Tutorial> i
|
|||||||
@Override
|
@Override
|
||||||
public boolean update(Tutorial tutorial) {
|
public boolean update(Tutorial tutorial) {
|
||||||
super.updateById(tutorial);
|
super.updateById(tutorial);
|
||||||
tutorialCategoryRelationService.remove(new LambdaQueryWrapper<TutorialCategoryRelation>().eq(TutorialCategoryRelation::getCategoryId, tutorial.getCategoryId()));
|
tutorialCategoryRelationService.remove(new LambdaQueryWrapper<TutorialCategoryRelation>().eq(TutorialCategoryRelation::getTutorialId, tutorial.getId()));
|
||||||
TutorialCategoryRelation tutorialCategoryRelation = new TutorialCategoryRelation();
|
TutorialCategoryRelation tutorialCategoryRelation = new TutorialCategoryRelation();
|
||||||
tutorialCategoryRelation.setTutorialId(tutorial.getId());
|
tutorialCategoryRelation.setTutorialId(tutorial.getId());
|
||||||
tutorialCategoryRelation.setCategoryId(tutorial.getCategoryId());
|
tutorialCategoryRelation.setCategoryId(tutorial.getCategoryId());
|
||||||
|
|||||||
Reference in New Issue
Block a user